Shape keys store vertex positions relative to their original positions in the mesh.. Moving the sliders causes the vertices to change from their positions in the original mesh shape and
Trang 1Adding Bones to Assist Deformation
Figure RST.63: The head bone in Edit mode, showing envelopes
With this armature, there is no way to have the head bone's envelope be broad enough to deform the entire head without dipping into areas like the shoulder and chest that have no business being affected by the head bone What to do?
There are several ways to approach it, but the easiest is to add a new bone as a child of the head bone to assist with the deformation
Trang 2Figure RST.64: A new bone to help with head deformation Notice how the envelopes of the original and new head bones completely cover the head now
To get this configuration, we Shift-D duplicated the head bone, then positioned the new bone's root and tip so it fell perpendicular to the original After that, the overall envelope size was altered with Alt-S until it appeared to fill in the gaps the original bone had left Of course, this new bone must be made the offset child of the original head bone or things will go very badly once you begin to animate
Then, we returned to pose mode and tested it by moving the neck and head In fact, our first attempt when creating this exercise didn't quite cover the area correctly, and an additional adjustment had to be made to the envelope size
Weight Painting and Vertex G roups
Trang 3The last way of adjusting mesh deformation that we'll talk about is called Weight Painting Behind the scenes, it involves the creation and use of vertex groups, but the 3D view interface elements let you work rather intuitively
Figure RST.65: A bad deformation in the chest
In this illustration, Hank's back has been bent backward, showing off a poor deformation in the chest You could add another bone that was linked to the spine to fix it, but there is
another way
To weight paint your way out of a mess like this, select the mesh object, and on the 3D header choose "Weight Paint" mode On the mesh's Modifiers panel, enable the "Vert Groups" button in the Armature modifier
Trang 4be influenced by the currently selected bone In terms of color, dark blue means that the mesh
is not influenced by the bone at all, through teal, green, yellow, orange and red, at which point the mesh is influenced by the bone's transformations at 100% strength
Trang 5Figure RST.68: The weight paint panel on the Edit buttons
You can choose to what maximum weight you would like to paint in this panel with the
"Weight" control, and how much of that maximum value will be painted with each stroke with the "Opacity" control An opacity of 1.0 will paint the full value of the Weight control with every pass of the mouse
Trang 6Figure RST.69: A few mouse clicks on the chest and sternum later
By painting a few strokes on the poorly deforming area with Weight 1.0 and Opacity 25, this deformation was achieved A definite improvement Serious animators will use this technique
to finely tune their deformations for nearly each and every bone in their characters
W rapping Up
When you have envelopes and weight painting set so that each controller can move,
deforming the portions of the mesh you desire while leaving other parts alone, then you are done Move any deformation helper bones you created to a hidden bone layer so they are out
of the way If you need to revisit your envelope settings or weight painting, though, don't forget they're there!
If you have already worked with Chapter 6, we encourage you to try it again with the rig you just created It's different than the rig provided with Hank in the previous chapter, and you can learn from the differences in how your rig responds to the same set of instructions
Trang 7Chapter 8: Shape Keys: Tools
By Andy Dolphin
You already know that in Blender you can animate the way that objects move around the 3D world Blender also gives you the ability to have your mesh objects change their shape over time These changes, called deformations, are saved in "shape keys" Examples of where you might use shape keys include morphing from one character or shape to another, or adding subtle variations
to a shape to add interest to an animation, like having a creature's chest rise and fall to show breathing One very popular use of shape keys (sometimes called "morph targets") is for
character facial expressions and lip-syncing Shape keys are not restricted to animation however
If you have a model you wish to use in a series of still images, shape keys can be a convenient way of saving shape variations that will be used more than once
Figure 8.2.1: Various facial expressions created only with shape keys
Shape keys store vertex positions relative to their original positions in the mesh After the shape key is stored, the deformation can be controlled by influence sliders Moving the sliders causes the vertices to change from their positions in the original mesh shape and move toward the
positions saved in the selected shape key
Multiple shape keys can also be combined to vary the final shape of the mesh The original shape
of the mesh is saved as a basis shape key It is always available and can be returned to at any stage, no matter how many shape keys have been made from it As shape keys are non-
destructive, you can try out various ideas on changing or improving a model, and if you find you don't like them, you can delete or ignore them, returning to the basis shape Keep in mind that shape keys do not allow you to change the structure of the mesh, only the positions of the vertices which make up the mesh You cannot add or delete vertices when using shape keys
Making Shape Keys
Before you begin
Before working on your shape keys, be sure that you are happy that your basic model is finished
Trang 8One important point to remember when working with shape keys is that since they store relative vertex positions, the mesh should be in a finished state before applying them While some editing
is possible after shape keys have been saved, it can lead to unpredictable results and may make some of the shape keys useless, in which case you'll need to recreate those shape keys from scratch
It is common practice to build organic models, like humans and animals, using a mirror modifier
so only one half has to be modeled while Blender automatically creates the other half If you've used a mirror modifier while modeling, make sure to "Apply" it (join the two halves) before proceeding with shape keys, as applying mirror modifiers later will result in the loss of all shape keys
Shape key controls are found in the Shapes tab of the Editing Buttons (F9) Shape keys are added
to a mesh in Object mode Then, the shapes are made and edited in Edit mode
Figure 8.2.2: The Shapes tab before any shape keys are saved
If no shape keys have previously been stored for a selected mesh object, the Shapes panel will show a single button with the label "Add Shape Key." When this button is pressed, the panel changes to show a button labeled "Relative," which is active by default, and a drop-down menu with the word "Basis" showing in the text field This shows you that Blender has stored the current state of the mesh as the Basis shape key The Basis shape key is essentially the original un-deformed mesh, and all future shape keys for this mesh will be stored relative to this shape key
Trang 9Figure 8.2.3: The Shapes tab with basis shape key saved
Pressing the "Add Shape Key" Button again results in a new shape key labeled "Key 1" being added to the drop-down menu The key name can, and usually should, be changed to something that will indicate what this shape key represents For example, when making mouth shapes for lip-sync, the shape keys should be given names that indicate the sound or letter each key
represents If you fail to do this, a lot of time will be wasted when you go to actually use the shapes in an animation You can edit the name of each shape key by selecting it from the shapes panel menu, then typing a new name into the text field
Figure 8.2.4: The Shapes tab after the first shape key is saved
Trang 10When the first new shape key is added, you will see a key value slider, a "Min" and "Max"
adjuster and a text box labeled "VGroup:" in the Shapes panel These give you additional control over the shape key, which will be explained in a bit
A list of shape keys with sliders also appears in the Action Editor window (Action window), if one is open When animating with shape keys, it is usually better to do so in the Action Editor as multiple shape keys can be easily accessed without scrolling through a menu, and markers are placed to indicate key frames for each shape key
Figure 8.2.5: The Action Editor window showing a list of shape keys
Once a shape key has been created, a unique target shape can be made by tabbing into Edit mode Selected vertices, edges or faces can be moved, scaled or rotated to create a new shape
Remember that vertices, edges and faces should not be added or deleted when making shape keys After the mesh has been modified into the desired shape, it can be stored by exiting Edit mode Each time the "Add Shape Key" button is pressed, a new shape key is created, ready to store a new shape
Shape keys can be selected from the drop down menu next to the shape key names or by scrolling through all keys using the "Previous Shape Key" and "Next Shape Key" buttons
Using One Shape Key as the Basis For a New One
New shape keys are based on the currently selected shape key at the time the "Add Shape Key" button is pressed So, if the Basis key is selected, the new shape key will be a copy of the Basis key, ready for editing Sometimes it is useful to have two or more keys that are similar to each other In this case, an existing shape key should be selected before pressing "Add Shape Key" Then, when entering Edit mode, the mesh will already be deformed to the same state as the
previous shape key From here, minor or major adjustments can be made to the mesh to create the new shape key This can save quite a lot of time when creating similar shape keys in complex models, as the majority of the adjustments would only need to be done once Subsequent shapes could be based on the first adjustment
Trang 11Editing Shape Keys
As shape keys store positions of vertices relative to the base mesh, it is quite simple to change them, even after they have been used in an animation In fact, it can sometimes be useful to begin animating and using the shape keys to determine if they need to be tweaked for best results To edit a shape key, select it from the shape key drop down menu, then tab into Edit mode Adjust the mesh as desired and save it by tabbing back into Object mode
One problem that may arise after saving shape keys is coming to the realization that your original shape isn't quite the way you'd like it to be You may, for example, decide that your character's ears are too small Simply making them bigger won't deliver the desired result as the smaller ears have already been saved in all existing shape keys and the changes you make will only affect the currently selected shape key
A very useful feature of Blender shape keys is the ability to change the mesh in one shape key and have that change affect all existing shape keys Such changes would usually best be done with the base mesh (the Basis key), as this is the un-deformed mesh and any changes will
probably be more predictable So, if you decide the basic shape needs some adjustment, select Basis from the shape key menu and fix the mesh in Edit mode Then, with all edited vertices still selected, press W-key and choose "Propagate To All Shapes" Return to object mode and
examine the remaining shapes to make sure that everything happened as you expected
Remember that you cannot add or delete vertices, edges or faces when you do this You can only move, rotate or scale existing ones
Trang 12Figure 8.2.11: A mesh in Edit mode, showing "Propagate to all shapes."
It is also possible to adjust selected vertices of one shape key by applying vertex offsets from another shape key Select a shape key from the menu and enter Edit mode Select some or all vertices and press W-key Choose "Blend From Shape" A menu pops up with a list of other shape keys to copy from Select one, then move the mouse slowly in order to see and control the adjustment Pressing MMB will apply the adjustment at 100% This feature would prove useful if you wanted your character to have larger ears in some of your existing shape keys, but not all of them It is certainly quicker and easier than editing the ears in each shape key individually
Trang 13Figure 8.2.12: A mesh in Edit mode, showing "Blend to Shape" selected
If you've already commenced animating, it is important to note that the effect of editing the shape keys or the base mesh will apply immediately to any animation you have already keyed Be sure
to tweak carefully and check the animated results regularly You may find you'll need to adjust some sliders or edit some key frames to achieve a better result after you've made changes to your shape keys
Deleting Shape Keys
You can select a shape key from the drop down menu and press the "X" button to delete it When
a shape key is deleted, its influence in an animation is completely removed
Using Shape Keys
When a shape key is created, the key value slider associated with it will show a default value of 0.0 This means that new shape keys have no influence on a mesh, leaving the mesh un-
Trang 14deformed If the key value slider is moved forward and released, the mesh will deform The amount of deformation is relative to the slider value (0.0=0%; 1.0=100%) Note that the slider is not interactive, and the mesh is not updated in the 3D view until the slider is released Also note that the vertices move in a linear fashion That is, they move in a straight line from the basis position toward the position stored in the shape key This linear displacement is important to recognize and understand, as it is one of the main differences between shape key animation and animation using armatures If you need your mesh to move in a curved motion, such as an eyelid sliding over the surface of a rounded eyeball, shape keys may not be the best option
The "Min" and "Max" settings next to the key value slider allow you to push vertices past the values saved in the shape key or to move them in the opposite direction, relative to the basis mesh Pushing a shape to extremes by setting the Max value greater than 1.0 and pushing the influence slider up can sometimes be useful, but it can also deliver unexpected results
The "Min" setting can be made negative, giving the reverse of the shape key If a group of
vertices was moved to the left in the stored shape key, setting "Min" to a negative value and pushing the influence slider below 0.0 would cause those vertices to move to the right While this can be an apparently easy way of turning a smile into a frown, for example, it must be
approached with caution and is usually best for subtle effects Values can be negative or positive but the Max value must always be greater than the Min value
Figure 8.2.6: A single Shape key applied to a sphere with its slider set to 1.0 and -1.0
The Pin icon in the Shapes panel can be used to view the effects of a single shape key on a mesh,
or an entire set of shape keys at the same time on multiple instances of a mesh Linked duplicates
of the mesh, created by pressing Alt-D on selected objects in Object mode, can be placed side with each one displaying a different shape key at full key value A gallery of shape keys can
side-by-be created using this method This can side-by-be a useful way of comparing different experimental shapes and to choose a preferred shape
Trang 15To use shape Pinning, simply find the shape you want to display from the shapes drop down and click the pin icon Until the pin icon is turned off, the object will display with that shape,
regardless of other keys that might have been set
Figure 8.2.7: Linked duplicates of the same mesh, each showing a different pinned Shape key
A More Advanced Trick
The influence of a shape key can also be limited to a selected vertex group using the VGroup option, and the result can be further controlled through vertex weight painting Using this feature,
it is possible to create one shape key which contains complex deformations all over a mesh, and then use the shape key in conjunction with different vertex groups to create a whole series of new shape keys, each affecting only a small portion of the mesh For example, it may be simpler to create an angry face shape key all at once, but you may want access to different components of that shape individually: knotted brow, squinting eyes and snarling lips It often gives better
results to model adjustments all at once, and then to create separate shape keys using vertex groups than it is create several separate shape keys from scratch
Note: For more information about vertex groups, refer to Chapter 4
To do this, create an overall shape key, then create and assign several vertex groups to the mesh, one for each section that would benefit from having a separate shape key In the VGroup text box
of the shape key, enter the name of one of the vertex groups The shape key is now restricted to only affecting those vertices contained in the group Press the Add Shape Key button Normally, this would create a whole new copy of the entire current shape key In this case, though, it just creates a copy of the shape keys from the vertex group You can now go back to the original shape key, change the name to that of another vertex groups, and create additional keys