Constraint Networks - aargh

   5374   4   1
User Avatar
Member
104 posts
Joined: Nov. 2007
Offline
Hello,

I'm having difficulties with a constraint network I am trying to build.

I have a grid of packed primitive boxes that I want to connect with spring constraints between each box centre point.

I have tried to set this up but am failing to properly understand what is going on. I created some geometry for the constraints and added attributes to it. I'm not sure how to tell the constraint network how to connect what part of the constraint geometry to which packed primitive so it's not working. The constraint is showing me an error but as soon as I middle mouse click it, it goes away which is most helpful!

I'd really appreciate some help as I've found the docs far from clear and the examples aren't really helping me here either.

Attachments:
houdinifx_2017-06-12_11-30-01.png (430.4 KB)
houdinifx_2017-06-12_11-30-15.png (517.1 KB)
houdinifx_2017-06-12_11-30-35.png (499.1 KB)
constraint_pain.hip (150.6 KB)

User Avatar
Staff
727 posts
Joined: Oct. 2012
Offline
The anchor points on the constraint network are attached to objects based on their ‘name’ point attribute, which can specify either the name of a DOP object, the name of a packed primitive (using its ‘name’ point attribute), or a combination of the two ('dop_object_name/packed_prim_name') to avoid ambiguous references. The constraint network help card [www.sidefx.com] has some more details on this.

Your setup was very close to working - I added one node to name the pieces, and then switched the constraint setup to use those points as the input so that the name attribute was carried over to the constraint network's anchor points.

Attachments:
constraint_pain_v2.hip (159.5 KB)

User Avatar
Member
104 posts
Joined: Nov. 2007
Offline
Awesome!

In one of my previous setups I had added the name attribute but not to both the pieces and the constraint mesh. This makes sense a bit more now. Thank you so much.
User Avatar
Member
104 posts
Joined: Nov. 2007
Offline
So I've taken this a bit further and come across another difficulty.

I've got a secondary box that breaks the constraints as it passes through them using a sop solver plugged in the constraint network. That's all working fine. The problem I'm having is that I want to identify which pieces in my RBD packed object have been disconnected and then apply a force to those pieces.

I've tried to do this by keeping points in my constraint breaking Sop Solver and setting a disconnected attribute on them. I then try to read this value back in in a second Sop Solver to apply forces to only the disconnected pieces. I think this should work but it doesn't so I'm obliviously missing something.

Attachments:
constraint_pain_v3.hip (252.3 KB)

User Avatar
Staff
727 posts
Joined: Oct. 2012
Offline
The issue is the expression for the Object Merge SOP inside the apply_force_to_disconnected SOP solver. Using
stamps("..", "DATAPATH", ...)
isn't correct since you're in a SOP solver running over DOP objects, and so the object merge gives you the current DOP object's geometry instead when the sop solver cooks. In this case, you want to read from a specific constraint network's geometry, and so you can just use the last section of the stamps() expression (see attached file)

Attachments:
constraint_pain_v3_fix.hip (251.0 KB)

  • Quick Links