Accessing a nodes shapeNode via MEL
Let's say that I have a ton of geometry in a scene, hypothetically speaking, and I want to turn off the primaryVisibility of all of the said geometry, but I don't want to have to select each object one by one and then tick the primaryVisibility option in the objects' renderStats. I thought that I could write a "for-in" loop that would work but I don't know how to access a given object's primaryVisiblity attribute. Is there a way to do this? Or am I going about this the wrong way altogether? Any help would be greatly appreciated.
Here's the code: Code:
string $spheres[] = `ls -sl`; |
This should work for you...
string $sel[] = `ls -sl`; for($i=0;$i<size($sel);$i++){ setAttr ($sel[$i] + ".primaryVisibility") 0; } Just select all your objects and run the code. Chris |
Quote:
|
All times are GMT. The time now is 08:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018