Icon

Animating The Inanimate, Part 4

Gonna end up a big ol' pile o' dem bones

We're going to wrap up our series today with a lively discussion of one of the more flexible techniques for character animation: bones. Now, in the real world, the words "flexible" and "bones" may not belong in the same sentence without requiring a trip to the emergency room, but as this is the magical land inside your computer, the two words are quite comfortable being in the same proximity. As usual, I'm rambling already, so let's just dive right in and take a look.

Huh?

What do I mean, "bones?" No, I'm not referring to the 2001 film starring the master thespian known as Snoop Dogg, which I somehow managed to miss. And no, I'm also not using one of many slang terms for either U.S. dollars or a pair of dice. Give up yet? Good, because I'm fresh out of not-so-witty wrong answers. Bones, in the world of 3D animation, are somewhat analogous to real-world bones in that they generally work under the surface of a model to determine the model's pose. But the analogy really ends there, because while it's common to create a sophisticated "skeleton" of bones that you can use to control your model's movement in extremely realistic ways, it's somewhat of an insult to the entire bones family by typecasting them in this manner. You might get more mileage out of bones by thinking of them as invisible objects designed for very specific, targeted deformations of a model. Plus, it's quite possible to create believable characters using only two bones, which is what I'm planning on showing you today. I'm sure I've lost a great many of you by now with my overly abstract explanations, so I now turn to our long-AWOL friend Ralph the Peanut to help illustrate what the heck I'm talking about.

I introduced Ralph (fig. 1) way back in part one of this series, but in case you need a refresher, Ralph is an anthropomorphic in-the-shell peanut created for a series of two commercial spots. The scripts for Ralph's spots called for him to do things like turn his "head" up and down and side-to-side, as well as some hopping around. I was also going to need to squash him down a bit in the hopping portion of the spot, plus he had to rotate along his base occasionally. However, neither of the latter properties required any special geometric considerations during modeling. Now, if you've been following along with this series, I previously introduced two other methods of deforming character models: morph targets and handles. Morph targets probably would have worked fine for what I needed to do with Ralph, but the technique sometimes lacks the on-the-fly flexibility you sometimes want, especially when there's an involved producer who is likely to make numerous tweaks along the way. And animating Ralph with the handles technique wouldn't have worked very well at all in this case. What to do, what to do. Eureka! I'll use bones! Bones would let me place a virtual skeleton inside Ralph's frame, and by moving the bones I would be able to affect movement in Ralph's outer "skin." Hot damn!


Figure 1: Ralph is highlighted here, in case you were having trouble telling which one he was.

Adding bones

Having the desire to use bones is all well and good and everything, but just how do you add bones to a model? In LightWave (again, the 3d program I'm using), there are a couple ways to produce bones: by either adding them through a menu command with no options or by drawing them with your mouse. Although the menu command is fine 'n dandy (fig. 2), it doesn't give you a whole lot of control over their initial position. Now, this particular limitation isn't such a huge deal in Ralph's case, but when you start talking about a complete human-like skeleton of bones it may become a royal pain in the bee-hind to add a bone and then manipulate it into each individual position. I usually find it's much easier to draw bones in. Here's what I usually do:


Figure 2: LightWave's Add Bones submenu.

  1. Switch to a front, side, or top straight-on view to get a nice, perspective-free vantage point on your model.
  2. Make sure the model you want to add bones to is selected in the viewport.
  3. Select the Items tab and choose Add->Bones->Draw Bones.
  4. Click and hold the mouse at the base of where you want to start drawing the bone, drag to produce the bone, and then release the mouse.
  5. If you're so inclined at this point, you can position the bone using the standard move and rotate tools, or re-size the bone using the Rest Length command (found under the Objects tab).
  6. To add a child bone in the hierarchy, return to the Items tab and select Add->Bones->Draw Child Bones.
  7. Do what you did two steps ago. What's different here, though, is that no matter where you click to start, the child bone is going to pick up at precisely the point where you left off with the parent bone.
  8. Since I'm working on Ralph, I'm pretty much done at two bones (fig. 3), but if you have a more complex model go ahead repeat the last step until you've got all the bones you want.


Figure 3: Here's a side view of Ralph in wireframe mode with the two bones I added sitting snugly inside.

As you've probably noticed by now, bones "do their stuff" mostly under a parent/child relationship, meaning that if you move the parent, the child goes with it, but not vice-versa. Again, refer to your own skeleton (your real one, I mean) if you're having trouble visualizing the concept. But keep in mind that you can start a new parent chain whenever you want within the same model—you're not stuck with just creating child bones. Go nuts. However, this parent/child thing isn't exactly a hard and fast rule, which I'll go over in a minute.

Once all the bones are in place, you have to tell them to start affecting the geometry, a process LightWave calls activation (and no, it's nothing like the kind activation Microsoft likes to make you do these days). This is done for pretty logical reasons, since if you were to go about tweaking initial bone placements and such while the bones were affecting their closest vertices, things might ge a bit squashy-looking in your model. Once your tweaking is done, a simple click of the Rec Rest Pos button (fig. 4) will automatically set the chosen bone's coordinates (based on the world coordinates of your scene) and make it active. This process is completely reversible, as you can easily activate and deactivate a bone at any time to further mess with its resting position, but obviously this becomes a much more convoluted process once you start adding keyframes into the mix by animating whatever hierarchy of bones you've set up. Anyway, that's the 10,000 foot view of the bone-adding process as LightWave implements it.


Figure 4: LightWave's Bone controls, of which the Record Resting Position button is an important member.

Philosophizing bones

Before I move ahead and go about pontificating on where to place Ralph's bones in relation to his body, here's a quick word about what could be described as the philosophy of bones. By definition, in order for bones to do anything constructive, you must have at least two of them. Picture this: I'm assuming most of you have both an upper arm bone (Humerus) and two lower arm bones (Radius and Ulna). For the sake of this discussion, I'm going to combine the two lower arm bones into a single uber-bone, which I'll call the Ulnius. By itself, the Ulnius wouldn't be doing a whole lot in terms of moving your forearm if it didn't have the Humerus to anchor it and hold what's around it in place. But since the Ulnius is attached to the Humerus, two things happen. First, the skin surrounding the Humerus won't be dragged limply along by moving the Ulnius, since the Humerus is the bone that influences the skin around it. That's good, because the thought of boneless human skin being dragged limply along isn't a particularly pleasant image. Second, the Ulnius/Humerus hierarchy and the influence each bone has on the skin surrounding it means that your arm is capable of many different positions just by moving the Ulnius, and even more by combining movements of both bones. The long and short of it is that you need two bones to get anything to move the way you want it: one anchors, and one moves in relation to it, each influencing the skin around it. Of course, this concept can be expanded; again, just look to your average human bone structure for countless examples of parent/child bone relationships. However, there's a twist here. Bones don't necessarily have to be set up in a parent/child hierarchy. As long as a model has at least two bones, they'll do their thing without having to be connected as parent and child, which I'll show in a minute.

Let's move back into the virtual world and apply this principle to Ralph. If I were to place a single bone into Ralph's skin, it won't do me much good at all. Figure 5 illustrates what happens if I place and rotate a single bone. Not too stellar there—I might as well just be moving Ralph's vertices and stuff directly without all this bone garbage. However, if I add a second bone as a child bone of the first, the way I did in the bone-adding example earlier, I've now set up a hierarchy of bones that each influence a section of Ralph's body. Figure 6 shows what happens just by rotating the one child bone, at which point I'd be inclined to go out on a limb (no pun intended) and say that the results are a whole lot better than my first try.


Figure 5: Here's the sight of one bone moving. Not exactly the "sound of one hand clapping" question, but it'll do.


Figure 6: One more bone makes all the difference.

Actually, this little sidebar on the philosophy of bones has gotten me most of the way to where I want to go with Ralph in terms of how to set his particular bones up. Using just two bones, Ralph is pretty much at the point where I can do what I need with him by moving his two bones (coupled with the rotation of the base and the squashing and stretching I alluded to before). However, the bone placement isn't all it could be—Ralph's movements look a little funny, and it's hard to get some of that cartoony exaggeration of movement I'm shooting for here. Besides, who says the bones have to be connected like they would inside a flesh and blood human being? I can create two parent bones for Ralph instead of having a hierarchy, both of which I can turn their respective sides so they serve as virtual handles that actually protrude out of Ralph's "back" (fig. 7). Why in the name of all that is good and holy would I want to do such a thing? Actually, the reasoning is pretty simple, as I'll now elaborate on by giving you yet another long-winded example.


Figure 7: The "sticks in the back" approach works better for Ralph.

Imagine Ralph were a real peanut, except picture him being about a 18" tall and made of soft plush material. Now let's imagine that my hands and arms are invisible. What would give me the best range of movement considering what Ralph needed to do: controlling him from the inside like a puppet (like I originally set him up) or just grabbing his upper an lower halves and manipulating him directly from the back? In Ralph's case, I chose the latter. Ralph needs side-to-side and up-and-down "head" movement, so the most direct thing to do (again, were Ralph an actual object and my hands invisible) is to steady Ralph's lower half with one hand and move his upper half with my other hand. This is pretty much what I'm doing by making two parent bones and turning them on their sides.

Figure 8 shows Ralph in all his rendered and composited glory after I've animated him in two quick shots (falling, getting up, and hopping) for one of his spots, and he's doing some pretty complex movements for only having two bones in him. Keyframing the rotation of both the lower and upper bone, combined with some strategic base rotation and a little bit of squashing and stretching made Ralph able to do all the things the scripts asked of him.


Figure 8: Final shots from Ralph's big moment.

As you move ahead...

Keep in mind that what I've shown here is barely scratching the surface as far as bones go. I'm shallow like that. Obviously, you can have any number of bones controlling any number of models with ever-increasing complexity. Bones usually also have controls such as user-definable influence spheres, weight mapping, muscle flexing, integration with IK systems, and sometimes even vertex-level accuracy, just to name a few, so check your 3d program's documentation on what's available to you.

Just to wrap up, I hope Al, Ralph and I were able to bring you some good introductory character animation info during the run of this series. The techniques I've described over the last four installments are by no means complete, but they should be enough to hopefully get your engines revved and, to paraphrase the great 3d animator Ben Kenobi, help you take your first step into a larger world.

^ Top of Page

Got Feedback? to send an email. I'll do my best to answer. Really.