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.
Swap rbd during simulation
3611 4 3-
- Orsonorix
- Member
- 25 posts
- Joined: 4月 2015
- オフライン
-
- cwhite
- スタッフ
- 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.
-
- Orsonorix
- Member
- 25 posts
- Joined: 4月 2015
- オフライン
-
- shubhamtripathicga
- Member
- 2 posts
- Joined: 4月 2022
- オンライン
-
- npetit
- スタッフ
- 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.
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.
-
- Quick Links



