Skip to content

Constraints

Connect one rigid to another.


Usage

From the Ragdoll menu, select one of the constraint options.

constraintusage


Types

All constraint types share the same underlying Maya node, the rdConstraint, but start their life with slightly different attribute values.

Constraint Description
Point Locked translation, free rotation
Orient Locked rotation, free translation
Parent Locked translation and rotation
Hinge Locked translation and partially locked rotation
Socket Locked translation and limited rotation


Point Constraint

Locked translation, free rotation

This constraint prevents the translate values of one rigid to change, relative another rigid. The result is a freely rotating rigid, pinned at a point somewhere on the other rigid.

pintcosntraint2


Orient Constraint

Locked rotation, free translation

When you want to match the orientation between two rigids, whilst letting them translate freely.

ofrientconstraint3


Parent Constraint

Locked translation and rotation

Make one rigid appear as the child of another, by locking both rotation and translation values. Counter-intuitively, this constraint is the most expensive to compute. But, sometimes you have have no choice, such as when you want to create a more complex collision shape by parenting multiple rigids together.

parentconstraint5


Hinge Constraint

Locked translation and partially locked rotation

This constraint is very handy for knees and elbows, and anything that should only be allowed to rotate around a single axis.

hingeconstraint3


Socket Constraint

Locked translation and limited rotation

For more complex joints, such as hips and shoulders, that should be allowed to rotate around all 3 axes in a very specific way. It includes a pre-defined limit on all axes, along with a default guide to drive a rigid towards its starting orientation.

socketconstriaint2


Ignore Contact Constraint

A special constraint with both Limit and Guide turned off, leaves only its ability to tell the solver to ignore contacts between the two constrained rigid bodies.


Limit

The above types mostly vary the "limit" attribute of a constraint, but what is a "limit"? A limit prevents the motion of one rigid relative another.

Inverted Collider

You can think of a limit as a inverted collider, in that a rigid body is allowed to move only within this collider; as opposed to outside of it. Under the hood, this is very much like how it actually works!

limits


Degrees of Freedom

The axes of a limit are called "degrees of freedom" (or DOF) and comes in 6 flavours.

# Axis Description
1 Translate X Typically Locked for limbs and Limited for mechanical things
2 Translate Y
3 Translate Z
4 Rotate X Also called Twist, great for elbows and knees
5 Rotate Y Also called Swing, great for shoulders and hips
6 Rotate Z

One or more of these can be used simultaneously to express almost any relationship between two rigids.


Twist and Swing

The X and YZ axes of rotation have nicknames - "twist" and "swing". Twist is rendered like a pie whereas swing is rendered as a cone.

  • Twist is well suited for motion with only one degree of freedom, like elbows and knees
  • Swing covers the rest; like shoulders, hips and wrists


Limit States

Each axis can be in one of 3 possible states.

State Value Description
Locked < 0 A value less than 0 means "locked", it cannot change at all
Free = 0 A value of exactly 0 means "free", it is free to change
Limited > 0 A value greater than 0 means "limited", it is free to move within this range

When an axis is "limited", the value represents the amount it is limited, which is centimeters and degrees. The same as the Translate and Rotate values of a regular control, as per the Maya preferences.


Softness

When an axis is Limited it will respond to the Limit Stiffness and Limit Damping attributes. A limit can be made "soft" by reducing these values.

Soft Rotate Limit

Human "limits" are quite pliable. They flex, they give way to a strong-enough force being applied. Mechanical limits however are typically very hard, like the maximum permitted height of vehicle suspension.

softangularlimite

Soft Translate Limit

Notice how the rigid is allowed to move outside of the limit, but is being gently pulled back. The strength and elastiticy of this effect is governed by the Translate Limit Stiffness and Translate Limit Damping.


Pivots

Every constraint has 2 pivots called Parent Frame and Child Frame.

constraintframes

The most finnicky part of pivots is editing rotations. For example, to make knees and elbows, you'll want to align the Twist axis with the knee and this process has 2 steps.

  1. Rotate both Parent Frame and Child Frame align with the knee
  2. Rotate only the Parent Frame to align the current pose of the knee with how far it should bend.


Guide

Make one rigid reach a given target pose.

Drawn as a transparent red/green pie between two rigid bodies, the Guide enables one rigid to reach a translation and/or rotation relative another rigid.

constraintrendering


Guide Pie

This represents the difference between where a rigid is, and where it wants to go. It is the target angle, your animation and how far away it currently is from the simulation.


Guide Line

Translation is drawn as a dotted line between a rigid and the animation.

guideline

translationguide


Constraint Colours

When rigids have multiple constraints, it can be hard to tell them apart visually given they all share the same red/green colours. And if you're amongst the colour-blind things are even more challenging.

Give some extra flare to your constraints, by editing the Twist and Swing colors.

constraintcolors3 customconstraintcolor2


Constraint Outliner Style

Choose how constraints appear in the outliner.

Style Result
nConstraint At the root of the outliner, as its own transform
Maya Constraint As a child transform
Ragdoll As a shape

The rRigid node appears as a shape of any node you apply physics to, and normally constraints appear alongside them. But normal Maya constraints do not, and neither does the constraints you get with nCloth and nHair. So which do you prefer?

Ragdoll Style

As a shape, alongside the rRigid node.

outlinerstyle1

Maya Constraint Style

As a child, similar to native Maya constraints.

outlinerstyle2

nConstraint Style

As a new transform at the root of the scene, similar to nCloth and nHair constraints. Group them, hide them; if you can imagine it, you can achieve it!

outlinerstyle3

Subjective

Whichever you prefer, it has no effect on the simulation and is strictly related to the Outliner only. They can also be re-parented after being created, it really doesn't matter where they are. So organise away!


Last update: 2021-08-27