How to Drive Shape Keys with Object Rotation in Blender
Driving a shape key with an object's rotation in Blender allows you to automate mesh deformations—such as muscle flexes or joint corrections—based on how a control object or bone rotates. This guide provides a direct, step-by-step walkthrough for adding a driver to a shape key, target-configuring the driving object's rotation axis, and adjusting the driver math for precise animation control.
Step 1: Create the Shape Key
- Select your mesh object and navigate to the Object Data Properties tab (the green triangle icon).
- Expand the Shape Keys panel.
- Click the + button once to create the Basis key (the default mesh shape).
- Click the + button a second time to create a new
shape key (e.g.,
Key 1). - Select
Key 1, enter Edit Mode, modify your mesh to the desired deformed shape, and return to Object Mode.
Step 2: Add a Driver to the Shape Key Value
- In the Shape Keys panel, hover over the
Value slider of your newly created shape key (which
defaults to
0.000). - Right-click the Value slider and select Add Driver. A pop-up driver configuration window will appear.
Step 3: Configure the Target and Rotation Axis
- In the driver pop-up panel, set the Type to Scripted Expression.
- Locate the variable setting (default name is usually
var). - Set the input type dropdown from Property to Transform Channel.
- In the Object field, select the object or armature
driving the shape key.
- If using an armature, an extra field will appear allowing you to select the specific Bone.
- Change the Type dropdown to the rotation axis you want to track (e.g., X Rotation, Y Rotation, or Z Rotation).
- Change Space to Local Space. This ensures only the relative rotation of the object/bone triggers the shape key, ignoring world position changes.
Step 4: Adjust the Driver Expression for Radians
Blender measures rotation in radians rather than degrees (1 radian is approximately 57.3 degrees, and 90 degrees equals roughly 1.57 radians).
- In the Expression field, the default is
var. - If your shape key reaches full deformation (1.0) too slowly or
quickly, modify the math expression:
- To make the shape key reach 1.0 at 90 degrees of rotation, set the
expression to:
var / 1.57 - To invert the rotation direction, use a negative multiplier:
-varor-var / 1.57
- To make the shape key reach 1.0 at 90 degrees of rotation, set the
expression to:
- Hover off the panel or press Update Dependencies to apply the expression.
Step 5: Test the Setup
Select your control object or bone and rotate it along the chosen
axis in Pose Mode or Object Mode. The
shape key's value slider will automatically move between
0.000 and 1.000 corresponding to the object's
rotation.