From BlenderWiki

< Doc:Manual | Animation | Basic | Deformation
Revision as of 13:31, 26 September 2009 by Smerch (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you want to document Blender 2.5 features please edit pages under Doc:2.5/Manual.
If a "2.5" page doesn't exist please copy the text from 2.4x Manual and edit the new page (i.e. you should paste the wikitext from this 2.4x page to this new 2.5x page and then update the latter with 2.5 features)


As previously discussed, there are two kinds of shape keys:

  • Relative shape keys, discussed elsewhere, allow you to define and then blend individual deformations (such as a "wink").
  • Absolute shape keys, discussed here, allow you to morph (only) the entire mesh between one or more target shapes.

Shape Keys (as opposed to Object keys, the position of the whole object center) are the specified positions of vertices within an Object; the actual points that define the mesh. Since this can involve thousands of vertices for an object, separate motion curves are not created for each vertex because it would overload your computer's memory. A more generic keyed position system is used instead; a single IPO Curve is used to determine how interpolation is performed and the times at which a Shape Key can be seen.

Mode: Object Mode / Edit Mode

Panel: Editing Context → Shapes

Hotkey: I

Menu: Object → Insert Keyframe

[edit] What Types of Objects can be Shaped?

You can define Absolute Shape Keys for:

  • Polygonal Meshes,
  • Bezier and Nurbs Curves,
  • Nurbs Surfaces,
  • and Lattices.

All of these objects have vertices. The interface and use for Shape Keys is the same for all of them. In general, you define a Basis key, edit the object to a new shape, leave edit mode and insert a key for each deformation. To animate the shape shift, you then say when (in terms of Frames) you want the object to assume that shape using the Action Editor.

(For simplicity, this topic will usually just use the word "meshes.")

[edit] Creating Absolute Shape Keys

Basis Absolute Shape Key

The first absolute shape key that is created is always the reference or Basis key. This key is the Orange line in the Ipo Window (yellow if selected). Only if this Key is active can the faces and curves, or the number of vertices, be changed.

The subsequent shape keys are defined relative to the first. In other words, they record how a vertex has been moved relative to the Basis key position. (This doesn't affect your workflow, but it's the underlying reason why the Basis key is different from all the others. Subsequent keys are not defined relative to "each other." Rather, all of them are individually defined relative to the Basis key.)

A few notes about the above picture: When working with Shape keys, it is very handy to have an IPO Window open. Use the first Animation Screen layout if you like (CTRL+1). In the IPO Window, we must then specify that we want to see the Shape Keys by selecting that Ipo Type from the Ipo Window header. To do this, use the IPO type Menu Button and select Shape. Go to the 3DWindow and select the object (Suzanne, in this case) and press I. The "Insert Key" menu has several options, the last being Mesh. For other kinds of objects, this menu item will be named for that kind of object e.g. if a curve object is selected, the menu item on the Insert Key menu will be "Curve". The 3D View header menu is also context sensitive, and the menu name will change based on the type of object selected.

As soon as this has been selected, a new panel appears in the Editing panel (F9) in the Shapes panel. It has buttons to Add Shape Keys (what you just did), and a Relative button, enabled by default. To work with Absolute shape keys, disable this button. When it has been turned off (a lighter shade of green), Absolute Keys; an orange horizontal line is drawn in the Ipo Window in Shape display mode. This is the first key and thus the Basis key. The name of this shape key changes in the Ipo Window to "Basis".

Suzanne becomes Vulcan

To add successive shapes, you

  • Go to the frame in the animation where you want that shape to be fully formed
  • Modify the shape (in Edit mode)
  • Leave edit mode
  • Click the Add Shape Key button (or do the I thing again in the 3D View).

For each key you add, blue-colored lines appear in the Ipo Window (cyan when selected). They are placed above one another in a height that is 1/100 of the frame number where they were created, just to space them out (a shape created at frame 50 will appear at 0.5).

Feel free to move the shape-key lines up or down as you wish. Or, re-shape the IPO curve as you wish. Or both. Ultimately, the computer will apply the shape-key information like this:

  • Each shape key (horizontal line...) defines "a target shape." (From the computer's point of view, it does so either directly ("Basis key") or indirectly ("non-Basis key"), but the result is the same. It's a shape.)
  • The horizontal axis is (as usual), a frame-number...
  • So, at this point, the IPO curve is either "exactly on top of" a shape-key (horizontal) line, or, more likely, "somewhere in-between" exactly two of them.
  • The ratio between the two vertical distances, between "this point on the IPO curve" and (only) the shape-key lines directly above and directly below it, determines the shape-change now in effect. (For instance, if the point is exactly halfway between the two lines, their influences will be exactly equal.)
ShapeKey creation
Creating Shape Keys in Blender is very simple, but the fact that the system is very sensitive in terms of its configuration can cause a number of 'invisible' things to happen. The following rule must therefore be taken into consideration. As soon as a Shape Key position is inserted it is immediately active. All subsequent changes in the Mesh are linked to this Key position. It is therefore important that the Key position be added before editing begins.


VertexKeys can be selected in the IPO Window or in the Shapes panel using the <> buttons. We always do this out of Edit Mode: the 'contents' of the VertexKey are now temporarily displayed in the Mesh. We can edit the specified Key by starting Editmode.

As you render your animation over the frame range, the shape changes from one to the other. You can verify this by scrubbing over the frame range using the Timeline window or by wearing out your arrow keys.

[edit] Sharing Shape Keys

Shape Keys are part of the Mesh data, not of the Object. When cloning an object, by making both objects use the same Mesh (Editing buttons, Links and Materials panel), the associated Shape Keys are also copied. Thus, it is possible to permit multiple Objects to share the same Shape Keys in Blender by making them use the same Mesh.

[edit] Workflow for Creating Absolute Shape Keys

Once the shapes are defined, there are three methods for working with Shape Keys:

The 'performance animation' method.

  • This method works entirely in EditMode, chronologically from position to position:
  • Insert Key. The reference is specified.
  • A few frames further: Insert Key. Edit the Mesh for the second position.
  • A few frames further: Insert Key. Edit the Mesh for the third position.
  • Continue the above process...

The 'editing' method.

  • We first insert all of the required Keys, unless we have already created the Keys using the method described above.
  • Blender is not in EditMode.
  • Select a Key. Now start EditMode, change the Mesh and leave EditMode.
  • Select a Key. Start EditMode, change the Mesh and leave EditMode.
  • Continue the above process....

The 'insert' method

  • Whether or not there are already Keys and whether or not we are in EditMode does not matter in this method.
  • Go to the frame in which the new Key must be inserted.
  • Insert Key.
  • Go to a new frame, Insert Key.
  • Continue the above process...

While in EditMode, the Keys cannot be switched. If you attempt to do so, a warning appears.

[edit] Shifting between Shapes

Now that you have your different shapes defined, you now want your mesh to shift between them at certain times in your animation. As you might have guess by now, there are a few ways to do it. I call them the line way, and the control way.

In the line way, in your Ipo Window, LMB File:Template-LMB.png click on a Shape Key; its name will turn white. Alternatively, scroll to the shape in the Shapes panel (its name won't turn white in the Ipo Window, but the box next to its name will shift to it, letting you know it is active). In the Ipo window workspace, Grab and move your mouse up or down, and drop the blue line at the frame you want.

The Y-axis values range from 0.0 (0%) to 1.0 (100%), and this placement by itself represents "percent of the total time." If you are using "the line way" and simply want a linear transition between the keys, this is all that you have to do.

In the control way, you define an Ipo curve which is a sort of Time (or Speed) curve for the mesh. This curve is linked to the "Basis" channel (or key) – you can define a curve for any key, but only the basis one is useful (the others have no effect). This curve maps the current frame (x axis) to a 'virtual' frame (a position in the sequence defined by the absolute shape keys) on the y axis.

Here's how it works: where the Ipo crosses a blue line, the corresponding key has its maximum effect and the adjacent keys have none. When the Ipo value is in between two keys (in between two lines), the mesh is deformed by the interpolation of (only) these two keys: the one "above" it and the one "below." The closer the value to a line, the higher the influence of the corresponding key, and therefore, the lesser the influence of the "other" one.

As usual, when the IPO curve has a positive slope (a "climbing" one), the animation is the same as without any curve (it might just be faster/slower, and/or have a time offset). If you give your curve a negative slope, the animation will run backwards. If you make it go up-down, the animation will go forward and backward.

So here's the effective difference between "the line way" and "the control way": "the line way" implicitly uses an Ipo that's just a linear, upward sloping, 45-degree diagonal line.

Using Control Points to Time the Shape Shift

In the example above, without any control, Suzanne would shape shift to a vulcan between frames 50 and 100 (yellow line at 0.5, blue line at 1.0). However, we selected the Basis key and added some control points (evidenced by the orange selector block). There are three control points, the important ones being at frame 80 with a value of 0, and at frame 120 with a value equal to the Vulcan key. The cursor (green line) is at frame 100. Normally, Suzanne would be a Vulcan by now, but because of the control points, she has only just started, and won't become a fully formed Vulcan until frame 120. (Because the shape between the two points is slightly curved, you'll see a bit of "ease-in ease-out" going on, too.)

To repeat: at any point in time, the IPO curve is always (by definition) "somewhere in-between" exactly two horizontal lines (key shapes). The closer the point is to one of the two lines, the more the shape of the (always: "entire") mesh is being influenced by the key shape defined by that line, and the correspondingly less it is being influenced by the other one.

[edit] Options

As with all IPO curves, you can define how the curve is drawn:

  • Linear: interpolation between the Keys is linear. The Key line is displayed as a dotted line.
  • Cardinal: interpolation between the Keys is fluid, the standard setting.
  • BSpline: interpolation between the Keys is extra fluid and includes four Keys in the interpolation calculation. The positions are no longer displayed precisely, however. The Key line is drawn as a dashed line.

[edit] Hints

  • Key positions are always added with I in the 3D View or Materials buttons, even if they are located at the same position. Use this to copy positions when inserting. Two key lines at the same position can also be used to change the effect of the interpolation.
  • If no Keys are selected, EditMode can be invoked as usual. However, when you leave EditMode, all changes are undone. So if you are frustrated because you edited your mesh and all your changes went away, remember you read this and you will remember why. Insert the Key in EditMode in this case to change the active key.
  • For Keys, there is no difference between selected and active. It is therefore not possible to select multiple Keys.
  • When working with Keys with differing numbers of vertices, the faces can become disordered. There are no tools that can be used to specify precise sequence of vertices. This option is actually suitable only for Meshes that have only vertices such as Halos.
  • If no IPO curves are defined on any of the absolute Shape Keys, the length of the animation defaults to 100 frames. That is, shape keys added past frame 100 will have no effect. An IPO curve must be defined on at least the Basis key for absolute shape key animations to exceed 100 frames.

[edit] Curve and Surface Keys

As mentioned earlier, Curve and Surface Keys work exactly the same way as Mesh Keys. For Curves, it is particularly interesting to place Curve Keys in the bevel object. Use the animation of that curve to, for example, animate a pumping artery, or a pulsing heart, or a growing worm, or balloon being inflated, or a tree growing. A scene in Elephant's Dream, where worms started growing (just before Proog conks Emo) used animated bevels and tapers while the curves extended.