Maya doesn't differentiate between separated meshes in a single mesh node.
There is no "subMesh". However Mesh>Seperate seems to do this so I would
check out what that is doing. "SeparatePolygon" I think is the command.

-Nick


On Thu, Jun 13, 2013 at 11:36 AM, Christian Akesson <cakesso...@gmail.com>wrote:

> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To post to this group, send email to python_inside_maya@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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_maya+unsubscr...@googlegroups.com.
To post to this group, send email to python_inside_maya@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to