setAttribute and var.attribute


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.


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;


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


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.