PDA

View Full Version : How do I turn off "casts shadows" for 3,000 objects?


lackthereof
02-01-2007, 11:56 PM
Hi. I'm having trouble automating this action. I need to turn off the "casts shadows" box for the render stats in the shape nodes of the 3,000+ objects that shouldn't cast shadows. I tried selecting them all (the base nodes) and running this:

setAttr ".castsShadows" 0;

but it gives me this: "// Error: Not enough data was provided. The last 2844 items will be skipped. //" and does not turn off shadows for any but the last object selected. I picked the shape nodes only from the hypergraph (since that's where the render stats are) and ran this script but same error.

Anyone know this probably simple answer? Help is much appreciated!

analogue
02-02-2007, 04:07 PM
You could throw the command you are using in a loop like this:

string $sel[] = `ls -sl`; // get selection
for($s in $sel) { // loop
setAttr ($s + ".castsShadows") 0; // your command
}

-Ben

Adam
02-02-2007, 10:38 PM
call me crazy but why not just use the attribute spread sheet. all you have to do is find the attribute select the column and change the value and they will all change at once

analogue
02-03-2007, 08:54 PM
Good point... but that would be the easy way. :)

-Ben

CGTalk Moderation
02-03-2007, 08:54 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.