Anyone know how to find out which material is assigned to a selected face? I have a large mesh with different materials assigned to the faces. I'd like to select a face, and then select the material assigned to the face.
Thanks!
If this is for a plug-in, you could use either getConnectedSetsAndMembers() or getConnectedShaders() in the MFnMesh class.
If you need MEL, you might be able to use ls -sl with other flags like -mat to get your information.
g
//Author: Randy Stebbing//Date: 4/3/00//Select a polygon face and run the lines below and it will select all faces that have the same material assignment.//In addition it will open the attribute editor for the shading group that is assigned to that polygon.
global proc pc(){$curFace = ls -sl;$shadGroup = listSets -type 1 -object $curFace; select -add $shadGroup;select -ne -add $shadGroup;openAEWindow;}
ls -sl
listSets -type 1 -object $curFace