I have this:

import maya.api.OpenMaya as omimport 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWPZSAxeqa6D%3Dj_xGa4zhcR0EYRLpAzRBDcZaWM%2Bnukf_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to