Packed RBD Collision Attribute?

   2043   4   3
User Avatar
Member
71 posts
Joined: Nov. 2017
Offline
Is there a way to add an attribute to packed RBD objects when they collide with other objects? I want to use the attribute to change the packed RBD—for instance to color them or make them inactive—on collision. I've gathered that I likely need to use the SOP Solver node in the dopnet, but the "impacts" and "feedback" nodes within don't seem to have what I'm looking for. Or, if they do, I'm not sure how I'm meant to extract it and apply it to the dop_geometry stream. I thought this would be a very basic task, but I'm at a loss.

I'm attaching an example scene file. In this example, I'd like the cubes to turn red and become inactive when they collide with the wedge geo. I'd like them to turn green when they collide with the floor. I've selected "Add Impact Data" for the objects, but I am not sure what is being added and how to access it.

I'm thankful for any pointers!
Edited by joenyc - Aug. 26, 2021 22:40:47

Attachments:
rbd_collision.hiplc (619.2 KB)

User Avatar
Staff
740 posts
Joined: Oct. 2012
Offline
I think you were pretty close - you just need to look up the primitive number in the geometry that contains the impact data, and then interpret the other attributes (like DOP object id) when you find an impact record (see attached)

Attachments:
rbd_collision.2.hiplc (622.3 KB)

User Avatar
Member
71 posts
Joined: Nov. 2017
Offline
cwhite
I think you were pretty close - you just need to look up the primitive number in the geometry that contains the impact data, and then interpret the other attributes (like DOP object id) when you find an impact record (see attached)

Wow, this is incredibly helpful, thank you. I never would have guessed any of this, so it's very useful to get a real example.

Quick question -- in your wrangle, you seemed to know that the ramp had an otherobjid of 0 and the ground had an otherobjid of 1. I've been poking around trying to figure out where you derived those ID's from. Was it just trial and error? Or is there a way I can look those up?

Thanks again!
User Avatar
Staff
740 posts
Joined: Oct. 2012
Offline
In the geometry spreadsheet you can see the unique id for each DOP object (attached screenshot), but in the SOP solver I was using https://www.sidefx.com/docs/houdini18.5/expressions/dopobjectlist.html [www.sidefx.com] to determine the ID from the object name, since the ids can vary depending on how your DOP network is wired (in this case, the expression on the ground id parameter was
atof(dopobjectlist("../..", "groundplane1", 0))
Edited by cwhite - Aug. 27, 2021 13:57:29

Attachments:
Screenshot_20210827_135329.png (53.6 KB)

User Avatar
Member
71 posts
Joined: Nov. 2017
Offline
Thanks again, this really helped me nail what I was trying to do!
  • Quick Links