RE: [Maya-Python] getting shape object from a command

89 views
Skip to first unread message

br...@meljunky.com

unread,
Oct 7, 2014, 11:57:56 AM10/7/14
to python_in...@googlegroups.com
You could use the method extendToShape from MDagPath:
OpenMaya.MDagPath.extendToShape (
)
So, it should be:
dagPath.extendToShape()


-brian

-------- Original Message --------
Subject: [Maya-Python] getting shape object from a command
From: Michał_Frątczak <f.mi...@gmail.com>
Date: Tue, October 07, 2014 9:21 am
To: python_in...@googlegroups.com

Hi
I've got a c++ question, hope you don't mind :)

I'm developing a plugin that has a command and a MySurfShape derived from MPxSurfaceShape.
I need to get pointer to shape from within doIt() method of the command - is it at all possible? If not, how do I get shape's guts from a command ?

MStatus stat = MS::kSuccess;
MArgDatabase argDB(syntax(), args, &stat);

// get shape - first selected object
MSelectionList list;
argDB.getObjects(list);
MDagPath dagPath;
list.getDagPath(0, dagPath);

// get my shape ? how ?
MySurfShape* p_shape = ?????

 
thanks
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d4d0e8a0-8c9a-443a-b74c-75e228563731%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michał Frątczak

unread,
Oct 7, 2014, 12:06:31 PM10/7/14
to python_in...@googlegroups.com
No, extendToShape just modifies the dagpath, while I need to get a pointer to my specific class.
Reply all
Reply to author
Forward
0 new messages