View Full Version : Renaming shaders thru mel

10 October 2006, 09:58 PM
When I try to rename shaders (specifically, append a _S# to all of them), I get an error as the shaders are supposedly "locked" when I get them using "ls -mat".

Have tried lockNode, doesnt work. Any ideas?



string $objs[] = `ls -mat`;

for($i=0;$i < size($objs); $i++){

if(`gmatch $objs[$i] "*_S"` ||

`gmatch $objs[$i] "*_S[0-9]"` ||

`gmatch $objs[$i] "*_S[0-9][0-9]"` ){

print($objs[$i] + "\n");

} else {

string $newName = $objs[$i];

$newName += "_S#";

rename $objs[$i] newName;




10 October 2006, 12:09 AM
Is the shader coming in from a reference? Or is it local to the scene?


10 October 2006, 08:11 PM
They're local

10 October 2006, 06:23 AM
you need to exclude lambert1, particleCloud1, and shaderGlow1 from your selection, or conditionally not rename those read-only materials.

10 October 2006, 08:10 PM
Of course! Thank you

CGTalk Moderation
10 October 2006, 08:10 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.