The ability to create bones that deform a mesh is great, but that alone doesn't solve all our rigging problems. Some may argue that it's possible to create perfect deformations in every movement of your character just with lots of extra bones and even more detailed weight painting, but that's too time consuming. We want our rigs ready to be animated in a short amount of time. We care about our character looking good on screen, not the purity of the technique.
That's why we can solve some trickier rigging problems with corrective Shape Keys. Shape Keys are saved states of our character's mesh, with the position of each vertex stored in the computer's memory. We're going to create some custom deformations in our character to correct specific issues caused by our rig. The example will take care of one of the most common source of deformation problems: the bending of arms.
Open up the file 001-ShapeKeys.blend
from this book's support files. You'll see an arm with two bones already set to deform the mesh. Try rotating the forearm on its X local axis for 130o. You'll notice that the vertices located near the elbow don't deform like a real arm would: there are noticeable intersections and the biceps should be contracted.
Even with the feature called Preserve Volume in the Armature modifier panel that uses the dual quaternion method to deform meshes in a more realistic way, some things such as muscles and specific skin deformations still need to be fixed manually. We're going to create a Shape Key here to act as the extreme deformation of this mesh when the character bends its arm to the maximum angle of 130o. Look at the next screenshot to see the before (left) and after the driven corrective Shape Key, where the biceps muscle gets contracted and the skin gets compressed between the arm and forearm.
We can tell Blender to keep the armature's deformation on the mesh while we edit its vertices, so that it's easier to create the corrective Shape Key.
Arm_Left
. This is important when dealing with complete characters and lots of Shape Keys.We're going to use both the sculpting tool and the Edit Mode to build our corrective shape. In order to be able to work on a Shape Key in Sculpt Mode, we have to pin this shape.
Now comes the magic part: now that you have two shapes for your arm, we need to set a driver, so the rotation of the forearm bone on its X local axis triggers the morphing between those keys.
var
. -1
so that the blending between the Shape Keys starts only when the arm bending is closer to its final position. The next screenshot shows the driver and its values set:The file 001-ShapeKeys-complete.blend
has this finished recipe for your reference.
Using a basic rig as starting point, you move the bones around and look for strange deformations, which would occur mostly in joints. When you find such deformations, its time to use them as a base to build new Shape Keys that correct the mesh in such situations. By using drivers, you can use the same bone values that caused the bad deformations to trigger the corrective Shape Key.
In this recipe you've learned how to create simple drivers in Blender. You'll notice throughout this book that most rigging features rely on them at some point. Fortunately they are not difficult to create.
The use of drivers in Blender 2.5 changed significantly from previous versions. Now, almost every property in Blender can be animated, driven, and used as a driver for other properties. It's just a matter of right-clicking over the property that you want to control and selecting Add Driver, then setting it up on the Graph Editor window. You can even make complex drivers using scripted expressions that can take into account more than one property and math expressions, for example.
Chapter 4: Adding expressions using Shape Keys
3.144.222.185