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;
}
}
}
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;
}
}
}
