Sub topic 2
Binding with automatic weights
This chapter assumes you can work in Object, Edit, and Pose modes, select objects and bones, and that your mesh and armature are already built. Each bone needs the Deform option turned on, and the mesh should be scaled correctly relative to the armature.
Parenting with automatic weights creates a vertex group for each deforming bone and assigns starting weights based on each vertex's distance to the bones. The Armature modifier then uses those weights to move the mesh when you pose the bones.
- Select the mesh, then Ctrl+click the armature so it becomes the active object.
- Press Ctrl+P and choose With Automatic Weights.
You can run the same bind from Python:
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
bpy.ops.object.parent_set(type='ARMATURE_AUTO')Weight Paint mode and reading the weight colors
Select the mesh and switch to Weight Paint mode. Blue means a vertex has no influence from the active bone. Red means full influence. Green and yellow sit in between. Use the bone selection in Pose Mode to change which group is shown.
Painting weights with brushes
The Draw brush adds or removes weight, depending on the blend mode. The Blur, Average, and Smear brushes soften or move existing weights. Use Blur to smooth harsh transitions, and Smear to move weight along a surface.
Painting one bone at a time with selection masking
When you paint near a joint, you can accidentally change a neighboring bone's weights. To prevent this, select a bone in Pose Mode, then turn on bone selection masking in the Weight Paint header. Only the selected bone's vertex group is painted.
Exercise
After binding, a bone you pose moves a vertex on the wrong side of the mesh. Which tool and setting would you use to paint only that bone's weights?
Show answer
Select that bone in Pose Mode, switch to Weight Paint mode, turn on bone selection masking, then paint with the Draw or Blur brush.