setAttribute and var.attribute


#1

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.


#2

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;
}

#3

thanks … that’s so obvious … Thanks so much!


#4

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.