PDA

View Full Version : proximity expression help


skunk184
08-11-2009, 12:56 PM
hi all ,
okay I have a few hundred rigid bodies and I want to set them "active" depending on how close they are to a locator.

I can do this using the mag function and an expression that has every rigidBody in the scene in the expression and I can also probably do it by looping through everything(but i am thinking that is just a bad idea).

so is there a way to do this simply ??something like being able to use a wildcard in the index of a string array(eg $rigidBody
) ...

any help would be great

thanks in advance

Craig

cbamber85
08-15-2009, 08:04 AM
No you would have to create a loop, computers are still very serial machines so even if you could use a wildcard in the index the computer would still have to loop through them one at a time.

This operation will be slow because of the mag command and the numbers of loops, the only quicker way would be to go for a spacial subdivision system (octree?), but the preprocessing might take just as long...

skunk184
08-15-2009, 05:38 PM
thanks cbamber85,

I ended up using a loop and it was nt nearly as slow as I thought it might be. I am thinking I may have been able to use color in a condition or switch node to trigger the active state(I know i can do this in houdini using a dop group that triggers the active state but havnt got time to test further in maya at the moment).

had to use nCloth instead of rigidBodies because maya's rigids are awful.

Craig

kojala
08-18-2009, 08:31 AM
could you link all rigidbodies with distanceBetween node to that locator and put conditions in between to trigger if distance gets close enough? just an idea..

CGTalk Moderation
08-18-2009, 08:31 AM
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.