From BlenderWiki
Linking Objects to Bones
Mode: Object and Pose modes
Panel: Constraints (Object context and sub-context, F7)
Hotkey: CtrlP
If you link whole objects to bones, then, when you transform the bones in Pose mode, their “children” objects are also transformed, exactly as with a standard parent/children relationship… The “children” are never deformed when using this method, this is why it is often used with mechanical or insectoid characters – i.e. things that are made of rigid pieces articulated at localized joints.
You have two ways to create these relationships between bones and whole objects, the old “real” parenting process (activated with CtrlP in the 3D views), and the new, more powerful and flexible constraints system.
Old Parenting Method
Mode: Pose mode
Hotkey: CtrlP
You must be in Pose mode to use this method. To parent an object to a bone:
- Select the child object.
- Select the parent bone.
- Hit CtrlP, and chose Make Parent To » Bone in the pop-up menu that appears.
The Armature option of the Make Parent To menu concerns the “shape” skinning described in the next page, and the Object option will create a standard object-to-object relationship.
Now, when you transform (translate/rotate/scale) the parent bone in Pose mode, the child object is transformed accordingly. Note that a parent relationship to a bone implies a parent relationship to the whole armature object – i.e. if you transform the armature in Object mode, its bones’ children will follow it…
With this method, you can only have one parent per object, being either an object or a bone. This means that if you hit again CtrlP for an already parented object, you will re-parent it. The relationship is materialized in the 3D views by a black dashed line between the object center and its parent bone’s tip, which means that the object is parented to the bone’s tip.
The AltP shortcut displays a menu with options to “clear parent” relationship for the selected children:
- Clear Parent will completely delete the parent relationship, reseting the object’s transform properties to their original values.
- Clear and Keep Transformation (Clear Track) will delete the parent relationship, but the child will stay in its current state (i.e. keep the transformations due to the parent relationship).
- Clear Parent Inverse will not delete the relationship… It rather clears the child’s offset (i.e. the child will be no more in its original position/rotation/scale when the bone is in its original state).
Example
Let’s build a simple mechanic arm. First, you must design and create its armature (see the armature editing pages). Then, model the objects that will materialize each single part of the mechanism – here, we use a same single simple shape for all our pieces, a mesh made from a boolean union of a cylinder and an UV sphere, but you could use any type of object you like…
As the spheres will be the “articulations” of our mecha arm, and the CtrlP bone parenting uses the bones’ tips as “targets”, all our arm pieces are centered at the center of their sphere (we will see why later).
Before parenting, make sure that you have cleared your objects’ rotation and scale (AltR/AltS) – we will clear their location later, to avoid having all objects at the same zero-point…
So we should have something like (Mecha arm example: the pieces and the armature).
| Mecha arm example: parenting an object to a bone with the old method. | |
Now, select the armature and switch to Pose mode (Ctrl⇆ Tab). Select the first piece of the arm (“arm”), and then the relevant bone of the armature (“arm” too…), and do CtrlP » Bone. Note the small black dashed line that appears between the object’s center and the bone’s tip. Repeat this for all other pieces/bones couples (Mecha arm example: parenting an object to a bone with the old method).
The current parenting relationship keeps the offset that existed between the bone’s and the object’s transform properties. This is a desired behavior if you have placed/rotated/scaled your object exactly as it should be on the bone before parenting it to this bone – but this is often hard to succeed in this.
Hence, it’s a better idea to clear this parenting offset: select the child object, and make AltP » Clear Parent Inverse, and clear its location (AltG) – now, the transform properties of the object should all be at zero (look at the Transform Properties panel, N), so its center will be at its parent bone’s tip, its Y axis aligned with the bone’s Y axis, etc. (Mecha arm example: clearing child offset, and its location). Our pieces are well placed and rotated!
| Mecha arm example: clearing child offset, and its location. | ||
Now, we can transform the bones in Pose mode, the mecha pieces will move accordingly (Mecha arm example: the result)!
| Mecha arm example: the result. | ||
New Constraints Method
Mode: Object or Pose modes
Panel: Constraints (Object context and sub-context, F7)
The new method is much more flexible and powerful. Basically, it consists in defining one or more constraints on the object you want to control with the armature’s bones. All constraints requiring another target object can, when this target is an armature, use one of its bone as real target.
To get the same behavior as with the old “standard bone parenting” method, just create a single default Child Of constraint on the object, with the chosen armature and bone as target, and click on Set Offset. The only difference is that the constraint’s target is the bone’s root, when with standard bone parenting, the “target” is the bone’s tip… To get the same effect as the AltP » Clear Parent Inverse command, click on the Clear Offset button (or don’t click on Set Offset at all…).
But you are not limited to the Child Of constraint – you can rather track your object to a bone, or copy its location/rotation/scale, etc.
By default, the constraints use the bones’ roots as target, but some of them, like e.g. the Copy Location or Track To ones, have an additional Head/Tail numeric field appearing when using a bone as target, that allows you to select which part of the bone to use as target, from 0.0 for the root, to 1.0 for the tip – remember that in Blender 2.49, bones’ roots are called “heads”, and bones’ tips, “tails”…
A dashed dark blue line between the object and its target materializes in the 3D views each unreduced constraint (i.e. constraints which sub-panel is nor reduced in the Constraints panel).
And last but not least, a single object can have several constraints, organized in a stack – so you can e.g. “parent” one object to several bones! More over, (nearly) all constraints have a Influence setting, that control… their influence (i.e. how much they affect their object’s transformations) – and which can be animated!
Example
| Parenting an object to a bone using a Child Of constraint. |
Let’s reuse the same mechanical arm example.
First, you must change the center of the objects (the pieces of the arm), as the Child Of constraints uses the bone’s root as target, not its tip.
Then select a piece, add it a Child Of constraint, enter in its OB field the armature name, and in the BO field that appears, the parent bone name. The “constraint” relationship is now materialized in the 3D views by a dashed blue line between the object’s center and the bone’s root. All you have to do now is to clear the location of the child – with this constraint, the child offset is cleared by default. Repeat the process for all the objects, and you get a mecha arm behaving exactly as the one we get in the old standard parenting example!



