View Full Version : Rename Shading Engine

03 March 2012, 04:12 PM
I found this very timesaving mel script that renames materials by their texture name. Is it possible to modify this into a new script that will rename the Shading Engine Groups by as well but without the extension? EG, Lambert2SG would become Brick, if it's Material was called Brick_.jpg

string $shaders[] = `ls -type "lambert"`;
for ($mat in $shaders)
string $files[] = `listConnections -type "file" $mat`;
if (!size($files)) continue;
string $path = `getAttr ($files[0]+".ftn")`;
string $name = `basename $path ""`;
rename $mat $name;

CGTalk Moderation
03 March 2012, 04:12 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.