RBD Bullet Solver: How to group broken pieces?

   392   2   1
User Avatar
Member
1 posts
Joined: Aug. 2024
Offline
Hello,

I have a fractured RBD Bullet sim with glue constraints and my goal is to source the pieces that are broken/not connected for pyro emission source. This [www.sidefx.com] works for deleting the pieces but I just want to group the pieces or assign an attribute. I have been trying this for ages but just keep failing.

In the constraints tab of the bullet solver I have used their the vex snippet to delete broken constraints:

if (@group_broken) removeprim(0, @primnum, 1);

Then I am attempting to set an emit attribute to the points that do not have constraints using a popwrangle inside the RBD bullet solver that uses the ConstraintGeometry object's data:

addattrib(0, "point", "emit", 0);
int pt = nametopoint(1, s@name);
if (pt == -1) {
    setpointattrib(0, "emit", @ptnum, 1, "set"); 
} else {
    setpointattrib(0, "emit", @ptnum, 0, "set"); 
}

But when I examine the output there is no emit attribute in the geometry spreadsheet.

I am sort of new to Houdini so I'm aware there's probably a better way to do this anyway so if anyone can spot what I've done wrong or could give me a simpler solution to achieve my goal it would be much appreciated.
User Avatar
Member
252 posts
Joined: Jan. 2008
Offline
merlincg46
Hello,

I have a fractured RBD Bullet sim with glue constraints and my goal is to source the pieces that are broken/not connected for pyro emission source. This [www.sidefx.com] works for deleting the pieces but I just want to group the pieces or assign an attribute. I have been trying this for ages but just keep failing.

In the constraints tab of the bullet solver I have used their the vex snippet to delete broken constraints:

if (@group_broken) removeprim(0, @primnum, 1);

Then I am attempting to set an emit attribute to the points that do not have constraints using a popwrangle inside the RBD bullet solver that uses the ConstraintGeometry object's data:

addattrib(0, "point", "emit", 0);
int pt = nametopoint(1, s@name);
if (pt == -1) {
    setpointattrib(0, "emit", @ptnum, 1, "set"); 
} else {
    setpointattrib(0, "emit", @ptnum, 0, "set"); 
}

But when I examine the output there is no emit attribute in the geometry spreadsheet.

I am sort of new to Houdini so I'm aware there's probably a better way to do this anyway so if anyone can spot what I've done wrong or could give me a simpler solution to achieve my goal it would be much appreciated.

This is often done as a post step to the simulation.
The newest buildt-in node is the debris source SOP. I think the RBD connected faces SOP got a example file on how to set this up with breaking constraints if you need that.
Edited by mawi - Dec. 18, 2024 09:29:42
User Avatar
Staff
417 posts
Joined: Feb. 2008
Offline
Here's a hip file with a few different ways of achieving the effect.

In order to get the "emit" attribute from the sim onto your geometry, you'll want to add it to the RBD Bullet Solver SOP's > Output > Transfer Attributes list of attributes.

Attachments:
EmitOnFracture.hip (1.1 MB)

  • Quick Links