Dynamically add Wire Spring Constraints based on distance

   4915   10   2
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Hello,

Could some please help me with working out how to set up a scene where by wire spring constraints are created dynamically based on a distance threshold. I have currently set up a simple scene where I have a bounding box creating a ‘spring’ group in Sops, but the group does not update in Dops. I have done a lot of searching but haven't found anything related to this, or can't work out how to re-engineer different scenes for this task?

I would really appreciate some help on this please. I tried forcing the Anchor: Object Point Group to ‘Set Always’ but with no change?

Thanks

Attachments:
add_spring_constraints_01.hip (232.0 KB)
AddSpring.png (639.8 KB)

User Avatar
Member
39 posts
Joined: 7月 2014
Offline
I've found this in the documentation:

The Glue Adjacent Pieces shelf tool creates a glue network between adjacent pieces for you automatically using a constraint network. Expert users can create the network geometry manually to achieve other effects, such as linking pieces based on some criterion other than proximity.

Expert users can modify the constraint_name (which specifies a piece of relationship data by name, such as Glue or Spring) on various lines using animation or a SOP solver, to dynamically switch between glue and spring constraints

It's a little frustrating as I'm obviously not an ‘Expert’ user ,but would really like to achieve the effect of dynamically adding wire Spring constraints based on distance. I kindly ask, could someone give me some advice or point me in the right direction? Thanks
User Avatar
Member
1746 posts
Joined: 5月 2006
Online
Good question! Something I'd been meaning to learn myself, so been plugging away at it last few nights.

With help from a few posts ( http://forums.odforce.net/topic/22032-wires-with-constraint-network/?p=131328 [forums.odforce.net] and http://crindler.com/?p=4 [crindler.com] ), I think I've got something.

Hope it helps.

I stuck some more notes here:

http://www.tokeru.com/cgwiki/index.php?title=HoudiniDops#wire_solver_and_dynamic_constraint_networks [tokeru.com]

Attachments:
wire_dynamic_constraint.gif (417.2 KB)
wire_constraint_network_v02.hipnc (451.6 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Thanks alot mestela, the wealth of information you provide is honourable!

Thanks again
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Is there a way to get the Constraint Network Guides (ie the connecting spheres and lines) back into SOPs?
User Avatar
Member
1746 posts
Joined: 5月 2006
Online
There might be a way to bring in the guide geo for the constraints directly, but I couldn't see it.

Instead, I found you can object_merge the final node inside the dopnet sop solver, but only the dynamic constraints come through properly animated, and its one frame late (easily fixed with a timeshift). Maybe that's all you need? The rest can be reconstructed easily enough.

See attached.

Attachments:
wire_constraint_network_v04.hipnc (473.7 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Ah I was bringing in the wrong node :shock: , I brought in the Merge Node inside DOP/SOPs which kept duplicating the geo. Thanks again!
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Although this seems like a viable solution, it seems really unstable sometimes it will bring in the constraints correctly, but then if you go and change a setting inside of DOPs and come back out, the Object Merge will copy & repeat each frame of the constraints. Not really an ideal way to work. Any other ideas? I'll post my solution if I find anything but currently this is the best one.
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
That is very cool indeed …………..

r
Gone fishing
User Avatar
Member
1746 posts
Joined: 5月 2006
Online
sop solvers are twitchy, they don't like being run halfway through a sim. are you sure you're playing back from frame 1 each time you change sim settings, and/or hitting the ‘reset simulation’ button on the dopnet each time?
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
39 posts
Joined: 7月 2014
Offline
Yea I've tried to rest the sim and make sure I'm playing from frame 1 but still seem to be having the issue. I'll keep having a look at it.

I've found bringing in the connect adjacent pieces to be more consistent, and seeing as they make up the springs, maybe there is a way to make the connected pieces always stay connected? Like how the springs work. Once they are made, they stay connected.
  • Quick Links