I want to put in a selection list only the mesh and nurbsSurface shape
nodes (both of them) (no transforms)
So I used this code in my command plugin :
*# creates the selection*
*geoMSelectionList = OM.MSelectionList()
OM.MGlobal.getSelectionListByName("*", geoMSelectionList)
**iterate=OM.MItSelectionList(geoMSelectionList,OM.MFn.kSurface) # in my
selection iteration I want to filter on the kMesh or kNurbsSurface*
*
# this is the code to print out the selection list and the api type of each
filtered object in the selection*
*fnDagNode=OM.MFnDagNode()
objMObject=OM.MObject()
iterate.reset()
while (not iterate.isDone()):
iterate.getDependNode(objMObject)
fnDagNode.setObject(objMObject)
print(fnDagNode.fullPathName()+" ("+objMObject.apiTypeStr()+")")
iterate.next()
*Now, I create one *nurbs sphere and one poly sphere* and this is the result
I get :
*|nurbsSphere1|nurbsSphereShape1 (kNurbsSurface)
|nurbsSphere1|nurbsSphereShape1 (kNurbsSurface)
|pSphere1|pSphereShape1 (kMesh)
|pSphere1|pSphereShape1 (kMesh)*
Anyone can help me to understand why it's grabbing each object *twice* ???
(I thought it was grabbing (somehow) the transform nodes, that's why I
decided to check out the api type too)
Alessandro
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---