May9 - Maya custom tools and prefs 1.10.9 for Maya (maya script)
May9 is a set of settings and tools for Autodesk Maya, from community user base.
Feature Request
poly face z marking menu
| Status: | added |
|---|---|
| Date: | 10/15/2015 |
| Submitted by: |
|
| Modify this request | edit |
on marking menu, after "select all" : can we add "select by shader".
user select a face, "select by shader" will select all faces with same shader.
//this is by Dragos Olariu
// dragosholariu@yahoo.com
global proc do_Sel_by_mat()
{
////////////////////////////////////////
//Obtains object name from a selected face. Removes the ".f[xx]" part.
///////////////////////////////////////
string $face_sel[] = `ls -selection`;
string $obj_sel = stringArrayToString($face_sel, "");
print $obj_sel;
string $array[];
$array = stringToStringArray($obj_sel, ".");
$array[1]="";
string $curent_obj = stringArrayToString($array, "");
print $curent_obj;
////////////////////////////////////////
/////////////////////////////////////////
////////////////////////////////////////
string $faceSG = "";
//list array of faces
string $selectedFaces[] = `filterExpand -ex true -sm 34`;
// Get array of all Shading Groups
string $shadingGroups[] = `ls -type shadingEngine`;
for ( $shadingGroup in $shadingGroups )
{
// If this facet is a member of the shading set for this
// Shading Group, tag this as the facet's shader
if ( `sets -isMember $shadingGroup $selectedFaces` )
{
$faceSG = $shadingGroup;
break;
}
}
///////////////////////////////////////////////////////////////////
// Get name of Material from the above Shadergroup name.
///////////////////////////////////////////////////////////////////
string $matName = "";
if ( "shadingEngine" == `nodeType $faceSG` &&
`connectionInfo -id ( $faceSG + ".surfaceShader" )` )
{
$matName = rootNode( `connectionInfo -sfd
( $faceSG + ".surfaceShader" )` );
}
select -cl;
select -r $matName;
select -tgl $curent_obj;
materialSelect();
}
Comments on this feature request:
Davide Alidosi said about 11 years ago:
Davide Alidosi said about 11 years ago: