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')
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 GROUP for sEng in shadEngs: print(sEng.members() )
--To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c6c3561c-599a-4b72-8ce2-ce484fa7e334%40googlegroups.com.
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.
Thank you so much for your help! Have a wonderful day!
--
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/52ee2cf0-5753-4141-b955-67891ccc910f%40googlegroups.com.