Pretty close and you have the right idea.
but there is an easier way to get the member sets

import pymel.core as pm
# MAKE THE GEOM A PYNODE
geom = pm.PyNode("pSphere1")
# GET THE SHAPE NODE
geomShape = geom.getShape()
# GET A LIST OF SHADING ENGINES INPUTS
shadEngs = geomShape.inputs(type='shadingEngine')
# MEMBERS WILL LIST THE FACES in EACH SHADING GROUPfor sEng in shadEngs:
    print(sEng.members() )




On Thu, May 1, 2014 at 3:34 PM, Andres Weber <[email protected]> wrote:

>
>
>
>
>
> import pymel.core as pm
>
>
> def getFaces(shadingGroup):
>
>         pm.hyperShade(objects=shadingGroup)
>
>         faces=[]
>
>         for obj in pm.ls(sl=True):
>
>                 faces.extend( pm.polyListComponentConversion(obj, tf=True)
> )
>
>         return faces
>
>
>
> a=getFaces('lambert2SG')
> Not crazy about it (I hate things that are selection based) but it gets
> the job done and it was quick to write.
>
>
>
> On Tuesday, April 29, 2014 3:30:13 AM UTC-4, Chi Ngai Lai wrote:
>>
>> May I know how to get faces, which might be from different models, from a
>> selected shadingEngine? Could someone help? Thank you very much in advance!
>
>  --
> 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/c6c3561c-599a-4b72-8ce2-ce484fa7e334%40googlegroups.com<https://groups.google.com/d/msgid/python_inside_maya/c6c3561c-599a-4b72-8ce2-ce484fa7e334%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CABPXW4gbyVDv-P6PXJLq4Vr9EapX26j7RjDmhE4wEKKsRR1zxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to