Sub topic 3
Vertex Groups: Where Weights Live
This chapter assumes you can switch between Blender’s Object, Edit, and Pose modes. You also need a mesh and an armature with at least one bone. The armature should already be positioned inside the mesh.
What a vertex group stores
A vertex group is a named collection of mesh vertices. Each vertex in the group can have a weight from 0.0 to 1.0:
0.0means the bone has no influence.1.0means the bone has full influence.- A value between them means partial influence.
For armature deformation, Blender uses the vertex group name to connect weights to a bone. A group named UpperArm.L affects the bone named UpperArm.L. The names must match exactly, including capitalization and punctuation.
A vertex can belong to several groups. For example, a shoulder vertex might have these weights:
| Vertex | UpperArm.L | Spine | Total |
|---|---|---|---|
| 128 | 0.65 | 0.35 | 1.00 |
When the armature moves, Blender combines the transformations from both bones according to these weights. This blending is called skinning.
Viewing groups in Blender
Select the mesh and open the Object Data Properties tab. Its green triangle icon contains the Vertex Groups panel. Each entry in the list is one group.
The group list is also available in Edit Mode. Select a group, then use Select or Deselect to show which vertices belong to it. The Assign button adds the selected vertices with the current weight. Remove deletes their membership from that group.
Membership and weight are separate ideas. A vertex can belong to a group with a very small weight, such as 0.001. Cleaning tools can remove memberships below a chosen threshold later.
Assigning a simple group
The following script creates a group named Bone on the active mesh and assigns every vertex a weight of 1.0. Run it with a mesh object active.
import bpy
mesh_obj = bpy.context.active_object
if mesh_obj is None or mesh_obj.type != 'MESH':
raise RuntimeError("Select a mesh object first.")
group = mesh_obj.vertex_groups.get("Bone")
if group is None:
group = mesh_obj.vertex_groups.new(name="Bone")
vertex_indices = [vertex.index for vertex in mesh_obj.data.vertices]
group.add(vertex_indices, 1.0, 'REPLACE')
print(f"Assigned {len(vertex_indices)} vertices to {group.name}.")The REPLACE mode sets the specified weight directly. Other modes include ADD, which increases existing weights, and SUBTRACT, which decreases them.
Reading a vertex's memberships
Each mesh vertex has a groups collection. Every item identifies a vertex group by index and stores that vertex’s weight in the group.
import bpy
mesh_obj = bpy.context.active_object
for vertex in mesh_obj.data.vertices:
memberships = []
for membership in vertex.groups:
group_name = mesh_obj.vertex_groups[membership.group].name
memberships.append(f"{group_name}={membership.weight:.3f}")
print(vertex.index, memberships)This output helps you find vertices influenced by the wrong bone or vertices with no useful memberships. A vertex with no groups is not controlled by the armature.
Exercise
A bone is named Forearm.R, but the mesh group is named Forearm.Right. Will the group drive the bone? What should you do?
Show answer
No. Rename the vertex group to Forearm.R, or rename the bone so both names match exactly. Then verify that the Armature modifier uses the intended armature.