From BlenderWiki
Inverse Kinematics
In a previous page, we saw how to pose an armature, bone after bone – using the so called “forward kinematics” process. But Blender knows another posing method, called “inverse kinematics”.
Basically, the IK idea is to rotate (and optionally scale) automatically the bones of a chain, to follow as tightly as possible a target object’s position (and optionally rotation). In other words, it’s a way to pose an armature using just a few control elements (a bit like using hooks to deform meshes…).
There are two main types of IK:
- Targetless IK
- As the name implies, this is an IK-constraint which has no target. This is applied to a child bone, and influences its parents' rotations. Bear in mind that to retain a desired pose, you must keyframe every rotation value, of every bone. This kind of IK will also ignore constraints on the bone itself, only use it for constraint-less free chains.
- Targeted IK
- This is the original and standard type of IK, where an object or bone (uninvolved in the IK chain) is used as target. Here, you never have to key the IK chain bones, as they are permanently adjusted to follow the target. However, you must key the IK target's location.
Targetless IK
Mode: Pose mode
Panel: Armature (Editing context, F9)
This is the “simplest” IK tool. You enable it through the Auto IK button of the Armature panel (Editing context, F9).
This is a targetless-only IK, without any of the control options you have with the constraint described below. In fact, it just dynamically creates a “virtual” targetless IK constraint each time you start to grab (G) a bone, using the whole length of the parent part of the chain this bone belongs to.
This implies that hitting G with a selected connected bone switches no more to the rotation tool, when the Auto IK option is enabled… !Be warned that automatic IK also means that you can not set up constraints for it.
If you have several selected bones, a temporary IK constraint is created for all of the most-parent bones of each involved chain.
|
| ||||
IK Solver Constraint
Mode: Pose mode
Panel: Constraints (Editing context, F9, or Object context and sub-context, F7)
Hotkey: ⇧ ShiftI, CtrlAltI
Menu: Pose » Inverse Kinematics » …
In Blender, using inverse kinematics mainly goes through the IK Solver constraint, which is only available for bones, in Pose mode.
You can of course add an IK constraint using the standard way (i.e. via the Add Constraint button of the Constraints panel, see the constraints chapter), but you also have a specific shortcut in the 3D view. When you hit ⇧ ShiftI (or Pose » Inverse Kinematics » Add IK to Bone…), an Add IK Constraint menu pops-up, with a few options to add an IK constraint to the active bone:
- If you only have one selected bone:
- To New Empty Object – This will create a new Empty, located at the tip of the active bone, and add to this bone an IK constraint using the empty as target.
- Without Target – This will add to the active bone a targetless IK constraint.
- If you have another bone or object selected:
- To Active Bone – This will add to the active bone an IK constraint, using the secondly selected bone as target.
- To Active Object – This will add to the active bone an IK constraint, using the secondly selected object as target.
Error message
If you select two bones in the same chain, Blender will refuse to create the IK constraint, with the error message “
IK root cannot be linked to IK tip”… However, in an existing constraint, you can set a bone of the same chain as target, don’t know why… |
Note that you can only add one IK constraint this way, else Blender complains with the error message “Pose Channel already has IK”. Anyway, it seems only the first IK constraint in a bone’s stack is effective…
If you want to remove the IK constraint of a bone, you can select it, hit CtrlAltI (or Pose » Inverse Kinematics » Clear IK…), and confirm the Remove IK constraint(s) menu that pops-up. Note that this will delete all IK constraints a bone may have.
We saw in the visualization page that an IK constrained bone turns either Orange (for a targetless constraint) or Yellow (for a targeted constraint). In addition, a dashed line of the same color is drawn, between the tip of the constrained bone, and the root of the root bone of the IK chain – all bones between those two included are affected by the IK constraint.
Targetless
The IK Solver constraint is an exception, inasmuch it is designed to work even without any target specified (i.e. when it’s in “red state”).
In this case, it behaves exactly as the Auto IK editing option – but with all the advanced settings of the constraint (see below).
Just remember that with a targetless IK constraint, the bones of the IK chain are not permanently controlled by the constraint – you have to key them if you want to animate them…
Targeted
This is the classical version of IK. When a target is specified (as any constraint, either an object – typically an empty – or a bone), the IK constraint will transform the bones of its chain so that, as much as possible, the tip of its owner bone follows, tracks the center of the target.
When targeted, the constraint permanently affects its chain, so this is an easy way to pose and animate an armature, just by controlling a few external objects. You have no more to pose nor key the bones belonging to the IK chain (even though it is still possible, for very specific needs…).
Tip
In general, you’ll parent the targets of the IK constraints to their armature, so you can move the armature without deforming its pose…
|
Options
The IK constraint has quite a few settings to control its behavior.
- Target
- The object or bone to use as IK target (if void, the targetless IK behavior takes place). As with any other constraint, if you specifies the name of an armature in the first OB field, you can specify the name of one of its bones in the BO field that appears below, to use this bone as target. Similarly, if you specifies the name of a mesh or lattice object in the OB field, you can specify the name of one of its vertex groups in the VG field that appears below, to use this vertex group’s center as target.
- Pole Target
- This second target allows you to define the “pole” of the IK chain, which is the direction in which a knee, or middle joint in the chain, should point track to. It behaves as any constraint target option (i.e. you can use an object, bone or vertex group as pole target).
- This is most useful in knees and elbows, but would also work to allow you to control which way a tail “crinks” when compressing. Parent an empty to the armature, and then use it as a pole target. Animate the location of that empty, which would guide the bone chain’s orientation as it bends. For knees, float the empty out in front of the leg (study mocap to see how the leg/hip rotation results in knee orientation during the walk cycle). For elbows, float the empty behind the arm, and study mocap to see how the elbows fly out or stay tucked in for different movements.
Pole target example.
- Use Tail
- When enabled, this button indicates to Blender to use the tip of the constrained bone as the last element of the IK chain (remember that currently, in Blender UI bones’ roots are called “heads”, and bones’ tip, “tails”…). This is now the default behavior (and the most intuitive one), but in older versions of Blender, it used to be the owner’s root, and not its tip, that was the last IK element – which implied that the constrained bone didn’t participate to the IK solution…
- ChainLen
- This setting allows you to control the length of the IK chain, in number of bones. The default 0 value means “use as much bones as possible”. A value of 1 limits the chain only to its owner bone (having more or less the same effect as Track To constraint…), etc.
ChainLen example.
- PosW
- The “position weight” setting is only relevant in case of tree IK (see below). It specifies the influence, the importance this IK constraint should have in the global tree IK solution.
- Rot
- When enabled, this button forces the last element of the IK chain (i.e. by default, the constrained bone) to follow the rotation of its target (both in global space).
- W
- The “rotation weight” setting is only relevant in case of tree IK (see below), when Rot is enabled. It specifies the influence, the importance this IK constraint rotation should have in the global tree IK solution.
Follow target rotation example.
- Stretch
- When enabled, this button allows the IK constraint to stretch (i.e. scale) the bones in its IK chain, to adapt there length to the target’s position.
- Note that:
- Enabling this option won’t be enough, you’ll also have to adjust the bones’ Stretch property to non-null values (see below).
- With tree IK, its behavior is quite strange – it seems that it only works (more or less…) when it is enabled in only one IK constraint.
- The bones are stretched to avoid as much as possible their rotation (i.e. to maintain as much as possible their original rotation) – in general, this implies that bones “aligned” with the target translation are scaled more than bones “perpendicular” to it…
Bone stretching example.
- Iterations
- The maximum number of iterations allowed during the IK solving calculations. The higher this value, the more precise the IK result, but the heavier it gets to compute… The 500 default value should be enough in most situations, only very complex ones (like multi-level tree IKs) might require you to increase this setting.
Controlling Bone Rotation and Scale
You can further control an IK chain with each of its bones’ settings. Indeed, the sub-panels of bones implied in one or more IK chains (found in the Armature Bones panel) have an extra set of options, which allow you to block/limit there own rotation and scale (there “degree of freedom”, or DoF), during the IK solving process.
Do you remember the elbow example of the constraint page (you can’t rotate a human elbow backward, etc.)? Well, you can “constrain” IK bones the same way with these controls – with further advanced options, like rotation stiffness…
- Lock X Rot, Lock Y Rot, Lock Z Rot
- When enabled, these buttons prevent any rotation of the bone around its relevant axis(axes).
- Stiff X, Stiff Y, Stiff Z
- Only available when the relevant “lock” button is disabled. These numeric fields controls how “hard” it is for the IK to rotate the bone around its axes, from 0.0 (no stiffness) to 0.990 (nearly blocked – however, it does not prevent you to manually rotate the bone, as do the “lock” buttons…).
- Limit X, Limit Y, Limit Z
- Only available when the relevant “lock” button is disabled. These options allow you to limit the rotation of the bone within a given range. When enabled for a given bone axis, two numeric fields appear, where you can set the minimum (from -180° to 0°) and maximum (from 0° to 180°) allowed rotations.
- There is a goody for the Limit X and Limit Z options: when enabled, these limits are materialized in the 3D views, as a red arc of a circle for the X rotation range, and a blue arc of a circle for the Z rotation range – and when both limits are enabled, you also get a semi-transparent gray section of a sphere, materializing the whole area the bone’s tip is allowed to reach. Obviously, the Limit Y is not concerned by this feature, as it limits the bone’s roll…
- Stretch
- This value is the “reversed stiffness” of the bone IK scaling. It only has an effect when the Stretch option of the IK constraint is enabled. It ranges from 0.0 (no scaling allowed) to 1.0 (no stiffness in stretching).
Tree IK
Blender supports “tree IK”, i.e. multiple IK chains sharing a common part. The bones belonging to this common part are simultaneously affected by all the IKs – there respective influence determined by their PosW (and optionally RotW) value(s).

