How to measure the no of impacts in RBD sim?

   6121   5   3
User Avatar
Member
112 posts
Joined: Feb. 2010
Offline
Hello,
I have a sphere (rbd) which collides with boxes (rbd point objects). If the sphere collides with any of the box twice then only I want the gravity force to act on that box.
I tried grouping them using dopnumrecords($DOPNET,$OBJID,“Impact”,“Impact”)>=2, it didnt work
Is it possible using dopnumrecords expression?
Please help.

Thanks
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
The help for dopnumrecords() requires a string name for the rbd object. $OBJ only returns the id of the object, not the name. Need to use $OBJNAME.

Have a look at the example file for a trivial example of how to do this with the Modify Data DOP. I use two in this case. First is to initialize the gravity to 0 for the objects in a DOP group I created. Second is to add the gravity based on an imact using dopnumrecords().

Attachments:
rbd_toggle_gravity_on_impact.hip (537.1 KB)

There's at least one school like the old school!
User Avatar
Member
112 posts
Joined: Feb. 2010
Offline
Hello Sir. I could not open your file. Houdini crashes each time I try to open that file. It gives me en error message - ‘segmentation error’
I am using Houdini 11.0.446.9, 32bit windows xp
I used the following expression
dopnumrecords($DOPNET,$OBJNAME,“Impacts”,“Impacts”)>=2

now the problem that I am facing is , Houdini counts the impact even when the boxes collide with each other. How can I set the condition so that Houdini counts the impact on a box only when sphere collides with it and not when other boxes collide . (If sphere collides with a specific box then Houdini should count it as 1st impact and when total no of such impacts by sphere on that same box becomes greater then or equal to 2 then gravity should act on that box. )
Thanks
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
That old a build will definitely crash with this file. You need to download a more recent build. This file was built in Houdini version 11.0.498.

I too get a crash when trying to open this file in an older build. Dunno why but it is always good to upgrade to latest if you aren't locked in to a specific build in production.


As for the condition you specified, you could wrap up the function in an ifs() expression and test to see if $OBJNAME == <my_DOP_object_name> and then do the work.
There's at least one school like the old school!
User Avatar
Member
696 posts
Joined: March 2009
Offline
Hi there,
In my case I'm testing for collisions with objects that are floating, so once they bounce off from each other the impacts are zeroed again… how can I make the impact be persistent?!

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
696 posts
Joined: March 2009
Offline
rafaels
Hi there,
In my case I'm testing for collisions with objects that are floating, so once they bounce off from each other the impacts are zeroed again… how can I make the impact be persistent?!

Cheers

Found a way with Modify Data DOP… If you're interested just send me a PM.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
  • Quick Links