Sub topic 9
IK Options: Stretch, Use Tail, Iterations, and Weights
This chapter assumes you can add an IK constraint to a bone, set its target and chain length, and add a pole target. It also assumes you know what pose bones are. The chapter covers the secondary options on the IK constraint. They change how far a chain can reach, which bone counts as the end of the chain, how long the solver works, and how competing targets are balanced.
Where the options live
Most options sit on the IK constraint in the Bone Constraints tab. One option, IK Stretch, is a property of each pose bone. It sits in the Bone tab under Inverse Kinematics.
| Option | Python property | Default | Where |
|---|---|---|---|
| Use Tail | `use_tail` | on | IK constraint |
| Stretch | `use_stretch` | on | IK constraint |
| Iterations | `iterations` | 500 | IK constraint |
| Weight (Position) | `weight` | 1.0 | IK constraint |
| Rotation, Weight (Rotation) | `use_rotation`, `orient_weight` | off, 1.0 | IK constraint |
| IK Stretch | `ik_stretch` | 0.0 | Pose bone |
Use Tail
The solver needs a point on the chain to move to the target. This point is the end effector. With Use Tail on, the end effector is the tail of the bone that carries the constraint. The whole bone is solved, and its tail lands on the target. This is the right setting for a forearm that ends at the wrist.
With Use Tail off, the end effector is the head of that bone. The bone itself no longer helps reach the target. Turn it off when the last bone is something like a hand or foot. You can then place the hand's head on the IK target and orient the bone yourself with another constraint, such as Copy Rotation.
When a chain ends one joint short of where you expected, check Use Tail first.
Stretch and IK Stretch
If the target moves farther than the chain can reach, the solver straightens the chain and stops. The end of the chain then falls short of the target. This can be what you want, because it stops a limb from separating at its joints.
Stretching lets the bones lengthen to reach. It needs two settings:
- The constraint's Stretch option must be on. It is on by default.
- Each bone that should stretch needs an IK Stretch value above 0 in the Bone tab. The default is 0, so by default nothing stretches.
IK Stretch is a factor from 0 to 1. At 0 the bone keeps its length. At higher values the bone lengthens more readily. Give the bones in a chain different values to control which part stretches first. A common choice is a small value on both arm bones, or 0 on a forearm that must keep its proportions.
Stretching changes the bones' scale. If you also use Stretch To or Copy Scale constraints on the same bones, expect the effects to compound.
Iterations
The standard solver is iterative. On each pass it moves the chain closer to the target. Iterations sets the most passes the solver may do per evaluation. The solver stops early once the target is reached, so a high value costs little for simple chains.
- A very low value, such as 5, leaves the chain visibly lagging behind a fast-moving target.
- The default of 500 is enough for most limbs.
- Long chains, such as tails or tentacles with many bones, can need more passes to settle, especially with IK limits.
Raising iterations does not fix a chain that cannot reach the target. If a pose is wrong because of bad limits or a bad pole angle, more iterations only spend more time reaching the same wrong pose.
Weights, Position and Rotation
Position (use_location) makes the chain aim for the target's location, and it is on by default. Weight sets how strongly the solver tries to meet this target.
Weight matters only when several IK constraints compete for shared bones. Take a spine with two arm chains attached to it. Each arm's IK pulls on the spine bones. A higher weight on one target makes the spine favor that arm. With a single IK chain, weight has no visible effect.
Rotation (use_rotation) adds the target's orientation as a second goal. The last bone of the chain then tries to match the target's rotation as well as its position. Weight under Rotation (orient_weight) sets how much that goal counts. This is handy for a foot IK bone that should also set the foot's angle. Rotation matching competes with reaching the position, so a high rotation weight can pull the chain off the target.
Setting the options from Python
This script assumes the ArmRig from the earlier examples exists, with an IK constraint named IK on forearm.
import bpy
rig = bpy.data.objects["ArmRig"]
forearm = rig.pose.bones["forearm"]
upper = rig.pose.bones["upper_arm"]
ik = forearm.constraints["IK"]
ik.use_tail = True # the forearm's tail is the end effector
ik.use_stretch = True # allow stretching on this constraint
ik.iterations = 500 # solver pass cap
ik.use_location = True # aim for the target position
ik.weight = 1.0 # position weight
ik.use_rotation = False # do not match target orientation
ik.orient_weight = 1.0 # only used when use_rotation is True
# Stretching also needs a per-bone value above 0.
upper.ik_stretch = 0.1
forearm.ik_stretch = 0.1Run it, then drag hand_ik beyond arm's length in Pose Mode. Set both ik_stretch values back to 0.0 and drag again to compare the two results.
Common mistakes
- Stretch is on but nothing stretches. Every bone's IK Stretch is still 0.
- The wrist overshoots or the hand stays behind. Use Tail is set the wrong way for the bone that carries the constraint.
- Weight changes do nothing. The chain has no shared bones with another IK chain.
- The limb looks sluggish. Iterations is too low for a fast-moving target.
- The chain pops when the target crosses the reach limit. Stretch values are high enough that bones lengthen suddenly. Lower them or add a Limit Distance constraint on the target.
Exercise
A chain has IK Stretch left at its default on every bone, and the constraint's Stretch option is on. The target is dragged beyond the chain's reach. What happens, and what two changes would make the chain reach the target?
Show answer
The chain straightens and stops short of the target, because IK Stretch is 0 on every bone, so no bone is allowed to lengthen. To make it reach, keep the constraint's Stretch option on and raise IK Stretch above 0 on the bones that should lengthen.
Exercise
You have two arm IK chains that share the same spine bones. The spine keeps bending toward the left arm's target when you want it to favor the right arm. Which option do you change, and on which constraint?
Show answer
Raise the Position Weight on the right arm's IK constraint, or lower it on the left arm's. Weight sets how strongly each target pulls on the shared bones.