|
I have written to a script that would replace selected textures to lambert. Maybe it might have a use for people.
string $selection[] = `ls -selection`;
int $numElements = size($selection)
print ("Number of elements is " + $numElements + "\n")
int $i;
for ($i = 0 ; $i < size($selection) $i++)
{ print ("For loop is " + $i + "\n")
string $shaderNode = $selection[$i];
string $replaceType = "lambert";
string $replaceWith = `createNode $replaceType`;
replaceNode $shaderNode $replaceWith;
delete $shaderNode;
rename $replaceWith $shaderNode;
}
|
|
|
|
Reading you code you forget some ; and then some `` ... Should create some error in Maya… O_o…
you cantry the following one if the only one thing you want to do is to assign the lambert 1 to your objects :
string $selection[] = `ls -sl -l`;
if (`size $selection`>0)
{
for ($item in $selection)
{
sets -e -forceElement initialShadingGroup $item ;
}
} else error "No polygonal objects found";

|
|
|