PDA

View Full Version : Renaming shaders thru mel


dbsmith
10-04-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?


Eg

{

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;

}



}

}

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

-James

dbsmith
10-05-2006, 08:11 PM
They're local

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

dbsmith
10-08-2006, 08:10 PM
Of course! Thank you

CGTalk Moderation
10-08-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.