Inverse and Forward Kinematics (IK / FK)

Kinematics* in rigging and animation describe several methods to control and animate the rotation and location of the joints of limbs (i.e. Kinematic Chains*).


Illustration of mechanical arm; Instrumenta chyrurgiae et icones anathomicae
Ambroise Paré, 1564
CC BY 4.0, Wellcome Library, London.

Usually, the most basic rig for any kind of limb is to parent the layers together, from the tip (child, e.g. hand or foot) to the root (parent, e.g. shoulder or hip) of the limb.
In this simple case, that’s called Forward Kinematics (FK)*: you just need to animate the rotation of each joint from the root to the tip to animate the whole limb.
This is the easiest way to animate a limb, as rotation are simple values, and you just have a single value per joint to animate. This works as long as there is no interaction and constraint between the tip (e.g. hand or foot) with something else which moves differently (or is just static, like the floor in the case of a foot).

But if you need to constrain the tip of the limb, or just keep it static while animating the root (e.g. keep the foot still on the ground while moving the hips around), you’ll need another method where you can animate both ends of the limb using their position instead of their rotation. That’s called Inverse Kinematics (IK)*, because to the contrary of the FK, you have to animate the end of the limb and the position value is then automatically converted to rotation values in the reversed order, from the tip to the root of the limb. This makes it a bit more difficult to achieve a nice animation, as you’ll have to take care of the trajectories of the end of the limb, and handle position properties which are multi-dimensional and more complex than simple rotations.


Claude Autret “Jissse”
All rights reserved

Note

When animating using IK, you have to set the values of the position keyframe and their temporal interpolation*, as you would with FK and rotations, but you also have to manage the spatial interpolation and make sure the limb always follows a curved trajectory (and not straight lines)1.

With Duik (and the Auto-rig) you can rig limbs in a way to be able to switch at any time between IK and FK according to your needs at the time you’re animating. There are also specific types of IK to ease the animations of longer limbs like horse legs, ant and crab legs or even like hair strands, tails or even spines and long necks.

IK and FK creation

There are two ways to rig After Effects layers with the different types of Duik IK and FK controls:

Both methods allow you to customize the type of IK/FK controls which are created by Duik.

Duik creates one or several controller layers, according to the type of IK/FK, and adds a few effects on these controllers to adjust the settings and give a more precise control on the limb.

Using the Auto-Rig

Although the Auto-Rig is a smart tool and will try to do its best no matter what layer you select, it’s better to use it exclusively with Duik bones.

  1. Select the bone layers you want to rig.
  2. Click the Auto-Rig button. This button is available in the Meta-Rig, Bones and Links and Constraints panels.

When using custom bones and for other specific long chains like tails or hair strands, you can choose the type of FK or IK control to use. Read the Bones and Auto-Rig / Auto-Rig section for more details.

Using the Kinematics menu

This method works with all layers.

  1. Parent the layers together, from the tip (child) to the root (parent) of the limb.
  2. Create a controller layer3 if you’d like to use a custom controller. This is optional as Duik will create a controller for you if there’s no controller already available.
  3. Click the Kinematics menu and then click the type of IK or FK Control you’d like to use.


Different types of IK and FK controls are available.

This menu shows the different types of IK and FK Control:

Standard IK/FK

The standard IK and FK control can be used with chains consisting of one to three layers (plus the tip, like the hand or the foot). It can be used for almost all kind of legs and arms.

RXLAB_VIDEO
This video is part of the official comprehensive video course about Duik Ángela

Single-layer chain

When used on a single layer, the rigged layer just automatically rotates to always point towards its controller.

With this type of IK/FK, you can animate either the position of the controller and the position of the rigged layer (or its parent), or the rotation of the layer itself. This means you can animate both using IK or FK as you wish.
If there was a tip layer (e.g. hand, foot…) when rigging the layers, it can be rotated using the controller’s rotation property.

The effect on the controller allows you to customize the control.


The IK Controller with the guides, showing the limits, and the full rotation limit in red.

2-layer chain

RXLAB_VIDEO
This video is part of the official comprehensive video course about Duik Ángela

With two layers, both layer rotations are automated to form a triangle between the two joints and the controller; this is very natural for arms and legs.

When animating the position of the controller or the position of the first layer (or any of its parents), the limb rotates and bends automatically. With this IK setup, Duik also controls the position of the limbs to be able to stretch (or shrink) them, and allow for fore-shortening effects for example.
If there was a tip layer (e.g. hand, foot…) when rigging the layers, it can be rotated using the controller’s rotation property.

Duik also includes nice automations to help the animation using FK and make it even simpler and quicker, although it’s already much simpler than IK animation.

All this can be configured and animated in the effect of the controller.

Tip

The data section of the effect exposes useful values to write your own expressions or to be used with the connector for an advanced and more customized rig.

Tip

You can easily switch between IK and FK animation using the IK/FK Switch 4 tool in the animation panel.


The IK Controller with the guides, showing the auto swing limit.

3-layer chain

Rigging a limb with three joints (and more) is more complicated than it seems. In two dimensions with only two joints, there are only two solutions to the equation defining the rotations of each part (the middle joint, the elbow or knee, can only be on one of the two sides of the line passing through the first joint and the controller). But with three joints, there’s an infinity of solutions.

Apart from this difficulty, if we’d use standard IK for the three joints without more details, that’d mean the animator would not be able to manually adjust each joint if needed. Rigging should ease the life of animators, but never restrain their job.

These are the reason why Duik does not include true 3-layer IK, but is able to rig 3-layer chains with better controls and accuracy, combining standard 1-layer and 2-layer IK.

There are two possibilities: rigging the first layer with a 1-layer IK and the next two layers with a standard 2-layer IK, or the opposite, starting with the 2-layer IK for the first two layers. With both methods, Duik creates a single controller for both the IK controls, allowing for a very simple animation with just the position of the controller, and all detailed controls gathered in the effects of the controller.
You can choose between the two in the additional panel of the IK button.


Figure 21 from The Kinematics of Machinery.
Franz Reuleaux, 1876
Public domain

Bézier IK

Bone chains with more than two or three bones are usually used to rig flexible limbs, like tails, spines, long necks or hair strands. In this case, the chain is not animated with separated joints, but all at once as a long curve. There are two options to animate this:


Four layers controlled with Bézier IK

Three controllers are available to animate the limb with Bézier IK:

There are two effects to adjust some details:


When showing the curve handles, you can adjust the virtual Bézier curve very precisely.
Double click on the handle to move it around.

The optional Bézier handles are actually groups in the shape layer content of the Curve controller; to animate them, animate the position of these groups.

FK with overlapping animation

The FK rig is a very simple controller to control all the rotations of a long (or short) chain of bones, either individually or all at once. It was especially made to easily animate tails, cloth, hair strands, scarfs, etc.

When animating the whole limb at once with a single value, Duik can automatically handle the detailed animation for you, with an automatic overlapping animation, completely customizable.


Claude Autret “Jissse”
All rights reserved

Fish tails are rigged with the FK controls and automatic overlapping animation.


Four layers controlled at once with the FK control.

To animate the limb, you can just animate the rotation of the controller.

Tip

When adjusting the start pose of the animation, adding the first keyframe on the rotation of the controller, you’ll also need to adjust the Angle value of the second layer of the chain (in the controller’s effects), to fix the pose. That’s because of the automatic overlapping animation, which can’t control the first pose as it needs animation data to process the angles, and there’s no animation before the first keyframe.

For performance reasons, Duik also ignores all keyframes hidden before the start of the composition.

To adjust the settings of the automatic overlapping animation, an FK Overlap effect is available on the controller.

Finally, one angle control is added for each layer of the controlled chain to allow you to adjust and animate each part individually, like in all standard FK rig.

Bézier FK

The Bézier FK is a specific setup using the standard Bézier IK as a base and some simple expressions and parenting to be able to animate both using fake FK and Bézier IK at the same time. This is very useful to animate spines or necks, or any chain which itself has children (like the head for the neck) and when you may need both FK for most of the animation and IK in specific cases.


Four layers controlled using Bézier FK

With this Bézier FK, you have the exact same controls as with Bézier IK (animate the position of the controllers, controlling the curvature with the controller at the center of the chain), but you can also animate the rotation of the controllers, as you would when using standard FK.
In this case, Duik moves the curve controller automatically, and you can adjust this automation using the Auto-Curve effect on the controller at the end of the limb.

META


  1. As the movement of the hand or the foot are actually the result of the rotation of the elbow and shoulder or the knee and hip, they naturally move following smooth curves. That’s not the case by default when animating positions in After Effects, where the trajectory will be a straight line. When animating with IK you’ll have to use the pen tool to adjust the spatial Bézier interpolation of the position keyframes if you don’t separate the dimensions and handle manually the individual interpolations for each axis. 

  2. cf. Bones and Auto-Rig 

  3. cf. Controllers 

  4. cf. Animation / Tools / IK/FK Switch