PDA

View Full Version : control rigidbody visibility based on speed?


Craig Soich
01-06-2006, 04:37 PM
the current project i'm working on has a couple hundred objects, each of which is a group with two extrusions and a rigidbody. I want each rigidbody group to have a visibility based on it's speed, i.e. it disappears when it's going faster than a certain speed. So far, I've gotten an expression:

vector $mymag = <<windblown_rigidbody1.impulseX, windblown_rigidbody1.impulseY, windblown_rigidbody1.impulseZ>>;
float $magn = mag ($mymag);
Simple_Up_Unit.visibility = $magn<5;

that doesn't work, and it seems that even though I put attributes into the expression without the object name, when maya inserts it into the object, it inserts the name.

what I want to do is have one script that can be assigned to each rigidbody, rather than have hundreds of expressions. this is in case I want to change, the cutoff value, for example.

Is there an easier way to do this?

TIA, Craig

CGTalk Moderation
01-06-2006, 04:37 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.