PDA

View Full Version : setAttribute and var.attribute


GrogMcGee
05-30-2009, 06:23 PM
Me again ... 'nother question:

I'm trying to write a script to select all the shapes in a scene and change the render stat attributes Double Sided and Opposite to false (0)...

This is where I got
{
select -allDagObjects;
setAttr "doubleSided" 0;
setAttr "opposite" 0;
};

other version
{
string $sel[]=`ls -geometry`;
setAttr "$sel.doubleSided" 0;
setAttr "$sel.opposite" 0;
};

both of them spit errors...

I really just don't know how to do what I'm trying to do...

I also do understand how to use something like var.attribute.

vvkonline
05-31-2009, 02:42 AM
you are very close with you script here another version.

string $sel[]=`ls -geometry`;
for($each in $sel)
{
setAttr ($each + ".doubleSided") 0;
setAttr ($each + ".opposite") 0;
}

GrogMcGee
06-01-2009, 02:24 PM
thanks ... that's so obvious ... Thanks so much!

CGTalk Moderation
06-01-2009, 02:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.