From BlenderWiki

Jump to: navigation, search

Child Of Constraint

Mode: Object and Pose modes

Panel: Constraints (Object context and sub-context, F7, or Editing context, F9, when in Pose mode)

Description

Child Of is the constraint version of the standard parent/children relationship between objects (the one established through the CtrlP shortcut, in the 3D views…).

Parenting with a constraint has several advantages and enhancements, compared to the traditional method:

  • You can have several different parents for a same object (weighting their respective influence with the… Influence slider!).
  • As with any constraint, you can key (i.e. animate) its Influence setting, and hence e.g. have your owner fully parented to a first object at start, and to another object at end of the animation…
Exclamation mark.png
Don’t confuse this “basic” object parenting, with the one that defines the chains of bones inside of an armature. You do can use this constraint to parent an object to a bone (the so-called “object skinning”), or even bones to bones. But don’t try to use it to define chains of bones!

Options

The Child of constraint panel.
Parent
This constraint uses one target, and is not functional (red state) when it has none.
Loc X, Loc Y, Loc Z
Each of these buttons will make the parent affect the location along the corresponding axis.
Rot X, Rot Y, Rot Z
Each of these buttons will make the parent affect the rotation around the corresponding axis.
Scale X, Scale Y, Scale Z
Each of these buttons will make the parent affect the scale along the corresponding axis.
Set Offset
By default, when you parent your owner to your target, the target becomes the origin of the owner’s space. This means that the location, rotation and scale of the owner are offset by the same properties of the target. In other words, the owner is transformed when you parent it to your target.
This might not be desired! So, if you want to restore your owner in its before-parenting state, click on the Set Offset button.
Note: I don’t fully understand how this works. When you press it twice it nearly restores the owner in its original location/rotation/scale… but not exactly! And sometimes, when the target has been transformed, not at all. So you should only use it once, and before applying any transformation to your target, else you’ll get some quite unpredictable results (see example below)!
Clear Offset
This button reverses (cancels) the effects of the above one, restoring the owner/child to its default state regarding its target/parent…


Tips

When creating a new parent relationship using this constraint, it is usually necessary to click on the Set Offset button after assigning the parent. As said above, this cancels out any unwanted transform from the parent, so that the owner returns to the location/rotation/scale it was in before the constraint was applied. Note that you should apply Set Offset with all other constraints disabled (their Influence set to 0.0) for a particular Child Of constraint, and before transforming the target/parent (see example below).

About the toggle buttons that control which target’s (i.e. parent’s) individual transform properties affect the owner, it is usually best to leave them all enabled, or to disable the whole three ones for a given transform.

If you use this constraint with all channels on, it will use a straight matrix multiplication for the parent relationship, not decomposing the parent matrix into loc/rot/size. This ensures any transformation correctly gets applied, also for combinations of rotated and non-uniform scaled parents.

Example


ManConstraintsChildOfObjectsEx01NoCst.png

1. No constraint
Note the position of Owner empty – 1.0 BU along X and Y axes.

ManConstraintsChildOfObjectsEx02CstAdded.png

2. Child Of just added
Here you can see that Owner empty is now 1.0 BU away from Target_1 empty along X and Y axes.

ManConstraintsChildOfObjectsEx03CstSetOffset.png

3. Offset set
Set Offset has been clicked, and Owner is back to its original position.

ManConstraintsChildOfObjectsEx04CstTargetTransformed.png

4. Target/parent transformed
Target_1 has been translated in the XY plane, rotated around the Z axis, and scaled along its local X axis.

ManConstraintsChildOfObjectsEx05CstClearOffset.png

5. Offset cleared
Clear Offset has been clicked – Owner is fully again controlled by Target_1.

ManConstraintsChildOfObjectsEx06CstSetOffset.png

6. Offset set again
Set Offset has been clicked again. As you can see, it does not gives the same result as in (Target/parent transformed). As said above, use Set Offset only once, before transforming your target/parent.