From BlenderWiki

Jump to: navigation, search
User Manual: Contents | Guidelines | Blender Version 2.43

Shape keys store different shapes of the same mesh. In other 3d applications they are called 'morph targets' or 'blend shapes' or even 'vertex keys' in older versions of Blender.

Blender offers both relative shape keys and absolute shape keys. Relative shape keys, discussed on this page, record each shapes difference (a.k.a. "delta") relative to a base shape. Absolute shape keys record directly each different shape.

Mode: Object Mode

Panel: Editing Context → Shapes

Description

An Example of Mixed Shape Keys
An Example of Mixed Shape Keys

Relative Shape keys can be blended on a percent basis with other shape keys to achieve the desired effect. Take for example a face. The user may model a face with a neutral expression and have shape keys for a smile and a frown. These shape keys could then be combined in the Action Editor and your talking face could have some serious emotional problems.

Use shape keys for animating faces or when you want the shape of any mesh to be able to change over time; for example, a ball squishing, or a soda can being crushed. When animating faces, suggested shape keys are:

  • Mouth forming each sound shape
  • Lips forming a smile and frown
  • Eyes: Blinking, showing basic emotions, and even winking.


Note that a shape key does not say how fast the shapes are transitioned or in what order; you can make these keys in any order or speed you wish. Later, you will add Ipo keys that say exactly when the mesh takes shape.

Workflow

The overall process for using shape keys in Blender is:

  1. . Define your basis shape.
  2. . Identify the list of primitive morphs that you might want
  3. . Create Vertex Groups for sets of vertices to participate in each morph family
  4. . Define your target shape(s), one for each morph
  5. . Using the IPO curves, define when you want the target shape to influence the basis shape.

Target shapes can be created at any frame; they are time-independent. They exert their influence according to the shape IPO curve. Each target shape has a channel in the IPO window. When a target shape's IPO curve is at 0.0 y value, it does not deform the mesh. As its influence increases, it deforms the mesh at that frame. Since the IPO channel is a transition (a smooth curve or a linear line or whatever options you choose for the IPO curve) you can control how fast the mesh morphs to the new shape.

Multiple shapes can simultaneously morph the basis mesh, each of them exerting their influence through their IPO curve, since each of them have their own channel.

If you want to change the basis shape, you will have to create a new shape, and using a script, copy the shape keys over to the new shape, adjusting them as you desire.

A morph family is a group of shapes related to an area of the mesh. For example, take the face. You have the eyebrow area (possible shapes are Surprise, Furrow, eyebrow lift-left, and eyebrow lift right), the eyelids (Blink), the mouth (smile, frown), nose (flare, wiggle) and tongue (ay, th, i, stickout, tunnel). The jaw open action may be controlled by a bone. In this case you would a vertex group for the eyebrow, another for the tongue, etc.

Creating Relative Shape Keys

Mode: Object Mode with Mesh, Curve or Lattice object selected

Panel: Editing Context → Shapes

Hotkey: I

Menu: Object → Insert Keyframe


Shape keys are all stored relative to a basis mesh. You can enable shape keys and insert the basis key by selecting the mesh object and pressing the I then choosing Mesh. Alternately, this step can be done with the Add Shape Key button in the Shapes panel. This panel is located as the second tab in the Editing F9 buttons in the Buttons window. In this panel, be sure that the Relative button is enabled.

The original shape key is shown in the Ipo Window, (Ipo Type: Shape), for relative keys as an ellipses just under the pushpin. The original absolute shape key is named "Basis". This difference alerts you to whether you are working with Relative or Absolute shape keys.

Once the basis shape key has been created, you can create additional shape keys in the same way. With the mesh selected, and in its deformed state, either press I and then choosing Mesh, or click the Add Shape Key button in the Shapes panel. A new Shape Key will be created. If this is the first shape created after the basis shape, it will be called Key 1. Shift LMB Image:Template-LMB.png into the name field in the panel to change the name to something meaningful.

An important thing to remember is that when creating a new shape, the new shape will be based off the current selected shape WHEN YOU LEAVE EDIT MODE. When creating shapes from the basis shape, the new shape will be a copy of that shape, if the user creates a new shape while another altered shape is selected, the new shape will be a copy of that altered shape. This allows you to further edit selected shapes; simply leave edit mode to lock in that shape.

Fun Fact: Old school Blender users sometimes refer to shape keys as Relative Vertex keys, or RVKs for short.

Editing Shape Keys

Mode: Object Mode

Panel: Editing Context → Shapes


Various aspects of each shape key can be edited by activating it in the Shapes panel.

Location of the Shape Key selection tools in the Shapes panel
Location of the Shape Key selection tools in the Shapes panel
Arrows and the Menu
Choose the active shape key. The arrow buttons cycle through shapes, and the menu allows you to choose a specific shape directly. Note that when you first choose a key, it is visualized at full strength in the 3D View regardless of any key frames that have been set, so you can see exactly what shape you're activating. Changing the current frame will reset the 3D View to show the results of the shape key blending again.
Once the desired key is selected, the shape can be altered by entering editmode Tab and manipulating the vertices. Note: Adding or deleting a vertex once shape keys have been added is very tricky. The changes are propagated to the other shapes based on their position in the current shape, this can have drastic effects on other shapes.
Current Shape Key Name (text field)
Rename a shape key from its automatic name by Shift LMB Image:Template-LMB.png in the name field and typing in a new name to change it. It's very important to keep your shapes organized and well named, so you can remember which one you're editing in the Action or Ipo editor. It's very easy to end up with a huge amount of shape keys when you start animating faces and you don't want to get your work confused.
Propagating Changes to other Shapes
If you find an error in your basis shape after you have started defining other shapes, you can make your changes and, with those vertices selected, use the specials menu W -> Propagate to All Shapes" in Edit mode. Those vertex positions will replace the corresponding vertex positions in the other Shape keys.
Propagating Changes from another Shape
If you find an error in your basis or other shape after you have started defining other shapes, with those vertices selected, use the specials menu W -> Blend from Shape and choose which shape key to use as a reference for repositioning the vertex. You can then even choose to what extent to apply that reference point to the existing vertex location. Think of it as a way to average the position of vertices between shapes.

Propogating Basis Changes

After you have created shape keys off the basis mesh, you may discover a need to tweak the basis mesh. Unfortunately, every shape key works of the old basis shape, and when you exert their influence, the basis verts will move back into their old place.

One way to solve this problem is to create a vertex group, and limit the shape key to act only on those vertices in the vertex group. You do this by entering the name of the vertex group into the VGroup field on the panel for that shape. So, if you shape key taht affected they eyes (by making the model Blink) and you wanted the model to have fatter lips, create a vertex group called "Eyes" and restrict the Blink shape to work only on the eyelid verts.

The other way is to create a NewBasis shape which has the changes, and run [this script] to propogate the differences between the Basis shape and the NewBasis shape to all the other shapes for that mesh.

The laborious way is go repetitively go through each shape and adjust the vert(s) to the new position.

Pinning

Location of the Pin Icon in the Shapes panel
Location of the Pin Icon in the Shapes panel
When a mesh object does not have a pinned key, it can show multiple keys at once. To prevent this, click on the pin icon.
The current mesh object is now locked at that shape key, and will only show that key. This feature is useful when multiple keys are affecting a mesh object and you would like to see the effect of one specific key.

One other use for pinning is to create a shape gallery.

Since Blender allows for the creation of Linked Duplicates which share underlying data (e.g. mesh and shape key data) multiple copies of a mesh can be created using Alt D.

Once a duplicate has been created, move the duplicate to a different area of the screen. Pin the duplicate to a shape key by clicking the pin icon in the Shapes panel. Finally, reselect the 'original' mesh. If this is done for each key, a shape gallery emerges (which also helps in editing keys).

Hints

Pinning Shape Keys can also help to speed up interaction with a mesh (especially when animating it with armatures). If a shape is pinned, Blender doesn't have to calculate the myriad interactions and blends of different keys in real time, which speeds up operation. This is particularly useful when using armature-driven shape keys to correct deformations, since it's usually not something critical that you need to see when animating. Remember to un-pin the shapes when you're done and ready to render though!

Blending Shape Keys

Mode: Object Mode

Panel: Editing Context → Shapes


Shape Keys can be mixed in several different ways. These methods have the same net effect of creating IPO data, but are different in interface.

Blending Using the Shapes Panel

Shape Panel and Shape Keys
Shape Panel and Shape Keys

In the Shapes panel when a key is not pinned, it has an additional row of buttons; value, min and max.

Key Value (slider)
Current value of that key at the current frame. Adjusting this slider will insert or adjust a control point in the shape key control curve at the current frame. If I put my "blink" shape key at 50% instead of 100%, I'll have half-open eyes.
Min and Max
Adjusts the boundary values for the value slider both in the Shapes panel and the Action Editor Window. It is possible to use a maximum greater than 1.0, to push shapes to even greater extremes, but be careful, since you are exaggerating the shape key, and this can mesh up your mesh.
It is often easiest to to mix your shape keys in the Action Editor instead of doing it from the main editing panel.

Blending Using the Action Editor

Action Editor and Shape Keys
Action Editor and Shape Keys

In the Action Editor, expand the Sliders button and use the sliders to adjust the key values at the current frame. The min / max values set in the Shapes panel are reflected in the Action Editor window sliders for that shape.

If there is not already a keyframe at the current frame (indicated by the green line), a new keyframe will be added.

Blending Using the Ipo Curve Editor

The Ipo Curves show the underlying data that is being controlled by the other mixing methods. It is in this window where the values are mapped to frames for each shape key. In order to access the Shape key Ipos, select Shape from the Ipo type popup menu in the Ipo Curve Editor Window header. Each shape key will be shown in the Ipo list on the right side and can be altered in the same manner as any Ipo curve in Blender. See the Ipo Curves and Ipo Keys section for more information.

The vertical order of the Vertex Keys (the blue lines) from bottom to top determines its corresponding Ipo Curve, i.e. the lowest blue key line will be controlled by the Key1 curve, the second lowest will be controlled by the Key2 curve, and so on. No Ipo is present for the reference mesh since that is the mesh which is used if all other Keys have an Ipo of value 0 at the given frame.

The Ipo Curve of Key 1 shows a mesh undeformed up to frame 10, then from frame 10 to frame 20 Key 1 will begin to affect the deformation. From frame 20 to frame 40 Key 1 will completely overcame the reference mesh (IPO value is 1). The effect will fade out from frame 40 to frame 50.

Keys in the IPO Window
Keys in the IPO Window
The IPO curve of Key 1
The IPO curve of Key 1

Using IPO Drivers

See the Advanced Driven Shape Keys page for information regarding how to set up an IPO Driver.

Previous: Manual/Animation/Deformations Contents Next: Manual/Absolute_Shape_Keys