Texture Nightmare

Hi all,
Does anyone know how to find the material applied to a single face of a polygon using MEL?
I have queried the object but only one material is returned and I have applied different materials to different faces of a polygon and what to be able to find out what material is applied to which face automatically.
Thanks
Tricky

I think this is something that is much easier to do in the API, but you can do it in a round-about way in MEL.

From the face go up to the shape node that it is a part of. Query the shadingEngine connections -- listConnections -s 0 -d 1 -type "shadingEngine" -- to get yourself a list of the SG sets. Look in each of those sets for the face you started with. Whichever has it is your material.

--JeffD

JeffD,
You are a star, Thanks a lot this has solved a lot of problems![img]http://64.32.63.100/forums/icons/smile.gif[/img]
Tricky