From BlenderWiki

Jump to: navigation, search

Animating Shape Keys

Even though the animation of relative and absolute shape keys is quite different, there are a few things worth to be noted, valid for both types:

  • As nearly every animation in Blender, it is based on Ipo curves.
  • As the Shape Ipo datablock can become an action, you can also use actions and the NLA editor to animate your shapes.
  • And obviously, you can use all indirect techniques affecting/controlling Ipo curves, like e.g. Ipo drivers – for example, to animate the muscles of your character automatically from its armature’s bones…

Relative Shape Keys

Mode: Object mode

Panel: Shapes (Editing context, F9), and the Ipo Curve Editor window

The key idea behind relative shape keys animation is the influence of each key, which simply defines to what extent a key affects the resulting shape. This implies that several shape keys can affect an object at the same time (unlike with absolute keys).

The Basis key defines the (default) “rest” state, when all other keys have a null influence. This is the only key which is not animatable.

All other keys have an influence value – the standard range is [0.0, 1.0] (from null to full influence), but you can have higher or lower values, giving “over-deformed” or “reversed-deformed” results. This influence is animatable through an Ipo curve, one for each key (except the Basis one…).

To create/edit these Ipo curves, you can:

The first methods are “trivial” (i.e. they work exactly as with any other type of animation), let’s see the third. It is in fact very similar to the one available with constraints: in the Shapes panel, you have a slider and two numeric fields (Min and Max). As usual, they concern the active shape only. By modifying the slider value, you add a key to the corresponding “influence” Ipo curve (or edit the already existing one), at the current frame. The Min and Max numeric fields control the boundary values available through the slider (by default, [0.0, 1.0]) – they do not prevent the Ipo curve to take higher/lower values!

Exclamation mark.png
Note that:
  • It seems that Blender automatically detects vertices that do not change at all between a shape key and its basis, and always gives them a null influence (i.e. they will never affect the resulting shape). For simple cases, this avoid you the need of defining and using the “blending” vertex groups (see also the next page’s example).
  • You can control which vertices are affected (and to what extent) by a given shape key, using vertex groups (see the previous page).
  • For a given key, you can chose a different basis shape than the default Basis one (again, see the previous page). The vertex group influence control might be most useful in this case!

Absolute Shape Keys

Mode: Object mode

Panel: Ipo Curve Editor window

There are two ways to animate absolute shape keys (which, let’s repeat it, always affect the whole object), a default, very simple but limited one that you might called “linear way”, and the more powerful “Ipo curve” one.

Whatever method you choose, you’ll mostly work in the Ipo Curve Editor window. Indeed, this is with absolute shape keys that the horizontal lines materializing the shapes in this window have an important effect: their Y value represents when they are fully affecting their object (remember that with absolute keys, the animation is a smooth succession of the shapes).

The Key Y setting for absolute shape keys, in the Transform Properties panel of the Ipo Curve Editor.

The Y value of the shape key lines is set from the current frame when it was created (i.e. if created at frame 50, its line will have an Y value of 0.5). It is editable in the Ipo Curve Editor window, either by grabbing (G) the selected one, or by setting it in the Transform Properties panel (N), Key Y numeric field (at the bottom).

Remember that you can have a sort of “twisted blend” between your shapes using the Slurph setting.

Linear Way

Without any Ipo curve, you get a default linear animation from frame 1 to frame 100, blending through all shapes which lines have an Y value between 0.0 (frame 0) and 1.0 (frame 100). So for example, a shape key at Y=0.33 will be fully active at frame 33, another one at Y=0.75 will be fully active at frame 75, etc.

This implies that the the animation cannot start before frame 0 (which is not a big problem…), and cannot end after frame 100. That is, shape key lines “laying” past frame 100 (i.e. having an Y value higher than 1.0) will have no effect. If you want more, you must use the Ipo curve method described below!

Note that two key lines at (nearly) the same Y value can be used to change the effect of the interpolation (to create a gap, a discontinuity…).

Ipo Curve Way

This is a much more powerful and flexible method. By adding an Ipo curve to the Basis channel, you can control the speed of the blending between your shapes, but also go forth and back, create abrupt transitions, etc. And of course, have shape animation starting and ending when you want!

The Ipo curve now controls which shapes (at most two) are affecting the object at a given frame, simply by seeking between which key lines it is. So if at frame 50 it is between Key 1 and Key 2, the resulting shape will be a blending of these two keys (their respective influence is determined by the proximity of the curve: if it is near Key 1’s line, this one will be preeminent, etc.). Of course, when the Ipo curve crosses a shape key line, this one takes full effect!

So the Y value of the shape key lines defines no more their “full effect” frame. They are only meaningful relative to the Basis Ipo curve, and the most important thing is their order (even though it is possible, with “vertical” parts of Ipo curve, to have transitions between non-contiguous shapes, you cannot have smooth blending between them!). Hence, a good habit is to have all your absolute shape key lines evenly spaced out (it will be easier to control speed variations with the Ipo curve only).

Conclusion

So now you understand why you can safely switch between relative and absolute shape keys: the first ones use an Ipo curve per key, except for the Basis one, while the later ones use at most one Ipo curve, the Basis one. Their animations will never mess together!