Swap rbd during simulation

   3839   4   3
User Avatar
Member
25 posts
Joined: April 2015
Offline
Hi,
Is it possible to swap rbd simulated object to different one while simulating? For example bunch of simulated boxes changes at random to spheres which inherit position, rotation and continue to simulate.
User Avatar
Staff
817 posts
Joined: Oct. 2012
Offline
I think you can do this by first replacing the packed prims' contents with the new shape(e.g. with the Pack Inject SOP, or by copying the point attribs over to new packed prims) and then resetting the 'id' point attrib to -1 which will cause the solver to re-import the shape. You might also set 'computecom' and/or 'computemass' to 1 if you want those properties to be recomputed for the new geometry.
User Avatar
Member
25 posts
Joined: April 2015
Offline
Hi,
thanks, it worked! I'm attaching hip if anyone interested.
Cheers

Attachments:
rbd_swap_Test_01.hiplc (579.5 KB)

User Avatar
Member
2 posts
Joined: April 2022
Offline
I tried this setup with the rbdsolver. It's not working. It worked if I create the rbd dop network from scratch like but not with the new rbdsolver. I am attaching my hip file here
Edited by shubhamtripathicga - July 17, 2026 13:11:49

Attachments:
rbd_swap.hiplc (592.7 KB)

User Avatar
Staff
464 posts
Joined: Feb. 2008
Offline
It kind of is working - internally everything is doing what you want, which is why the spheres are floating above one another over the lower bowl, and if you dive inside the rbd bullet solver, you can see the spheres changing into cubes.
The problem is the rbd bullet solver by default outputs what is plugged into it, transformed by the resulting simulation points. There are a couple of ways of achieving this, first by simply creating an object_merge pointing directly at the dopnet node inside the rbd bullet solver, or you can replicate the swapping outside the rbd bullet solver by tagging the rbd points that are being swapped (you add them to a "swap" prim group, you need to create a point attribute you can add to the attribs to output since we only use the sim points internally - no prims).

Here's an updated hip file with both options.

Attachments:
rbd_swap_fixed.hiplc (660.6 KB)

  • Quick Links