I have this:
import maya.api.OpenMaya as om
import maya.cmds as cmds
for mesh in cmds.ls(type='mesh'):
selectionList = om.MSelectionList()
selectionList.add(mesh)
dagPath = selectionList.getDagPath(0)
fnMesh = om.MFnMesh(dagPath) # got it!
Is this the simplest/nicest way to iterate over all meshes and get the MFnMesh object or how would you improve this?
I’m asking primarily for readability purposes.
Regards,
Fredrik
--
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/0d51a540-0273-4b51-9ff8-68f04e327923%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.