Sub topic 1
How a mesh follows an armature
A character mesh does not know about bones. It is a list of vertices, edges and faces. To make it bend when you rotate an elbow, Blender needs three things: a set of bones, a per-vertex record of which bones each vertex should follow and how strongly, and a modifier that applies that record every time the scene is evaluated. This chapter explains how those three parts fit together. Later chapters cover each part in detail.
Prerequisites
This chapter assumes you already know the following:
- Basic Blender navigation, and the Object, Edit and Pose modes of the 3D Viewport.
- How to select, move and rotate objects and mesh elements.
- A finished mesh with reasonable topology around joints, such as edge loops at elbows, knees and shoulders.
- A basic armature, or at least how to add bones in Edit Mode.
You do not need any Python knowledge to follow the concepts. The one script in this chapter is pure Python and runs outside Blender.
The idea: skinning
Deforming a mesh with bones is called skinning. The mesh is the skin, and the bones are the skeleton that moves it. Blender uses a technique known as linear blend skinning. Each vertex is moved once for every bone that influences it, as if that vertex were rigidly attached to that bone. The results are then averaged using weights.
A weight is a number from 0.0 to 1.0 that states how much a bone influences a vertex.
- A weight of 1.0 on one bone means the vertex follows that bone completely.
- A weight of 0.0 means the bone has no effect on that vertex.
- Weights split between bones, such as 0.5 and 0.5, put the vertex halfway between the two bone movements. This is what makes an elbow bend smoothly instead of creasing like folded cardboard.
For a vertex with position v, each influencing bone i has a transform M_i. This is the change from the bone's rest pose to its current pose. The deformed position is the weighted sum of w_i * (M_i applied to v).
The script below shows this with two bones in 2D. Bone A stays put. Bone B rotates 90 degrees around the origin. A vertex at (1, 0) has weight 0.5 for each bone.
import math
def rotate(point, degrees):
a = math.radians(degrees)
x, y = point
return (x * math.cos(a) - y * math.sin(a),
x * math.sin(a) + y * math.cos(a))
vertex = (1.0, 0.0)
# Each entry: (weight, rotation applied by that bone in degrees)
influences = [(0.5, 0.0), (0.5, 90.0)]
total = sum(w for w, _ in influences)
x = sum(w * rotate(vertex, deg)[0] for w, deg in influences) / total
y = sum(w * rotate(vertex, deg)[1] for w, deg in influences) / total
print(round(x, 3), round(y, 3)) # 0.5 0.5The vertex ends at (0.5, 0.5). That point is halfway between where bone A would leave it, (1, 0), and where bone B would leave it, (0, 1). Notice that the result is not on the circle of radius 1. Blended vertices move along a straight shortcut between the two positions, so they get closer to the joint. This is why heavily bent joints can look pinched, a problem you will meet again in the troubleshooting chapter.
The three parts of the setup
Blender stores skinning information in three places, and all three must agree for the mesh to move.
| Part | Where it lives | What it does |
|---|---|---|
| Bones | The armature object | Provide the transforms (`M_i`) when you pose |
| Vertex groups | The mesh object | Store the weight of every vertex for every bone |
| Armature modifier | The mesh object's modifier stack | Reads the pose and the weights and moves the vertices |
Bones
An armature is a separate object containing bones. In Pose Mode, you rotate, move or scale bones, and each bone gets a pose transform relative to its rest position. A bone only drives a mesh if its Deform setting is enabled. Bones used purely for control, such as an IK target, usually have Deform turned off.
Vertex groups
A vertex group is a named set of vertices, and each member has a weight. For skinning, the name is what links the group to a bone. A vertex group called Forearm.L is used by the bone called Forearm.L. If the names differ by even one character, the link is silently broken and that bone moves nothing.
A single vertex can belong to many groups. A vertex near the elbow might have 0.6 in Upper_Arm.L and 0.4 in Forearm.L.
The Armature modifier
The Armature modifier connects the pieces. Its Object field points to the armature. Each time the scene updates, the modifier looks at every vertex, finds its groups, matches the group names to deforming bones, and applies the weighted blend.
The modifier works with relative weights. It divides by the total weight contributed by deforming bones, so a vertex with 0.2 on one bone and 0.2 on another behaves like 0.5 and 0.5. A vertex with no weight on any deforming bone is not moved at all, so it stays where it is while the rest of the body moves away. Tools for keeping weights tidy are covered in the normalization chapter.
How the data flows
The original mesh data is never changed by posing. The modifier computes a deformed copy on the fly, which is why returning the bones to the rest pose returns the mesh to its original shape.
Getting from a mesh to a skinned mesh
There are two workflows, and you will normally combine them.
- Automatic setup. You parent the mesh to the armature with automatic weights. Blender creates a vertex group for each deforming bone, calculates initial weights from the distance between the vertices and the bones, and adds the Armature modifier for you. This gives a usable starting point in seconds, but rarely a finished result.
- Manual refinement. You open Weight Paint mode and correct the weights with brushes, then test the result in Pose Mode. You repeat the paint and test steps until the deformation looks right.
You can also build everything by hand: create vertex groups with the right names, assign weights, and add the Armature modifier yourself. This is mostly useful for scripting or fixing a rig that was set up incorrectly.
What good weights look like
Good weights follow a few simple principles, and every later chapter serves one of them.
- Rigid areas stay rigid. The middle of a forearm or a shin should have a weight of 1.0 on one bone.
- Joints blend over a short distance. The weight changes gradually across the edge loops near a joint, so the bend is smooth but does not drag in distant geometry.
- Neighbouring vertices have similar weights. Sudden jumps between adjacent vertices cause spikes and tears in the surface.
- Few influences per vertex. Many game engines accept at most four bone influences per vertex, so a clean rig stays within that limit even when the target is not a game.
Common reasons a mesh does not follow
Before you start painting, a few quick checks can save a long debugging session. The troubleshooting chapter covers them in depth.
- The mesh has no Armature modifier, or the modifier's Object field is empty.
- The bone's Deform checkbox is off.
- The vertex group name does not exactly match the bone name. Blender names are case sensitive.
- The mesh or the armature has unapplied scale, so the transforms are not what you expect.
- The vertices have weight in groups that match no deforming bone, so they are not moved.
Where this chapter fits
The rest of the tutorial follows the order in which you would work on a real character. You will prepare the bones and their Deform settings, learn how vertex groups store weights, and examine the Armature modifier more closely. Then you will bind with automatic weights, read the colours in Weight Paint mode, and refine with brushes, masking, normalization and mirroring. The last chapters cover cleanup, testing in Pose Mode, troubleshooting, and reading and writing weights with Python.
Exercise
A mesh has a vertex group named "forearm.L", but the armature bone is named "Forearm.L" and has Deform enabled. You rotate the bone in Pose Mode and the forearm does not move. Which of the three parts (bones, vertex groups, Armature modifier) contains the fault, and what is the fix?
Show answer
The fault is in the vertex groups. Blender matches groups to bones by exact, case-sensitive name, so "forearm.L" does not match "Forearm.L" and the bone has no weights to apply. Rename the vertex group (or the bone) so both names are identical. The Deform setting and the modifier are fine.
Exercise
A vertex has weight 0.3 on bone A and 0.3 on bone B, and nothing else. Bone A stays still, and bone B moves the vertex to a position 10 units away. Where does the vertex end up, given that the Armature modifier divides by the total weight?
Show answer
The weights are equivalent to 0.5 and 0.5, so the vertex ends up halfway: 5 units from its rest position, on the line toward where bone B alone would put it.