A Simple Bone Setup for Facial Animation

Alrighty....

First of all, the bone-based facial rig you are about to read about was inspired COMPLETELY by the work of Chris Harvey at Frantic Films. Without the facial rig he posted over at cgtalk for learning purposes, I would not have come across this method of rigging...and would still probably be using morphs!

Anyways, over the last few days I've been playing around and trying to figure out the best way to rig the faces of the characters for my next short film.

Normally, I use morphs and blendshapes to animate my characters' faces, by creating a series of phenome and expression targets whose values I then animate to my little heart's delight....but....

Problem!

Using morphs to animate facial expression is:

a) Extremely limiting. If you forget to set a morph target for a specific expression you need your character to make, it can be time consuming to go back and add it later.

b) Even more constrictive. Although morphs can cover a lot of ground, you're never going to have an unlimited number of different facial expression combinations that your character will be able to make (due to the nature of morphs).

c) Can be very confusing. Animating facial expressions using value spinners alone can be overwhelming when you are trying to create expressions using several morph targets at once.

So, even though for simple characters/animations the morpher modifier is great, when it comes to more complicated characters/animations, it isn't such a good choice. That is why I decided to look into:

Facial Animation Using Bones

Back a couple of years ago (before I discovered the morpher modifier), I used to play around using bones to animate facial expressions (following the "snake head" tutorial that comes with older versions of Max). First, I would create bones around the lips and eyelids, and then would skin the character using Physique. This appeared to be a good idea at first, but soon I discovered that it didn't allow for any cartoony squashing and stretching (or natural skin-length stretching), and so it was therefore not such a good method for facial animation.

But, after using the morpher modifier exclusively for quite a while after that, I decided to research some other methods over at cgTalk and soon I came across the bone method once again...luckily, the method discussed over at cgTalk doesn't have the same limitations that the "snake head" tutorial did, and as you will see, it is extremely customizable and easy-to-use. So, I've played around with this method a little bit, and have decided to post my results here (in tutorial form). Hope you enjoy and learn something.

This form of bone-driven facial animation is founded on point-helpers, because point-helpers can be used easily as "handles" which we can then animate to move around certain areas of the face. In fact, when animating a character using this method you will never need to even touch the bones after they have been placed (ie, only the point-helpers will be moved once you are ready to animate).

How does this work? Well, that's the same question I was asking when I was reading about this, and here is what I learned/found:

Each point is designated for a certain area of the face (and each point is responsible for moving a certain cluster of vertices). Each bone is then extended between 2 of the points, creating a virtual stretchalbe/scalable "muscle" which will help in the skinning process later.

When a point is moved, the bone that spans between that point and another is stretched/scaled to compensate for the space that increases/decreases between the 2 points. But we are still only talking theory here, so now I will show you how to set this "system" of movement up in max.

First, create 2 point-helper objects in your front viewport, which some space between them, like this:

You'll notice that I've checked "box" in the points' display parameters. This just helps me to see and distinguish them a little better.

Next, create a single bone with its end-bone still attached (ie, don't delete the end bone or else this will not work!), like this:

The placement of the bone does not matter, as we will be constraining its position and rotation in a minute anyways.

The next step is to constrain the parent bone to the point-helper on the right. We will do this by giving its position transform a position constrainst controller. But, just to be safe (in case for some crazy reason we still want to be able to move this bone by itself in the future), we will set its position controller as a position list first.

Once you have done that, assign a position constrainst controller in the available slot, like this:

Okay, now we want to set the point on the right as the constraint for the parent bone's position. Do this by setting the position constraint controller as active, and then choosing the right point as the constraint for the bone, like this:

The parent bone's right end will now jump to the exact point in world-space where the right point-helper is placed, like this:

Next, before we constrain the parent bone's child bone, we want to make sure that the parent bone will stretch to wherever the child bone is moved to (in this case, it will be moved to the position of the point-helper on the left). We can enable this stetching by opening up 3d Studio Max's Bone Tools dialogue box.

To do this, click on "Character" in the top drop-down menu, and then click on "Bone Tools". Also, make sure that your parent bone is selected so that you editing the properties for the right bone.

Once you open up bone tools, you will have access to some different properties for your bone:

The only thing you want to do with these properties right now, is un-check the "Freeze Length" option. This will allow our parent bone to stretch. Once you un-check that box, you can close the bone tools.

Notice now, that if you drag the child (end) bone around in the viewport, that the parent bone will stretch and compress its length to compensate for the changes in distance between its position transform and the placement of the child bone. This stretching/compressing is what will drive our facial rig once we skin it to a character later.

Also note, that in the Bone Tools dialogue box, there is a radial button that gives us 3 different choices for how we want our bone to stretch (None, Scale and Squash). I strongly recommend that for the purposes of a facial rig, you do not enable squashing. In other words, keep the radial button enabled beside "Scale". I have found that enabling "Squash" can create some unwanted deformation later, which can pose a definite problem.

Okay, so we are halfway to creating our first miniature bone-rig system. The only thing we have to do now is constrain the child (end) bone to the point-helper on the left. Do this the same way that you constrained the parent bone to the right point-helper (Position List-->Position Constraint).

Now, you will notice that if you try to move either of the bones they will not budge on their own, but if you drag either of the point-helpers around in the viewport, the parent bone will stretch between the distance of the 2 points.

BUT! Notice that if you drag the point-helpers around, the parent bone will adjust its length to fit across the span between the two points, but it will not adjust its orientation to point towards the point-helper on the left. Obviously, we need this to happen, so what we need to do next is give the parent bone's rotation controller a Look-At Constraint.

Once you have assigned the parent bone a Look-At Constraint, set the point-helper on the left as its Look-At Target, and disable "Viewline Length Absolute" (in order to clean things up a little).

Now, if you move either of your points around in the viewport, you will see an effect similar to this:

Stretching Example

 

****************

 

Ok, to keep this tutorial relatively short, I will not get into too much detail concerning the rest of the process when it comes to setting up the position for the different bones in the face (ie, how many there should be and their placement), but the process pretty much only consists of doing the above over and over again, until all of the different controlling points in the face have been linked with respective bones.

In some areas like the eyelids, only single points are necessary for the top and bottom lid (ie, no bones), because there won't be too much complex motion happening in those areas (ie, once the character is skinned, only single points will control blinking instead of a series of bones). But, areas like the mouth will need anywhere from 5-12 points (all joined by bones) in order to create the complex poses and motions that we want in our characters.

The following is an example image of a character rigged with this bone setup. As you can see, I have set up a bone/point rig for his mouth and eyelids as well as his jaw and eyebrows, and have wired his head and eyes to point towards certain point-helpers on the screen (with the use of the Look-At Controller).

Once the rig was set up, the character was then skinned to the bones using the Skin modifier. To avoid complications in skinning, for the mouth I only included parents bones as skin controllers (ie, no end bones or points). That way, it wouldn't be hard to edit bone envelopes because the number of influencial bones would be kept to a minimum.

Also, I made good use of the Skin modifier's type-in-weights feature, which allowed me to tweak bone-->vertex influence very precicely.

Now, once a character is in motion, it can be very difficult to animate its face by clicking on each of the points and rotating/dragging them locally...so, my next step was to set up a VERY simple GUI that would allow me to control each area of the face easily and accurately. I did this by wiring the transforms of each point that I needed to be animatible to a shape whose referenced position would be used to control the chosen transform (rotation or position) of that point.

NOTE! Before wiring anything, you'll want to "zero-out" the "controller" object's transform (in this case, the controller object is the shape object in the "GUI"). To do this, simply link the "controller" object (ie, the cirles) to another neutral object in the scene that is aligned to the "controller" object you are linking (if the objects are not aligned, it will create transform offset problems that are fixable...but annoying). This not only "zeros-out" your "controller" objects, but it also gives you an easy way to move around all of the different custom manipulators ("controllers") at once.

Also, don't overdo it with too many controllers which will confuse the whole process! Keep your GUI simple, so that animating your character will be much easier.

Here's an example of the GUI I set up for my character:

As you can see, each point in the face rig has a designated circle object in the GUI which acts as a specific transform "controller" or "manipulator". Just so you know, there were no special helper objects used to create the GUI such as actual 3d Studio Max manipulators or controllers! The "manipulators" you see are simply rectangle and circle splines which have been customized (using the Parameter Wire Dialogue) to control the transforms of the different points in the facial rig.

Here is a viewport preview which illustrates how each custom "manipulator" controls a specific area of the character's facial rig:

Preview

Please note a couple of things:

1) I wired the top-lip to the jaw manipulator for convenience only. On a proper rig the top lip should not move with the jaw.

2) I did not constrain the circles to the insides of their respective rectangles.

3) This is a very simple rig for testing and illustration purposes only. A normal rig should have more controllers to manipulate the cheeks, nose, ears etc etc...

So, how effective is a morph-less rig that only uses bones? Well, I decided to do a (very short) test animation to try it out.

The following animation shows my results, as well as the inner workings of the rig (notice the stretching of the bones etc):

Animation Test

Despite the fact that the lip-syncing isn't perfect due to the short amount of time I had to create this animation in, personally, I'd have to say that the results look great! Bones allow for a lot of flexibility when it comes to the number of facial expression combinations I can make (much moreso than morpher would have allowed), and the GUI makes it EXTREMELY easy to animate the different poses.

If you would like to play around with my setup yourself, you can download the MAX file here (you'll need Max 7):

Face Rig .max File

Please don't distribute the file yourself (at least without my permission), but feel free to tear it apart and play with it all you like.

Overall, this system is very effective, and I'd definitely recommend trying it over the morpher modifier.

Well, that's all for now. I hope that this "tutorial" has been both interesting and applicable for you! Feel free to email me (ivanisavich@yahoo.com) your comments and let me know what you think!