Sub topic 2
Parenting and Connected Bone Chains
This chapter assumes you can create an armature, add bones in Edit Mode, and switch between Object, Edit, and Pose Mode. The Python examples assume basic scripting familiarity. Everything here sets up the structure that forward kinematics (FK) and inverse kinematics (IK) later depend on.
Why Hierarchy Matters
A bone hierarchy is a tree. Each bone has at most one parent, and the parent's pose transform is inherited by its children. Rotate an upper arm and the forearm and hand move with it, because they sit below it in the tree.
The hierarchy also defines what an IK chain is. The IK constraint walks from the bone that owns it up through its parents. If the hierarchy is wrong, the chain is wrong, no matter how the bones look in the viewport.
Parent Relationships
A parent relationship is a link stored on the child bone. In the Python API it is EditBone.parent. In the interface it is the Relations panel in the Bone properties tab, or Ctrl+P in Edit Mode.
Two details matter in practice:
- Parenting is set in Edit Mode. In Pose Mode you can read
pose_bone.parent, but you cannot change it. - A child inherits its parent's pose transform relative to the rest pose. At rest, nothing moves. Posing the parent carries the child along.
Connected and Offset Bones
A child bone can be parented in two ways.
| Kind | Setting | Behavior |
|---|---|---|
| Connected | `use_connect = True` | The child's head is locked to the parent's tail. The child cannot be moved away from it. |
| Offset (not connected) | `use_connect = False` | The child's head can sit anywhere. It still inherits the parent's transform. |
Connected bones form a continuous chain, like an arm or a spine. Offset bones suit parts that follow a parent but have their own position, such as a finger root on the hand, or a control bone parented to a root.
When a bone is connected, its location channels in Pose Mode have no effect, because the head is pinned to the parent's tail. You can only rotate and scale it. Offset bones can be moved in Pose Mode.
Chains and the IK Constraint
IK needs a chain of parented bones. Connected chains are the simplest case. The solver rotates bones so the tip of the last bone reaches a target. Bones that are not connected can be part of a chain, but a gap between a parent's tail and the child's head makes the result harder to predict. Use connected bones for limbs unless you have a reason not to.
Building a Chain in Python
This script creates the arm used throughout the tutorial. It also adds a hand control bone and a pole bone. Those two bones have no parent, so they are not part of the chain.
import bpy
arm_data = bpy.data.armatures.new("ArmRig")
rig = bpy.data.objects.new("ArmRig", arm_data)
bpy.context.collection.objects.link(rig)
bpy.context.view_layer.objects.active = rig
rig.select_set(True)
bpy.ops.object.mode_set(mode='EDIT')
eb = arm_data.edit_bones
upper = eb.new("upper_arm")
upper.head = (0.0, 0.0, 0.0)
upper.tail = (1.0, 0.1, 0.0) # slight bend so the IK solver has a bend direction
fore = eb.new("forearm")
fore.head = (1.0, 0.1, 0.0)
fore.tail = (2.0, 0.0, 0.0)
fore.parent = upper
fore.use_connect = True
hand_ik = eb.new("hand_ik")
hand_ik.head = (2.0, 0.0, 0.0)
hand_ik.tail = (2.0, 0.0, 0.3)
elbow_pole = eb.new("elbow_pole")
elbow_pole.head = (1.0, 2.0, 0.0)
elbow_pole.tail = (1.0, 2.0, 0.3)
bpy.ops.object.mode_set(mode='POSE')Points to notice:
fore.headequalsupper.tail. Settinguse_connect = Truewould snap the head there anyway, but matching the coordinates keeps the data consistent.upper.tailhas a small Y offset. The chain is not perfectly straight. A perfectly straight chain gives the IK solver no bend direction, which you will meet again when we cover pole targets and troubleshooting.- The new bones are created in Edit Mode through
armature.edit_bones. Edit bones are only valid while the armature is in Edit Mode. Reading or storing them after leaving Edit Mode can crash Blender or give stale data.
Checking the Hierarchy
After the script finishes, you can inspect the result from Pose Mode:
import bpy
rig = bpy.data.objects["ArmRig"]
for pb in rig.pose.bones:
parent = pb.parent.name if pb.parent else None
print(pb.name, "parent:", parent, "connected:", pb.bone.use_connect)Expected output lists upper_arm with no parent, forearm with parent upper_arm and connected True, and the two control bones with no parent and connected False.
Note the two different objects. rig.pose.bones holds pose bones, which carry the pose and constraints. rig.data.bones holds the rest-pose bones, and use_connect is read from there.
What Happens When You Change a Hierarchy
Changing parents after posing or animating can produce surprises.
- Re-parenting in Edit Mode changes how the child inherits. Existing poses and keyframes are interpreted against the new parent, so the child may jump.
- Clearing a parent with Alt+P offers "Clear Parent" and "Clear and Keep Transformation". In Edit Mode, bones keep their rest position either way, but their inherited motion changes.
- Setting
use_connecttoTruemoves the child's head to the parent's tail. The child bone's tail does not follow, so its length and direction change. - Deleting a bone in the middle of a chain leaves its children without a parent, or parented to the deleted bone's parent, depending on the delete method. Check the Relations panel afterward.
Inherit Options
The Relations panel has settings that control which parts of the parent's transform a child receives:
- Inherit Rotation: if off, the child keeps its own orientation while the parent rotates.
- Inherit Scale: controls whether the parent's scale reaches the child, with several modes such as Full, Average, and None.
- Local Location: whether the child's location channels are measured in the parent's space.
The defaults suit most limbs. Turning off Inherit Rotation is a common technique for a head or an IK control that must keep its orientation while a parent moves. It is also a frequent cause of "why does this bone not follow its parent" questions.
Common Errors
| Symptom | Likely cause | Fix |
|---|---|---|
| IK affects only one bone | The chain is shorter than expected because a bone lacks a parent | Check parents in the Relations panel and in Edit Mode |
| Child bone cannot be moved in Pose Mode | The bone is connected | Rotate it, or disconnect it if it needs to translate |
| A gap appears between bones when posing | The child is not connected and is parented as an offset bone | Connect it if the chain should be continuous |
| The control bone moves with the arm | The control bone is parented to a chain bone | Parent controls to a root or leave them unparented |
| Script fails with a reference error on edit bones | Edit bones were accessed after leaving Edit Mode | Do all edit-bone work inside Edit Mode, then switch modes |
Keep Controls Out of the Chain
In the example, hand_ik and elbow_pole have no parent. If an IK target were a child of a bone in the chain it drives, it would move whenever the solver moved that bone, and the solver would chase a target that keeps moving. This is a dependency cycle, and it produces jitter or a warning. Targets and poles belong outside the chain, parented to a root or to the rig object.
Summary of the Working Model
- Parenting forms a tree, and children inherit the pose of their parents.
- Connected bones pin their head to the parent's tail, which makes continuous chains.
- IK reads the chain by following parents from the constrained bone.
- Parenting is edited in Edit Mode. Pose, constraints, and drivers sit on pose bones.
- Control bones should sit outside the chain they control.
Exercise
You build a two-bone arm with forearm parented to upper_arm, but use_connect is False. A teammate says IK "does not work" on it. In Pose Mode, you can also move forearm away from the end of upper_arm. What is the structural difference from a connected chain, and what change makes the arm a continuous chain?
Show answer
With use_connect False, the forearm is an offset child. It inherits the parent's transform but its head can sit anywhere, so the chain can have a gap and the solver result is harder to predict. Enter Edit Mode and connect the bone, either by setting forearm.use_connect = True in Python or by ticking Connected in the Relations panel. This snaps the forearm's head to the upper arm's tail and removes its location channels in Pose Mode.
Exercise
A rigger parents the hand_ik target bone to forearm so that it "stays with the hand". Why does this cause problems once an IK constraint on forearm targets hand_ik?
Show answer
The target depends on the forearm's position, and the forearm's solved pose depends on the target. This is a dependency cycle. The solver chases a target that moves whenever the chain moves, which causes jitter or a dependency warning. Parent the target to a root bone or leave it unparented.