getting shape object from a command

16 views
Skip to first unread message

Michał Frątczak

unread,
Oct 7, 2014, 10:21:07 AM10/7/14
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

Michał Frątczak

unread,
Oct 7, 2014, 11:55:06 AM10/7/14
to python_in...@googlegroups.com
It seems I need to enclose my shape's data into MFnPluginData. Then I can write this into output attribute of shape, and get to that from DoIt().
Is there any easier method ? 
Reply all
Reply to author
Forward
0 new messages