Showing posts with label blast. Show all posts
Showing posts with label blast. Show all posts

Friday, 12 April 2019

removing RBD from a sim

Sometimes you need to remove an RBD from a sim completely. Eg, you're using a block to push something and then need it to get out of the way...

Make sure you have a group for it on SOP level. It will probably be a point group, as you're most likely using packed geo.

Now use a SOP solver in your DOP network. Attach it to a multisolver, alongside your Bullet/RBD solver..
Inside the SOP solver, blast the group that you created earlier. Use a switch node or some other timing device (you could use a point wrangle with removepoint I think)  to trigger the group's deletion.
Eg. Switch node  could use $F>1000. Here it will switch from "all the geo" to "all the geo minus the group" input.

Select a random point from a group each frame

Some code snippets from Walter to use points from a group randomly, for emission (or other things)

In a Detail Attribute Wrangle-

int npts = npoints(0);
float keep = rand(@Time + 235.624) * npts;
i@keep = int(keep);

Every time step, a random point id is chosen as the "keep" point.

Then in a blast, we kill everything but the kept point

`detail(0, "keep", 0)`

Don't forget to invert the blast selection