Substance Painter
In this start to finish texturing project within Substance Painter we cover all the techniques you need to texture the robot character.
# 1 13-02-2009 , 12:12 PM
abie1's Avatar
Subscriber
Join Date: Mar 2003
Location: Miami, fl
Posts: 45

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`; 
string $currentSphere; 
for ($currentSphere in $spheres)
{

 } 
print "The primary visibility has been turned off for all of the selected geometry.";

# 2 13-02-2009 , 02:21 PM
bendingiscool's Avatar
Subscriber
Join Date: Jul 2006
Location: London
Posts: 567
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

# 3 13-02-2009 , 03:39 PM
abie1's Avatar
Subscriber
Join Date: Mar 2003
Location: Miami, fl
Posts: 45

Originally posted by bendingiscool
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

Oh! Okay so that's how you access that attribute. Needless to say, I'm teaching myself MEL and am still getting the hang of it so...I appreciate ur help. I'll test it when I get home. Thanks again.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads