Creating and Animating a Simple Eye Rig

When I’ve explained the process of rigging in the past, I often start by asking the other person (or people) if he or she enjoys playing games like Chess or — for a computer gaming example — Minesweeper. It’s an apt comparison. The core mechanics of these games involve having the players logically track their way along a series of interdependent events. Rigging is a lot like that. It’s a complex task, a technical artform that simultaneously involves the logical problem-solving skills of a programmer, the usability considerations of a designer, and an animator’s eye for aesthetics. Rigging truly is a massively multi-disciplinary effort. You’re building an interface for an animator (whom you may also be) to use in the process of creating the illusion of movement… and maybe tell an interesting story along the way.

Chapters 10 and 11 in Blender For Dummies, 3rd edition give a pretty solid overview of the tools that you might use to create a rig so that you may have controls for animating your 3D creations. However, because rigging is such an involved process, the most effective way to get a firm grasp on it is to, well, go through that process. And if your interests are in doing animation, your understanding of rigging and how it works can go a long way toward helping you take full advantage of a rig. This chapter walks you through a couple examples that can help put you on your way.

In this quick example, you build a simple rig for controlling eyes and ultimately animating them.

Warning

Before getting started, I should note that while the eye rig you have at the end of this section works well, I don’t recommend that you use this exact rig in a full character without some modifications. The modifications aren’t too drastic; mostly you need to replace the Empties in this rig with bones in an armature. I go over using bones in more detail in the Rigging Stickman tutorial. In the meantime, work your way through this example, and you’ll be much better prepared when you get into more complex rigs.

Creating your rig

If you worked through the eyeball series of tutorials (modeling, materials, textures, you should have a nice, textured eyeball. If you haven’t worked through those examples, that’s okay, too. You can use this eye as your starting point.

Appending an eye

This tutorial starts off a bit differently from the previous ones I’ve posted. Instead of opening the existing model .blend and working directly in that file, you begin this project from the default startup scene (Ctrl+N) and append your eye model. To do so, use the following steps:

  1. Open Blender or load Blender’s default scene (Ctrl+N) and delete the default cube (X or Delete).

All that’s left in your scene now is the camera and a Point light.

  1. Append the eye object from the .blend file where it lives (Shift+F1).

Blender’s File Browser appears. When you left-click the .blend file, the File Browser allows you to drill down into the file. You’re looking at the innards of your .blend file.

  1. Left-click the Object folder.

You should see an object named eye. If you’re working on a file from the other tutorials, I’m assuming that you named your model. If you’re using the model provided in this tutorial, the eye object is definitely named.

  1. Double-click the eye object.

Blender brings your eye in the 3D View.

At this point, your Blender screen should look like this screenshot.

Append your eye model into a default Blender scene.

Setting up your rig

After you have your eye model in-scene (see preceding section),you can set up the rig. I recommend that you do the next steps from the front orthographic view (Numpad 1, Numpad 5). First things first: Most characters have two eyes, so you’re going to need two eyes:

  1. Select the eye object and grab it along the X-axis 1.5 units (GX1.5).

If you’re using a different custom eye model, the number of units you move it may be different. The idea here is to offset the eye to the right of the YZ plane.

  1. Create a linked duplicate of the eye and move it along the X-axis -3.0 units (Alt+DX–3).

Again, your move in the X-axis may not be exactly –3.0. Just double the value you used in Step 1 and negate it.

  1. Select the left eye (on your right if you’re looking at it from the front) and name it eye.L.

You can name it from the Item panel in the 3D View’s Properties region or from Object Properties in the Properties editor.

  1. Select the right eye and name it eye.R.

Adding .L and .R as a suffix for left and right parts of a character is a good practice to get into.

Now you have a disembodied binocular character. Sweet! For the next step, you need to add the controls for your new eyes. You’re going to use Empties — three of them, to be exact: one for each eye and one for overall control:

  1. Select eye.L and snap the 3D cursor to its origin (right-click, Shift+S→Cursor to Selected).

  2. Add an Empty and name it eye_control.L (Shift+A→Empty→Arrows).

You can use any of the types of Empty in that list. I just prefer to use the Arrows form because I can clearly see which axes are which, and what direction the positive values are for that Empty’s local coordinates.

  1. Select eye.R and snap the 3D cursor to its origin (right-click, Shift+S→Cursor to Selected).

  2. Add an Empty and name it eye_control.R (Shift+A→Empty→Arrows).

  3. Select your new Empties.

The Empties may be obscured by your eye models, so you may find it easier to select them using the Outliner or by quickly toggling wireframe viewport shading (Z). If you’re using the Pie Menus add-on, press Z and the wireframe option is on the right side of the menu.

  1. Grab these Empties and move them forward along the Y-axis (GY).

Moving them about 6 units forward (GY-6) should be enough.

  1. With the two Empties still selected, snap the 3D cursor to the location between them (Shift+S→Cursor to Selected).

Because both Empties are selected, the 3D cursor should snap directly to the Y-axis between them.

  1. Add a new Empty and name it eye_control (Shift+A→Empty→Plain Axes).

Unlike the individual left an right eye controls, I like to use either the Plain Axes or Single Arrow type of Empty for this one. This Empty is going to be the primary controller for the eyes, so making it appear different makes it easier differentiate it and, in addition to the next step, the Plain Axes display type is slightly easier to select.

  1. Scale the eye_control Empty to be twice the size of the other two Empties (S2).

At this point, all the elements for your simple rig are in place. Your setup should look like this screenshot.

All the elements for a simple eye rig are in place.

Applying constraints

All your pieces and parts are in place; the actors are all on stage, if you will. The next step is getting your Empties to control your eyes. To do this step, you need to set up a couple constraints. Specifically speaking, the workhorse of this rig is the Track To constraint. Use the following steps to apply that constraint to the left eye:

  1. Select the eye_control.L Empty and then add eye.L to your selection (right-click, Shift+right-click).

Remember the mnemonic from Chapter 10: Prisoners last.

  1. Add a Track To constraint to eye.L (Shift+Ctrl+C→Track To).

Your eye flips around and faces away from the Empty. The next step fixes that issue.

  1. In Constraints Properties, left-click the –Y button next to the To label in the Track To constraint.

Your eye flips back to pointing in the correct direction.

The control for your left eye is now ready to go. Go ahead and play with it. Select eye_control.L and grab (G) it around your scene. Your left eyeball in the scene should follow it around. Right-click or press Esc to stop grabbing the Empty and it should go back to its original position. From here, you have two options. You can either repeat the preceding steps used on eye.L and apply them to eye.R, or you can take advantage of a handy Blender add-on: the Copy Attributes Menu..

To enable the Copy Attributes Menu add-on, bring up the User Preferences editor (Ctrl+Alt+U) and go to the Add-ons section. Left-click the check box to enable the add-on labeled 3D View: Copy Attributes Menu. After you enable this add-on, close the User Preferences editor and go back to the 3D View. Now you can use the following steps to copy the Track To constraint from eye.L to eye.R:

  1. Select eye.R and add eye.L to your selection (right-click, Shift+right-click).

Remember from Chapter 4: Children first.

  1. Copy the Track To constraint from eye.L to eye.R (Ctrl+C→Copy Selected Constraints).

When you choose Copy Selected Constraints, Blender provides a secondary menu.

  1. Left-click the Track To option and then left-click OK.

POW! Your eye.R object now has a Track To constraint with the exact same settings as eye.L.

Of course, a small problem is that eye.R is pointing to the wrong control Empty. Fortunately, this fix is easy. Select eye.R, go to its Track To constraint, left-click the Target field, and choose eye_control.R from the menu that appears. eye.R should now point to the proper control Empty.

Making it easier to control both eye targets at once

At this point, you’re basically done with your rig. The only downside is that you have to select both eye_control.L and eye_control.R to control the direction of both eyes simultaneously. You can parent each of the Empties to the large eye_control Empty between them to solve this issue:

  1. Select eye_control.L and eye_control.R (right-click eye_control.L, Shift+right-click eye_control.R).

  2. Add eye_control to your selection, making it the active object (Shift+right-click eye_control).

  3. Make eye_control the parent of the other two Empties (Ctrl+P→Object).

  4. Select eye_control.L and eye_control.R and hide them from view (H).

This step isn’t critical, but it does help prevent you from selecting those empties and moving them accidentally.

Your simple eye rig is now complete, and you can start animating your eyes. You can control regular eye movement by grabbing (G) the eye_control Empty and moving it around your scene. If you want to cross your character’s eyes, you can scale (S) the control down. And if you want your character to look like a crazy person, try rotating (R) the eye_control Empty.

If you’d like, you can set up basic three-point lighting (see Chapter 9 of Blender For Dummies, 3rd edition) and set your 3D View to use Textured viewport shading (Alt+Z) and GLSL display shading (N→Display→GLSL). And if having two disembodied eyes floating in the scene makes you too uncomfortable, you may want to add a sphere as a simple stand-in head.

Animating your eyes

After you have a basic rig created, you can start animating your eyes. Start by switching to the Animation screen layout (Ctrl+Ctrl+). You may want to increase the size of the Graph Editor on the left of the screen as well. Then select the camera in the 3D View and adjust its location and orientation to frame your eyes to your taste. With a few additional modifications, your screen should look like this figure.

Now you're ready to animate.

This specific example is a simple animation of a character rolling its eyes. As a quick test, roll your own eyes and try to figure out how long that action takes. Trying for myself, to get the right feel of the action, it feels like the action takes a full second. I’ve also noticed that my eyes seem to move faster at the end of the motion than at the beginning. Bearing all this information in mind, you can start animating:

  1. Select eye_control and grab it to the left of your character (right-click, G).

  2. Insert a location keyframe (I→Location).

This keyframe is the starting point for your animation.

  1. Move forward in time to frame 24.

You can move forward by scrubbing in the Timeline or Graph Editor or by changing the Current Frame field in the Timeline’s header. Blender’s default behavior is to have motion happen at 24 frames per second (fps). This action takes 1 second to complete, which is why you go to frame 24.

  1. Move the eye_control Empty to the right of your character (G).

  2. Insert another location keyframe (I→Location).

You’ve now animated your character’s eyes looking from left to right.

  1. Set the current frame as the end frame of your animation by hovering your mouse over the Timeline and pressing E or by using the Frame→Set End Frame menu item.

You can test the timing of your animation by pressing Alt+A or left-clicking the play button in the Timeline. Press Esc or left-click the pause button to stop playback.

Tip

To ensure that your animation is playing back in real time, change the Sync drop-down menu in the Timeline from No Sync to AV-sync or Frame Dropping. On a slower computer, the animation may appear to look choppy, but the action you’ve animated will take exactly 1 second. With the default No Sync setting, you’re guaranteed to see every frame of animation, but it may play slower than real time on a less powerful computer.

  1. Move to frame 16.

Because I noticed that my eyes move faster at the end of the motion, I want this keyframe to be closer to the end of the action.

  1. Grab the eye_control Empty and move it up in the Z-axis so that it’s above your character’s head (G).

  2. Insert another location keyframe (I→Location).

When you play back your animation, your character should now be successfully rolling its eyes.

  1. Tweak your animation to taste using more keyframes or by editing the f-curves in the Graph Editor.

See? Animation can be easy! (I added eyelids… those uncapped eyes were freaking me out!)

Bit of a noisy render. I’ll try to do a nicer one in the future.

Like this tutorial? It pairs really nicely with my book, Blender For Dummies, 3rd edition. It’s available anywhere books are sold. Thanks!