A human spine, also called vertebral column, is a bony structure that consists of several vertebrae (24 or 33, if you consider the pelvic region). It acts as our main axis and allows us a lot of flexibility to bend forward, sideways, and backward. And why is this important to know?
That number of vertebrae is something useful for us riggers. Not that we're going to create all those tiny bones to make our character's spine look real, but that information can be used within Blender. You can subdivide one physical bone for up to 32 logical segments (that can be seen in the B-Bone visualization mode), and this bone will make a curved deformation based on its parent and child bones. That allows us to get pretty good deformations on our character's spine while keeping the number of bones to a minimum.
This is good to get a realistic deformation, but in animation we often need the liberty to squash and stretch our character: and this is needed not only in cartoony animations, but to emphasize realistic poses too. We're going to see how to use some constraints to achieve that. We're going to talk about just the spine, without the pelvic region. The latter needs a different setup which is covered in another recipe in this book.
002-SpineStretch.blend
from this book's support files. It's a mesh with some bones already set for the limbs, as you can see in the next screenshot. There's no weight painting yet, because it's waiting for you to create the stretchy spine.Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you. Alternatively, the author also maintains a copy of the code on his website at http://virgiliovasconcelos.com/blender-animation-cookbook/.
Do the same to the remaining bones so we end up with five bones. Still in side view, you can select and move (G) the individual joints to best fit the mesh, building that curved shape common in a human spine, ending with a bone to serve as the head, as seen in the next screenshot:
D_Spine1, D_Spine2, D_Spine3, D_Neck
, and D_Head
. D_Neck
bone, go to the Properties Window, under the Bone tab and increase the value of Segments in the Deform section to 6
. You will not notice any difference yet. 8
. Do the same to the remaining bones below, with values of 8
and 6
, respectively. To see the results, go out of Edit Mode (Tab). You should end up with a nice curvy spine as seen in the following screenshot:Since these bones are already set to deform the mesh, we could just add some shapes to them and move our character's torso to get a nice spine movement. But that's not enough for us, since we also want the ability to make this character stretch.
1
and disable their deform property on the same panel under the Properties Window. Name these new bones as Spine1, Spine2, Spine3, Neck
, and Head
, go out of Edit Mode (Tab) and you should have something that looks similar to the next screenshot: Spine1
, hold Shift, and select D_Spine1
. Press Shift + Ctrl + C to bring up the Constraints menu. Select the Copy Location constraint. This will make the deformation chain move when you move the Spine_1
bone.The Copy Location constraint here is added because there is no pelvic bone in this example, since it's creation involves a different approach which we'll see in the next recipe, Rigging the pelvis. With the pelvic bone below the first spinal bone, its location will drive the location of the rest of the chain, since it will be the chain's root bone. Thus, this constraint won't be needed with the addition of the pelvis. Make sure that you check out our next recipe, dedicated to creating the pelvic bone.
1
, so the constraint would be evaluated considering the tip of the Spine_1
bone instead of its base. Things will look different now, but not yet correct. Press the Reset button to recalculate the constraints and make things look normal again. This constraint will cause the first deformation bone to be stretched when you scale (S) the Spine_1
bone. Try it and see the results. The following screenshot shows the constraint values:This constraint should be enough for stretching, and we may think it could replace the Copy Rotation constraint. That's not true, since the StretchTo constraint does not apply rotations on the bone's longitudinal Y axis. So, let's add a Copy Rotation constraint.
Spine1
and D_Spine1
selected (in that order, that's important!), press Ctrl + Shift + C and choose the Copy Rotation constraint. Since the two bones have the exact same size and position in 3D space, you don't need to change any of the constraint's settings. D_Spine1
bone in steps 9 to 12. Shoulder.L
bone, hold Shift, and select both Shoulder.R
and Spine3
(in this order; that's important). Press Ctrl + P and choose Keep Offset to make both shoulder controllers children of the Spine3
bone and disable its scale inheriting either through Shift + W or the Bone tab on the Properties panel.When you finish setting these constraints and applying the rig to the mesh through weight painting (refer to the recipe Tips on weight painting your character in Chapter 1, Get Rigging if in doubt), you can achieve something stretchy, as you can see in the next screenshot:
The file 002-SpineStretch-complete.blend
has this complete recipe, for your reference in case of doubts.
When creating spine rigs in Blender, there's no need to create lots of bones, since Blender allows us to logically subdivide each one to get soft and curved deformations. The amount of curved deformation can also be controlled through the Ease In and Ease Out sliders, and it also works well with stretching.
When you scale a bone on its local Y axis in Pose Mode, it doesn't retain its volume, thus the mesh deformed by it would be scaled without the stretching feeling. You must create controller bones to act as targets to the Stretch To constraint, so when they're scaled, the constrained bones will stretch and deform the mesh with its volume preserved.
You should notice that the spine controllers will be hidden inside the character's body when you turn off the armature's X-Ray property. Therefore, you need to create some custom shapes for these controller bones in order to make your rig more usable. Refer to the recipe Customizing shapes and colors for your bones in Chapter 1,Get Rigging
Chapter 1: Tips on weight painting your character
Chapter 1: Customizing shapes and colors for your bones
Chapter 2: Rigging the pelvis
3.144.113.163