Shape keys¶
Overview¶
The previous chapter dealt with flipbook animation, which is a general method for animating meshes over time. It does take a bit of work to set up, and in some cases you might just have a single mesh with fixed topology of which only the vertex positions change over time.
For this case Shape keys can be used, either to morph one mesh into another over time, or to blend multiple meshes together into one (static) result. This can be used, for example, to show the time-evolution of an object, or the highlight differences between two meshes. Although this is a fairly specific use case, shape keys aren't too difficult too understand and use, hence we describe them in this section.
There are some limitations, though, to using shape keys:
- The two meshes must have the same number of vertices
- The two meshes should have the same topology (i.e. the way in which the vertices are connected to form polygons). If the topology doesn't match then strange results can occur during morphing between one set of vertices and another.
The above are fairly annoying limitations, but there is currently no easy way around it in Blender.
💻 Poor Bunny¶
- Load
bunny_shape_keys.blend
- This scene contains the Stanford Bunny and a completely flattened version of the Bunny
- Verify that these meshes have the same number of vertices. Also do a visual comparison in wireframe mode (
Z > Wireframe
)
We'll now add some shape keys:
- Select the healthy (non-flattened) Bunny.
- Under
Shape Keys
in the Mesh properties, add a shape key using the+
button. The new shape keys will be calledBasis
. - Add a second shape key. This will be called
Key 1
and have a default influenceValue
of0.000
. - Select the
Key 1
shape key and enter mesh edit mode in the 3D view withTAB
and make sure you're in vertex mode by pressing1
- Select parts of the Bunny mesh and transform them as you like. The changes should be clearly visible.
- Exit mesh edit mode with
TAB
. You should notice that the mesh returns to its normal shape. - Change the influence
Value
ofKey 1
to see what happens to the resulting mesh. You can either click on it and enter a number, or click and drag the value.
Let's add another shape key:
- Add a third shape key, it will be called
Key 2
. - Select
Key 2
and apply a second set of mesh changes in edit mode. Note that when you enter edit mode the mesh changes to the Basis data, and not the Key 1 data. - Once again exit edit mode.
- Play around with the influence values of both
Key ?
shape keys, as well as the checkboxes next to the influence values.
Let's check the difference between relative and absolute shape keys:
- Uncheck the
Relative
checkbox to switch to absolute shape keys. Notice that the influence values have now disappeared. - Change the
Evaluation Time
value to understand how the morphing of the meshes is done now (notice the values right of the shape keys names in the list).
We can use a second mesh to define a shape key:
- Delete shape keys
Key 1
andKey 2
using the-
button and change back to relative shape keys by checking theRelative
checkbox. - Select the flattened mesh and the
Shift-click
the Bunny mesh to add it to the selection and make it the active object. - Open the shape key menu using the downward arrow below the
+
and-
buttons. SelectJoin as Shapes
. - There should now be a new shape key called
flattened mesh
. Note that this shape key is only set on thebunny
mesh, not on theflattened mesh
mesh. You can verify this by selecting either mesh and checking which shape keys they have. - Vary the influence of the shape key called
flattened mesh
to see the Bunny melt. - Delete the
flattened mesh
object in the Outliner. Does the shape key that morphs the Bunny to its melted flat shape still work?
Look closer at the behaviour of the mesh morphing:
- Try to reason why the head of the Bunny is the last part to melt.
- Zoom in a bit to see if you can spot the twisting motion that mesh makes as it melts.
- Switch to edit mode to try to transform the mesh in the melted shape key in such as way as to minimize the twist. Or toy around with other mesh transforms to see what morphs come out.