What is recommended way to work with DOP constraints?

   1772   4   2
User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
Hello,

There are two types of constraints in DOP:
- regular constraints (like RBD Angular Constraint, RBD Hinge Constraint)
- constraint relationships (like Hard Constraint Relationship, Spring Constraint Relationship)

As far as I understood, they are not compatible. I am a little bit confused which constraints to use. Which constraint type is better? Is one of these constraint types an old approach and it is recommended to use another one?

I used so far constraint relationships (just because they were used in online courses I watched). But there are some missing features which I need (like constraint only rotation and only by one axis; or allow object to move only in YZ playne and don't allow to move along X axis).
Maybe “constraint relationship” is an old approach and I should use regular constraints?

Thanks.
User Avatar
Member
20 posts
Joined: June 2012
Offline
Constraint relationships are great and can do all the things you want. I think both constraint types are valid. The main reason to use constraint relationships over standard constraints is when you want to procedurally generate a lot of them as in destruction Sims or mograph style fx.

To make constraint relationships do the things you need, you add point and prim attributes to the constraints in sops. This page will let you see what Attrib does what.
https://www.sidefx.com/docs/houdini/nodes/dop/constraintnetwork.html [www.sidefx.com]

For instance, to get your constraint to work in rotation mode only, write this in a prim wrangle.
s@constraint_type = “rotation”;
There's attributes to control the constrained axis too. Check out the condir and condof attributes on that page.

I can give you specific example files if you need, once I'm near Houdini again.
https://www.richlord.com/ [www.richlord.com]
User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
Thanks a lot, this info helped a lot.

I would appreciate any examples you can provide.

I also made a simple scene using hard constraint which allows an object to move only in YZ plane.
It even works. I give an object initial velocity in direction (1,1,1), and the object stays in plane YZ as expected.
But this constraint goes crazy after colliding with another object on the scene.
I attached a demo video and source hip-file.
I would appreciate if you could take a look and give a hint what I did wrong.

Thanks
Edited by RadikSalakhov - Aug. 22, 2019 13:37:57

Attachments:
AxisConstraint.zip (162.3 KB)
AxisConstraint.mp4 (1019.2 KB)

User Avatar
Member
20 posts
Joined: June 2012
Offline
I'm not sure whats going on with that constraint. You can avoid a constraint completley in this situation though by forcing the x position to 0 each frame in a geo wrangle. I bet that isn't ideal, but it does somewhat work. Heres a scene where I took out the anchor object and constraints, and replaced them with a geo wrangle forcing the object to stay on the YZ plane.

Attachments:
AxisConstraints.hiplc (1.1 MB)

https://www.richlord.com/ [www.richlord.com]
User Avatar
Member
27 posts
Joined: Aug. 2018
Offline
Thanks a lot. It solved the problem.
  • Quick Links