Breaking glue constraints RBD solver

   2627   8   1
User Avatar
Member
336 posts
Joined: 12月 2014
Offline
I'd like to be able to break glue constraints on the second impact in my RBD sim, imagine fractured geo bouncing off a roof but I need them to break when they hit the ground instead. It would seem that setting From Frame in the Break Thresholds until right before the impact with the ground would do it, but instead my constraints are breaking AT that frame. What am I missing? Thanks!
User Avatar
Member
166 posts
Joined: 3月 2014
Offline
There's probably a more elegant solution, but you could set up a next_constraint_name attribute. For example, your default glue might be @constraint_name = "Glue", and your @next_constraint_name = "Glue2"

When Glue breaks, it will turn into Glue2. You'll need to make sure that Glue2 is also defined as a glue constraint network. And then Glue2 is allowed to break normally.
User Avatar
Member
336 posts
Joined: 12月 2014
Offline
I'll give that a go, many thanks!
User Avatar
スタッフ
356 posts
Joined: 2月 2008
Offline
The "From Frame" option in the constraint breaking thresholds tab of the RBD Bullet Solver SOP limits the evaluation of the thresholds to only be performed from that frame onwards. This means if any of the conditions are met at that particular frame for all the constraints, they will all be removed at that frame. Without seeing your hipfile, it's hard to tell why exactly they are all disappearing at that frame.

This however does not prevent Glue constraints from breaking beforehand - Glue constraints are unique in that they are the only constraints that have their own internal breaking mechanism. The RBD Bullet Solver introduced the constraint breaking thresholds as an additional constraint solver to allow all the other constraints to break too. Typically Glue constraints aren't evaluated by the constraint breaking mechanism (you can see the "Glue" constraint name missing from the default constraint names) since many of the thresholds simply don't apply to them.

One way to achieve what you're after is to set the glue constraint strength to -1 (unbreakable) until the frame at which you want to allow them to break under whatever condition you see fit.
In 19.5 we made updating the constraint attributes from SOPs a lot simpler. If you animate the strength attrib on the constraint prims, on the RBD Bullet Solver SOP, under Constraints > Override Attributes, enable Attributes and set it to strength.

Here's a hipfile as an example.

There are many other ways to do this however.
You could accumulate impact data on the RBD pieces and break the constraints manually after a certain number of impacts on the constraints anchored RBD pieces.
You can get info from the impact points and use it to determine which object the RBD pieces have collided with and only break the constraints if their anchored RBD pieces collide with a specific object.
You could accumulate the impact on the constraint prims and break them once they've reached a certain threshold, or do the same with a force (that's a nice way of having wind slowly break constraints to release fractured pieces over time)
...

Hope this helps and gives you some ideas on how to solve your issue!

Attachments:
GlueConstraintBreakFromFrame.hip (970.8 KB)

User Avatar
Member
336 posts
Joined: 12月 2014
Offline
Super helpful info, thank you so much. Although I understand this is theory, I haven't gotten it to work. The hip file you posted doesn't break on the second impact when I run it, I'm on H19.5.303 . Here's my test setup

Attachments:
RBD_glue_test.hip (1.2 MB)

User Avatar
Member
336 posts
Joined: 12月 2014
Offline
I love the idea of accumulating impact data, but I haven't found anything online or in the docs related to that using the new sop solver workflow. Any links or examples out there are greatly appreciated
User Avatar
Member
242 posts
Joined: 1月 2008
Offline
This used to be a thing in the early implementations of bullet.

Seams like the Impacts only record objid and primnum for colliding object.
Had to use the sim geo to translate it into @name before passing it on to the constraints data and do the counting/deleting.

Here Im recording all collision, but you should be able to use objid to only count collisions with ex the groundplane.


*Oh, I have not seen this sop solver constraintsGeometry node. However it seams to have the same data so should be easy reconnected.
Edited by mawi - 2023年4月14日 20:00:28

Attachments:
rbd_countHits.hipnc (703.5 KB)

User Avatar
Member
336 posts
Joined: 12月 2014
Offline
That works brilliantly, thanks!
User Avatar
スタッフ
356 posts
Joined: 2月 2008
Offline
AndyW
The hip file you posted doesn't break on the second impact when I run it, I'm on H19.5.303 . Here's my test setup
What platform are you on? The hipfile I posted should definitely break on the second impact. Here are frames 30 and 50 of the sim.

In your setup, you're setting the strength to 0 on frame 25 which would be almost the same as simply deleting all the constraints at frame 25.

Here's a hipfile with a few options that show how you can control the breaking explicitly.

Attachments:
Frame30.jpg (108.6 KB)
Frame50.jpg (100.7 KB)
RBD_glue_test.hip (1.3 MB)

  • Quick Links