The track to constraint:

Basic tool for animating eyeballs

Intoduction

Animating eyes is just as important as animating any other body part; the eyes can make or break a character. Because of this it's very important to know your way around modeling, shading and animating them. The Track To constraint will help you with the last of these.

I do not intend to cover modeling and shading of the eyes here, since there are plenty of good tutorials out there doing just that. My personal favorite is this one: Creating Pixar-looking eyes in Blender, but there are some other excellent ones out there as well, for instance Adam Baroody's It's all in the Eyes tutorial.

What I will do here is to show you a very simple tool that will assist you in the task of animating eyes and give you good control over their exact point of focus: The Track To constraint.

The Track To constraint has been in Blender for a long time, and using it to animate eyes is not a new idea, although it it's not the only thing it can be used for. For instance the technique described in this tutorial can also be used to lock a camera to a target. It's all done using the object's axis (the local X, Y and Z-axis), and choosing which one of them to point towards the desired target object. A neat feature of it is then that it updates the orientation of the object in real-time if the target object, or the object itself (i.e. the eye), changes position.

1.Setting up the empties

So, let's get going. I assume you have a pair of eyes set up next to each other like below.

Eyes in perspective 3D view
Eyes from perspective viewport.

Create two empty objects and position them in a straight line away from the eyes. Give them logical names like "leftempty" and "rightempty" (according to which eye they're positioned in front of) and memorize those names; we'll need to type them in elsewhere later.

Screenshot of the scene
Overview of the scene. Two empties are positioned in alignment with each eye.
2.Setting up the Track To constraint

Select one of the eyeballs (let's say the one to the right here) and go to the object panel. Under the constraint roll-out, click "Add Constraint" and choose the "Track To" constraint.

"Add Constraint" drop down menu. Select "Track To".
The Constraint roll-out.

The settings for the Track To constraint will now appear. First, you need to type in the name of the empty the eye should focus on. For the right eye that is "rightempty" (or whatever you chose to name it previously).

Set "Target" to the object "rightempty"
The Track To constraint settings.

Next, set the axis that should point towards the empty; in this case the Y-axis. Also set the axis to point up, which is the Z-axis here.

Please note that you may have to play a little around with these axis if this doesn't work for your situation. It depends on how you created the eyes in the first place and how the local axis for the eyes and the empties are orientated.

TIP: You might want to turn on the "Axis" button in the Draw roll-out under the Object(F7)=>Object buttons. A set of axis will then appear at the center of your object, in that way helping you see which axis you should point towards the empties and upwards.

Axis are set to "To: Y" and "Up: Z"
Set the proper axis to point towards and up.

Do the completely same thing with the other eye. Only that it's now "leftempty" instead of "rightempty" you should set as the Track To constraint target.

Conclusion

Voilá! Now you're set to go animating the eyes. Try moving the empty objects around. One by one, or even together, to get your eyes to focus at the same point.
...Magic! :)

The finished set of eyes with Track To constraints
The final result.

TIP: The Track To constraint can also be used to control other objects. For instance, applying it to a camera will make it much easier to position and animate - especially in cases where it's important to have a clear idea of the target it focuses on. But it is not limited to this. The Track To constraint can be useful in many other situations.

//Mathias


Have you found something not making sense, spelling mistakes or typos? Or have you got any questions that you feel I didn't answer? Contact me, and I'll try to see if I can help you/improve upon this.