I was doing a dummy command for debugging and testing certain funcs , and 
what I usually do is  use

MGlobal::getSelectionListByName("pSphereShape1" , sel );

now it became redundant af , so I came up with a way to get the actual 
selected mesh and shiet :

MObjectArray mesh_list;
    MSelectionList sel;
if( sel.length() == 0)
MGlobal::displayError("no selection");
return MS::kFailure;

    MItSelectionList mitsel(sel);

MObject cur_obj; 

        if (cur_obj.hasFn(MFn::kMesh) )
            mesh_list.append( cur_obj );
        else if ( cur_obj.hasFn(MFn::kTransform) )

MFnTransform fntransform( cur_obj );
            for (int i=0 ;i < fntransform.childCount() ;++i )

if (fntransform.child(i).hasFn(MFn::kMesh))



do you guys , do it similarly or in a different way ? 

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_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to