//This script was written by Ben Bathen //www.benbathen.com //this script graphs the material on only the selected faces. //select several faces with different shaders and run the script. global proc graphFaceMaterials() { //put the selected faces into a string. string $selFace[] = `ls -sl`; //count how many faces you have selected. int $numSelected = `size $selFace`; //loop through the faces find out wich shader they belong to and put the names of the shaders into a string. int $i; string $surfShader[]; for ($i = 0; $i < $numSelected; $i++) { string $shaderGroup[] = `listSets -type 1 -o $selFace[$i]`; print ("this face is in " + $shaderGroup[0]); string $shader[] = `listConnections -d off -s on ($shaderGroup[0] + ".surfaceShader")`; $surfShader[$i] = $shader[0]; } select -r $surfShader; hyperShadePanelGraphCommand("hyperShadePanel1", "showUpAndDownstream"); select -r $selFace; }