Swap rbd during simulation

   3611   4   3
User Avatar
Member
25 posts
Joined: 4月 2015
オフライン
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
スタッフ
815 posts
Joined: 10月 2012
オフライン
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: 4月 2015
オフライン
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: 4月 2022
オンライン
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 - 2026年7月17日 13:11:49

Attachments:
rbd_swap.hiplc (592.7 KB)

User Avatar
スタッフ
463 posts
Joined: 2月 2008
オフライン
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