Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 37 ยท Animation and Rigging

Blender Shape Keys, Constraints and Drivers Explained

Morph meshes with Blender shape keys for facial expressions, automate objects with constraints like Track To and Copy Rotation, and link values with drivers.

Bones are not the only way to animate. Shape keys store alternative vertex positions of a mesh and let you blend between them (a smile, a blink, a muscle bulge). Constraints make one object follow, point at or copy another. Drivers connect one property to another with a formula. Together they build expressive rigs without keyframing everything by hand.

Blender cannot run on this site, so steps are described in words, and the Python stand-ins show how blending, constraint limits and driver expressions work as numbers.

Shape keys

  1. Select a mesh, open the Object Data tab (green triangle icon) and find Shape Keys.
  2. Click + once to add the Basis key: the original shape. Do this first.
  3. Click + again to add Key 1. Rename it, for example Smile.
  4. With Smile selected, enter Edit Mode (Tab) and move vertices. Do not touch the Basis shape afterwards (changing it after the fact breaks the other keys).
  5. Back in Object Mode, drag the Value slider from 0 to 1 to blend between the Basis and Smile.

Each shape key is a stored set of vertex offsets from the basis. The final vertex is:

final = basis + sum(value_i * (key_i - basis))

Values can exceed 1 or go negative (use Range Min/Max) to exaggerate or invert a shape. Vertex Group limits a key to some vertices (a smile only on the left side, for example). Press Mirror options to make left and right versions.

Python Stand-in: blending shape keys on one vertex

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Because the offsets add, mixing several keys is cheap and predictable. Animate by keyframing the Value slider (hover and press I), so facial animation becomes a few curves in the Graph Editor (see Keyframes).

Tips: keep keys named by expression (Blink_L, Blink_R, Jaw_Open); the mesh must keep the same vertex count and order, so add shape keys after modelling is finished, because adding or deleting vertices later breaks them (or at least needs care).

Constraints

A constraint limits or drives an object's transform from outside. Add one in the Object Constraint tab (the icon of two linked objects): Add Object Constraint, then pick the type. For bones, use the Bone Constraint tab in Pose Mode. Constraints are evaluated in order from top to bottom and have an Influence slider (0 to 1) that is itself animatable.

Common constraints:

Constraint Purpose
Track To Point at a target (cameras, lights, eyes). Use To = -Z, Up = Y for cameras and lights
Copy Location / Rotation / Scale Follow another object's transform
Child Of Parent that can be switched on and off (a hand picking up a cup)
Follow Path Move along a curve (cameras, trains)
Limit Location / Rotation Clamp motion (an elbow that bends only one way)
Damped Track, Locked Track Softer or axis-limited pointing
Inverse Kinematics (IK) Solve a chain from a target (Pose Mode, bone constraint)
Floor Keep an object above a plane

Inverse kinematics moves a whole chain (shoulder, elbow, wrist) so the end bone reaches a target: drag a hand and the arm follows. Forward kinematics (normal bone rotation) is better for swinging motion; IK is better for feet planted on the ground.

Python Stand-in: Limit Rotation and constraint influence

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Drivers

A driver sets a property from a formula that reads other properties, so no keyframes are needed. Right-click any property, choose Add Driver, and the Driver editor opens. Choose a Type:

  • Averaged Value: use the variable as is.
  • Scripted Expression: a Python expression, such as var * 2 or sin(frame / 10). Variable names in the expression refer to the driver variables you define (Single Property, Transform Channel, Rotational Difference, Distance).

A classic use: make a corrective shape key turn on when the elbow bends. Driver variable rot reads the bone's X rotation; the expression is rot / radians(90), clamped by the shape key's slider limits. Another: a gear whose rotation is -driver_gear_rotation * 2.

Driver expressions run through a safe subset of Python. Anything beyond simple expressions needs Auto Run Python Scripts (Preferences > Save and Load). Leave it off for files you do not trust, because an untrusted .blend could run code.

Python Stand-in: evaluating a driver expression

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The stand-in uses eval with a restricted namespace. Blender does something similar, but never run eval on text you do not trust.

Where to use which tool

flowchart TD
  Q["What should move?"] --> A["Mesh shape changes"]
  Q --> B["Object follows or points at something"]
  Q --> C["One value controls another"]
  A --> SK["Shape keys"]
  B --> CO["Constraints"]
  C --> DR["Drivers"]

Pick the tool that matches the job.

Combine them: bones deform the body (armatures), shape keys add faces, constraints aim the eyes, and drivers link shape keys to bone rotation.

Common mistakes

  • Adding shape keys before the Basis key, or editing the Basis later.
  • Forgetting Relative to (the key blends relative to the Basis by default).
  • Adding vertices after shape keys exist.
  • Constraints in the wrong order: they apply top to bottom.
  • Circular dependencies (A follows B and B follows A) make Blender mark the driver or constraint red.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What must be created first when using shape keys?

    The Basis key stores the original shape. All other keys are measured relative to it.
  2. 2. Which constraint makes a camera always point at a target?

    Track To rotates the object so one axis points at the target; for cameras use -Z with Up Y.
  3. 3. What does Influence 0.5 on a constraint do?

    Influence mixes the original transform with the constraint's result.
  4. 4. What is a driver?

    Drivers read variables and compute a property's value, so no keyframes are needed.

Summary

  • Shape keys blend stored vertex offsets; build them after modelling and never edit the Basis.
  • Constraints make objects and bones follow, point, copy or stay within limits.
  • Drivers calculate a property from other properties using variables and expressions.
  • Combine bones, shape keys, constraints and drivers for flexible rigs.

Next: Python in Blender: the bpy Module