Sub topic 2
Anatomy of a Bone
This chapter assumes you can navigate the 3D viewport, switch between Object, Edit and Pose modes, and read a location/rotation/scale transform. It covers what a single bone is made of. Hierarchies, rest pose and posing get their own chapters.
A bone is a segment with two ends
A bone is a straight line segment in 3D space with three parts:
- The head is the start of the bone. It acts as the joint, the point the bone rotates around when you pose it.
- The tail is the far end. It marks where the bone points and how long it is.
- The body is the stretch between head and tail. You select and move it as a whole.
In the viewport the default display style is Octahedral. It is wide near the head and narrows to a point at the tail, so you can tell which end is which. The round "ball" at each end is the part you click to select the head or tail alone.
Selecting the parts
In Edit Mode, the three parts are selected independently:
- Selecting the head and moving it changes the bone's start and length, and leaves the tail where it is.
- Selecting the tail and moving it changes the direction and length around a fixed head.
- Selecting the body selects both ends, so the bone moves rigidly.
This matters most when bones are connected, which a later chapter covers. Moving a connected child's head also moves its parent's tail, because the two share one point. If a joint you adjusted seems to move something else, check whether the bones are connected.
What defines a bone
Each bone stores a small set of values. Blender's Python API exposes them on edit bones, which you use in Edit Mode.
| Property | Meaning |
|---|---|
| `head`, `tail` | Positions of the two ends, as 3D vectors in armature space |
| `length` | Distance between head and tail |
| `roll` | Rotation around the head-to-tail axis, in radians |
| `head_radius`, `tail_radius` | Thickness at each end, used by envelope deformation and B-Bone display |
| `use_deform` | Whether the bone moves mesh vertices when the armature deforms a mesh |
| `use_connect` | Whether the head is locked to the parent's tail |
| `parent` | The parent bone, if any |
Armature space means coordinates relative to the armature object's origin. If you move or rotate the armature object in Object Mode, every bone moves with it, but the stored head and tail values do not change.
Length is not an independent property. It is derived from head and tail. Setting length in code moves the tail along the bone's current direction and keeps the head fixed.
The local axes
Every bone has its own coordinate system, and its Y axis always runs from head to tail. The X and Z axes are perpendicular to Y. Roll sets how X and Z are oriented around Y. Roll does not change where the bone points. It changes which way "bend left" or "twist" means when you rotate the bone in Pose Mode.
You can turn on Axes in the Armature data properties, under Viewport Display, to see each bone's local axes. Use it whenever a bone rotates in an unexpected direction. Roll gets its own chapter later, so for now just know that it exists and defaults to zero for bones you create from a script.
Three views of the same bone
Blender holds three separate objects for what you think of as one bone, and mixing them up is a common source of errors.
- Edit bone (
armature.edit_bones). Editable, and available only in Edit Mode. Use it to change head, tail, roll and parenting. - Bone (
armature.bones). The stored rest-pose result. In Object and Pose Mode it is read-only for position values. - Pose bone (
object.pose.bones). The per-object posing data (rotation, location, scale, constraints). It lives on the armature object, not the armature data.
The next code block creates a bone, sets its anatomy in Edit Mode, then reads it back as a regular bone.
import bpy
# Create armature data and an object that uses it
arm_data = bpy.data.armatures.new("AnatomyDemo")
arm_obj = bpy.data.objects.new("AnatomyRig", arm_data)
bpy.context.collection.objects.link(arm_obj)
bpy.context.view_layer.objects.active = arm_obj
# Edit bones can only be created in Edit Mode
bpy.ops.object.mode_set(mode='EDIT')
eb = arm_data.edit_bones.new("upper_arm")
eb.head = (0, 0, 0)
eb.tail = (0, 0, 2)
eb.roll = 0.0
eb.head_radius = 0.10
eb.tail_radius = 0.05
print("edit length:", eb.length) # 2.0
print("direction:", eb.vector) # tail - head
eb.length = 3.0 # moves the tail, head stays put
print("new tail:", tuple(eb.tail)) # (0.0, 0.0, 3.0)
bpy.ops.object.mode_set(mode='OBJECT')
# Read the same bone back from the stored rest data
bone = arm_data.bones["upper_arm"]
print("rest head:", tuple(bone.head_local))
print("rest tail:", tuple(bone.tail_local))
print("deforms mesh:", bone.use_deform) # True by defaultNote the names head_local and tail_local. On a Bone, plain head and tail are relative to the parent, while the _local versions are in armature space and match the edit bone values. For a root bone the two differ only in origin, which makes this easy to miss in a one-bone test.
Radius and envelopes
head_radius and tail_radius set the thickness of the bone's envelope. Envelope is one of the two ways Blender can deform a mesh. It uses a bone's radius and a separate envelope_distance to decide which vertices a bone influences, with no vertex groups involved. Most production rigs use vertex groups instead, because they give exact control, and this tutorial uses them from the skinning chapters on. The radius values still show up in the B-Bone display type and in the Envelope display type.
Edge cases to know
- Zero-length bones are deleted. If head and tail are in the same place when you leave Edit Mode, Blender removes the bone. Always give a new bone a tail that differs from its head.
- Names must be unique within an armature. Blender adds a suffix such as
.001to a duplicate name. Do not rely on a name you typed, but readbone.nameafter creating it. - Names carry meaning. A vertex group that has the same name as a deforming bone makes that bone move those vertices. Renaming a bone in the UI renames the matching vertex groups on child meshes, but renaming through Python data access does not.
- Scale on a bone is not length. Scaling a pose bone leaves the stored length unchanged, because pose transforms never edit the rest data.
Exercise
A bone has head (0, 0, 1) and tail (0, 0, 3). You set length = 1 in Edit Mode. Where is the tail afterward, and what happens to the head?
Show answer
The head stays at (0, 0, 1). The tail moves along the head-to-tail direction (here straight up) to (0, 0, 2), because the new length is 1 from the head.
Exercise
You create a bone in a script with head and tail both set to (0, 0, 0), then switch to Object Mode. Why can't you find the bone in armature.bones, and how do you fix it?
Show answer
Blender deletes zero-length bones when Edit Mode ends. Give the tail a position different from the head, for example (0, 0, 1), before leaving Edit Mode.