import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
meshes= []sels= cmds.ls(sl=1)MSel = OpenMaya.MSelectionList()for i, each in enumerate(sels): if cmds.nodeType(each) != "mesh": assert False else: MSel.add(each, i) ##MObj= OpenMaya.MObject() MDagPath= OpenMaya.MDagPath() MSel.getDagPath(0, MDagPath) dagObj = MDagPath.transform().__str__()
print dagObj if dagObj not in meshes: meshes.append(dagObj)--
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/bce21f4c-6ab7-47b2-ac0a-452aae60e0c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
dagObj = MDagPath.transform()result= OpenMaya.MFnDagNode(dagObj)obj = result.partialPathName()