Sub topic 4
The Armature modifier
This chapter covers the modifier that links a mesh to an armature and does the deforming. It assumes you know what a vertex group is and how bones are named (the previous chapters), and that you can switch between Object, Edit and Pose Mode.
What the modifier does
The Armature modifier reads the pose of an armature object and moves the vertices of the mesh it sits on. It does not store weights. The weights live in the mesh's vertex groups. The modifier connects the two sides:
- It takes the pose transform of every deforming bone.
- It looks for a vertex group with the same name as each bone.
- For each vertex, it blends the bone transforms using the vertex's weight in each matching group.
Because the connection is by name, the modifier works with any vertex group whose name matches a bone. Parenting only automates creating the modifier and the groups. You can build the same setup by hand.
The modifier panel
Open the Modifiers tab of the mesh object. An Armature modifier has these settings.
| Setting | Python property | Purpose |
|---|---|---|
| Object | `object` | The armature that drives the mesh. If empty, the modifier does nothing. |
| Bind to Vertex Groups | `use_vertex_groups` | Use vertex group weights. On by default. |
| Bind to Bone Envelopes | `use_bone_envelopes` | Use each bone's envelope distance instead of, or in addition to, groups. Off by default. |
| Preserve Volume | `use_deform_preserve_volume` | Use dual quaternion skinning instead of linear blend skinning. |
| Multi-Modifier | `use_multi_modifier` | Allow more than one Armature modifier to be combined on one mesh. |
| Vertex Group (mask) | `vertex_group` | Limit the whole modifier to the vertices in one group. |
| Invert | `invert_vertex_group` | Affect the vertices outside the mask group instead. |
Object
The Object field must point at the armature object, not the armature data. A mesh with an Armature modifier that has an empty Object field simply stays still when you pose. This is a common cause of the "my rig does nothing" report.
Vertex groups versus envelopes
Vertex groups are the standard method and the one this tutorial uses. Envelopes derive weights from the distance between a vertex and the bone's envelope volume. They give you no per-vertex control, so they are rarely used for finished characters. If both options are on, a vertex gets weights from both sources, which can produce hard-to-explain results. For weight painting work, leave only Bind to Vertex Groups on.
Preserve Volume
By default Blender uses linear blend skinning. When a joint twists strongly, the mesh collapses toward the axis, which is known as the "candy wrapper" effect. Preserve Volume switches to dual quaternion skinning, which keeps the volume of the twisted area.
Dual quaternion skinning has costs:
- It can bulge unexpectedly at joints that bend and twist together.
- Many game engines use linear blend skinning, so the deformation you see in Blender may not match the engine.
- It does not fix bad weights. It only changes how the weighted transforms are blended.
Multi-Modifier
Normally Blender warns you if a mesh has two Armature modifiers pointing at the same armature, because the result would deform twice. Multi-Modifier tells Blender that the stack is intentional. It is used when two different armatures, or two masked parts of the mesh, each get their own modifier. You will seldom need it.
The mask group
The Vertex Group field restricts the modifier's effect to vertices in that group, weighted by the group's values. Pair it with Invert to exclude a region. A typical use is to keep a prop or an accessory vertex-weighted to a separate armature while the body uses another. Do not confuse this mask group with the bone-named groups. The mask is just a selector and does not have to match a bone.
Where the modifier sits in the stack
Modifiers run from top to bottom, so order matters. The Armature modifier should usually be near the top.
- Put it before Subdivision Surface. Deforming the low-poly cage and subdividing afterwards is faster and gives smooth results. The subdivision then interpolates the deformed cage.
- Put it before Mirror only if the mesh is already symmetric by geometry. For a mesh that uses a Mirror modifier, the weights must be on the mirrored result's source half, and the modifier order determines whether the mirrored side deforms correctly. If a mirrored half moves wrongly, check the stack order first.
- Shape keys and other modifiers that generate geometry (Solidify, Array) should normally come before the Armature modifier, so the generated geometry is also deformed.
Blender evaluates shape keys before the whole modifier stack. A shape key changes the rest shape that the Armature modifier then deforms.
Creating the modifier
You can create it in three ways.
Parenting with the armature
With the mesh selected and the armature active, press Ctrl+P and choose an Armature option.
| Parent option | Result |
|---|---|
| Armature Deform | Adds the modifier and parents the mesh. No vertex groups are created. |
| ...With Empty Groups | Adds the modifier and creates an empty vertex group per deforming bone. |
| ...With Envelope Weights | Adds the modifier and creates groups with weights from the envelopes. |
| ...With Automatic Weights | Adds the modifier and creates groups with weights calculated from bone proximity. |
The next chapter covers automatic weights in detail. In Python, this is the same operator:
import bpy
mesh_obj = bpy.data.objects["Body"]
arm_obj = bpy.data.objects["Armature"]
bpy.ops.object.select_all(action='DESELECT')
mesh_obj.select_set(True)
arm_obj.select_set(True)
bpy.context.view_layer.objects.active = arm_obj
# Equivalent to Ctrl+P > With Automatic Weights
bpy.ops.object.parent_set(type='ARMATURE_AUTO')The other type values are 'ARMATURE' (Armature Deform), 'ARMATURE_NAME' (empty groups) and 'ARMATURE_ENVELOPE'.
Adding it by hand
Adding the modifier from the Modifiers tab does not set a parent. The mesh deforms correctly, but it is not a child of the armature, so moving the armature object moves the bones' pose result and not the mesh as a unit. Parent the mesh to the armature as well if you want them to move together.
import bpy
mesh_obj = bpy.data.objects["Body"]
arm_obj = bpy.data.objects["Armature"]
# Manual setup: the modifier deforms the mesh using vertex groups named after bones.
mod = mesh_obj.modifiers.new(name="Armature", type='ARMATURE')
mod.object = arm_objChecking that groups and bones line up
Most Armature modifier problems come from names. A group named Upper_Arm.L does nothing if the bone is called UpperArm.L. The script below reports mismatches. It lists deforming bones that have no group, and groups that match no bone.
import bpy
mesh_obj = bpy.data.objects["Body"]
mod = next((m for m in mesh_obj.modifiers if m.type == 'ARMATURE'), None)
if mod is None or mod.object is None:
print("No Armature modifier with an Object set.")
else:
bones = mod.object.data.bones
deform_names = {b.name for b in bones if b.use_deform}
group_names = {g.name for g in mesh_obj.vertex_groups}
print("Deform bones with no group:", sorted(deform_names - group_names))
print("Groups with no deform bone:", sorted(group_names - deform_names))The second list is not always an error. Groups used as masks, or groups for a bone whose Deform flag is off, also appear there. A group for a bone with Deform off is ignored by the modifier, so the script flags it deliberately.
Common errors
- Mesh does not move at all. The Object field is empty, the modifier is disabled in the viewport (the monitor icon), or you are posing a different armature.
- Mesh moves but one part stays behind. The vertex group name does not match the bone, or the bone has Deform turned off.
- Mesh jumps when you pose. The mesh object and the armature have different object transforms (for example, unapplied scale). Apply the scale of the mesh before binding.
- Mesh doubles its movement. Two Armature modifiers target the same armature, or the mesh is also deformed through a parent with a Bone relationship.
- Smooth surface looks lumpy. Subdivision Surface is above the Armature modifier in the stack.
- Edit Mode shows undeformed geometry. The modifier has "Edit Mode" display off, or "On Cage" is off. This only changes display, not the weights.
Exercise
A mesh is parented to an armature, the Armature modifier has the correct Object set, and the forearm bone moves in Pose Mode, but the forearm vertices do not follow. The vertex group "Forearm.L" exists and has weights. Name two things to check, and which Python property you would read for each.
Show answer
First, check that the bone is actually named exactly "Forearm.L" and compare it with the vertex group name (bone.name against vertex_group.name); a single character difference is enough to break the link. Second, check that the bone's Deform flag is on, by reading bone.use_deform. Also confirm that the modifier has use_vertex_groups set to True. A mask group set in vertex_group that excludes these vertices would also stop the deformation.