// assuming you've selected a face
sel = cmds.ls(sl=True)
cmds.hyperShade( shaderNetworksSelectMaterialNodes=True )
print "%s -> %s" % (sel[0], cmds.ls(sl=True)[0])
cmds.select(sel, replace=True)


On May 27, 2:23 pm, MaloW <[email protected]> wrote:
> Hi, I'm working on creating an .obj-exporter as a part of a school
> project using MEL, Python and PyMEL. I've got it working great, but
> right now it can't export several materials for 1 object. My teacher
> wasn't quite sure how to do this either but told me that I could ask
> here.
> How can I from a face, and not from the object, find out which
> material is connected to it, so that I can export the materials per-
> face and not per-object? I've tried looking at the documentation of
> PyMEL as well as using dir() inside maya on a face, but I found
> nothing that I thought could be of use.
> Any help is appreciated, thanks.

-- 
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