Sub topic 4
What Inverse Kinematics Solves
Assume you can create an armature, switch to Pose Mode, and understand parent-child bone relationships. This chapter focuses on the working model behind inverse kinematics (IK), not on building a complete control rig.
Forward Kinematics and Inverse Kinematics
Forward kinematics (FK) poses a chain from the parent outward. You rotate the upper arm, then the forearm, and the hand follows. FK gives direct control over each joint, but placing the hand precisely can require several adjustments.
Inverse kinematics works in the opposite direction. You place a target where the hand should be, and Blender calculates the rotations needed to move the end of a bone chain toward that target.
| Method | You control | Blender calculates |
|---|---|---|
| FK | Individual bone rotations | Child positions |
| IK | An end target | Bone rotations in the chain |
The IK solver tries to satisfy a position goal while preserving the chain's existing lengths. For a two-bone arm, it usually rotates the upper arm and forearm so the hand reaches the target.
flowchart TD
A[Move IK target] --> B[IK solver]
B --> C[Rotate upper arm]
B --> D[Rotate forearm]
C --> E[Hand reaches target]
D --> Eimport bpy
rig = bpy.data.objects["ArmRig"]
forearm = rig.pose.bones["forearm"]
ik = forearm.constraints.new("IK")
ik.name = "Hand IK"
ik.target = rig
ik.subtarget = "hand_ik"
ik.chain_count = 2This script assumes an armature named ArmRig already contains bones named forearm and hand_ik. The constraint belongs on the last deform bone in the chain. chain_count = 2 tells Blender to solve the forearm and its parent, upper_arm. A value of zero would include the whole parent chain.
What the Solver Can and Cannot Determine
A target position does not always define one unique pose. An arm can reach the same point with the elbow above or below the arm. Blender needs another input to choose the bend direction. A pole target provides that input by indicating where the elbow should point.
The solver also depends on the chain's rest lengths. If the target is farther away than the combined bone lengths, the arm may stretch, stop short, or point toward the target, depending on the IK settings. If the target is too close, the chain may fold sharply.
Common errors include these:
- Applying IK to the wrong bone, so the intended chain is not included.
- Choosing an incorrect chain length, which causes too many or too few bones to move.
- Leaving the bend direction ambiguous, causing the chain to flip.
- Placing the target beyond reach and expecting the solver to preserve both position and length.
- Confusing the target bone with the constrained bone. The target supplies the goal; the constrained bone starts the solve.
Exercise
An arm has an upper arm and forearm. Which chain_count value makes an IK constraint on the forearm solve both bones?
Show answer
Use chain_count = 2. The value counts the constrained forearm and its parent upper arm.