skip to Main Content

Text & video updated: 30 November 2018

Sections on this page:

Video 9 of the Controllers & Expressions Series:
Rigging Angie’s eyes, part 4 of 5

In this video we’re going to move on to the eyelids. The first step will be to import and put together the 3 controllers we’ll need to give us the option to have Angie blink or wink with either eye. This will involve two separate controllers for each pair of eyelids, and a switch so that a single controller can be used to have Angie blink instead of have to move both blink controllers.

This video is longer than normal (171/2 minutes) because I thought it best to complete the entire process of setting up the controls. That way we can get to coding the eyelids in the next, and final, video for the eye rigging project.

Controllers & Expressions Series announcement graphic

Rigging Angie’s eyes,
part 4 of 5

If you missed part one, it’s here, along with the work files.

Logical operator introduced:
  • && (symbol for and)
Video content:
  • 0:00 Introduction
  • 0:31 Housecleaning (Project Panel)
  • 1:39 Importing the new controllers
  • 2:02 Placing & naming new controllers
  • 4:06 Zeroing the position properties & labeling the switch
  • 6:00 Zeroing the position properties & labeling the left & right eyelid controllers
  • 7:58 Cleaning up the timeline & connecting opacity properties to the R Eyelid Control Handle layer
  • 9:32 Creating the Blink label & coding its opacity property
  • 11:24 Cleaning up the timeline & arranging the controllers on the composition panel
  • 12:21 Clamping the control handles
  • 13:47 Connect the R Eyelid Control Handle’s opacity property to the Switch
  • 16:20 Testing the Switch
  •  17:05 End Credits

Code from the video

The code below is provided as a reference, and was copied directly from the video After Effects file. Expression fields that contained only a pick whip connection are not included.

R Eyelid Control Handle opacity property

While this expression controls just the handle’s opacity, remember that we connected many other layer’s opacities to this layer via the pick whip. Doing this allows us to control many layers with a single expression, making it easier to edit if necessary.

SRE=thisComp.layer("Switch R Eye Active").transform.position[0];
if(SRE>=0 && SRE<=10){

Blink Text layer opacity property

We want the Blink label to disappear when the R Eye Active Switch is toggled to the right. Because all layers that change opacity are connected to the R Eye Control Handle, which is controlled by the expression above, they will all be visible when the handle is to the right and invisible when it is to the left. By inserting the linear( ) expression below, we change the Blink label’s behavior to do the opposite. Using the linear property is an easy way to reverse the opacity results so that this label and its sister label “L Eyelid Control” will toggle on and off, switching places.

REC=thisComp.layer("R Eyelid Control Handle").transform.opacity;

Handle clamp( ) expressions

As we’ve done before, the clamp expression will keep the handles within their boundary boxes.

//The L & R Eye Control Handels have an X distance of 100px and a Y distance of 0px


//The Switch Handle has an X distance of 20px and a Y distance of 0px

Rigging Angie’s eyes, part 3 of 5
Rigging Angie’s eyes, part 5 of 5
Back To Top