For me getChildren() will only return the shapeNode and not the subMeshes. To 
clarify, I want to get to the face sets of the sub meshes that you would get if 
you were to run polySeparate(). You can also see that Maya is aware by double 
clicking a face of a sub mesh (it selects the entire sub mesh).

The following code gets me the sub mesh face set, but I was wondering if there 
is a more efficient way:

import pymel.core
from pymel.all import mel
def getSubMeshFaceSet(face):
        numSel = 1
        totalSel = 0
        oSel = pymel.core.general.selected()
        pymel.core.general.select(face, r=1)
        while(numSel != totalSel):
                numSel = len(pymel.core.general.ls(sl=True, flatten=True))
                mel.PolySelectTraverse(1)
                totalSel = len(pymel.core.general.ls(sl=True, flatten=True))
                
        faces = pymel.core.general.ls(sl=True, flatten=True)
        if oSel:
            pymel.core.general.select(oSel, r=1)
        else:
            pymel.core.general.select(cl=1)
        return faces

Thanks,
/Christian

-- 
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to