Nov
03
Simple MEL help.
Posted in: MayaI’m trying to make a simple script that disables Primary Visibility on the selected objects.
It works fine when I’m only selecting one object but when I select multiple I get this warnig: Cannot convert data of type int[] to type int.
It works fine when I’m only selecting one object but when I select multiple I get this warnig: Cannot convert data of type int[] to type int.
I’m new to MEL so this is probably a really simple problem… I hope.
This is how it looks.
_______________________________________________
string $renderArray[] = `ls -sl`;
string $firstSelectedObject = $renderArray[0];
for ($objects in $renderArray) {
setAttr ($objects + ".primaryVisibility") 0;
}
int $prVis = `getAttr $firstSelectedObject.primaryVisibility`;
if ( $prVis == 0 ) {
print (" Primary Visibility is OFF…");
} else {
print (" Primary Visibility is ON!");
}
Post a Comment