# Select material Per-polygon material question

**URL:** https://forum.highend3d.com/t/select-material-per-polygon-material-question/7633
**Category:** Maya
**Tags:** mel
**Created:** [September 22, 2000, 11:23pm UTC](https://forum.highend3d.com/t/select-material-per-polygon-material-question/7633 "2000-09-22T23:23:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jimn](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ebca7d/32.png) [@jimn](https://forum.highend3d.com/u/jimn)
#### Post date: [September 22, 2000, 11:23pm UTC](https://forum.highend3d.com/t/select-material-per-polygon-material-question/7633/1 "2000-09-22T23:23:17Z")

</div>

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!

- Jim Napier

---

<div class="post-metadata">

### Author: ![glocker](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glocker](https://forum.highend3d.com/u/glocker)
#### Post date: [September 27, 2000, 11:21pm UTC](https://forum.highend3d.com/t/select-material-per-polygon-material-question/7633/2 "2000-09-27T23:21:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![rstebbing](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/r/77aa72/32.png) [@rstebbing](https://forum.highend3d.com/u/rstebbing)
#### Post date: [October 3, 2000, 1:56pm UTC](https://forum.highend3d.com/t/select-material-per-polygon-material-question/7633/3 "2000-10-03T13:56:04Z")

</div>

//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;  
}
