Thanks for the fast answers!
After reading through your answers I manage to solve it using this
code:
To check if the material is applied for the entire object:
     sgs = pm.ls(type='shadingEngine');
     for sg in sgs:
         mems = sg.members(flatten=True);
         for mem in mems:
            if mem.name() == node.name():
                # Material is applied per object

And if that gets false it means materials are applied by face:
     sgs = pm.ls(type='shadingEngine');
     for sg in sgs:
         mems = sg.members(flatten=True);
         for mem in mems:
             if face in mem:
                 # if face in mem gets true as long as the
                 # [] place is correct, so I have to check
                 # node name as well.
                 temp = mem.name().split('.')[0];
                 if node.name() == temp:
                     # Material is applied by face

Thanks again for your answers!

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to