skip to Main Content

Video updated: 30 November 2018

Sections on this page:

Video 12 of the Controllers & Expressions Series:
Creating an icon grid for lip synchronization, part 2 of 3

This video completes the icon grid project with just 6 lines of code. However, this series is about leaning some JavaScript so it goes into an indepth explanation about how and why each line of code is used. You’ll see how you can easily convert that code to fit any size icon grid you decide to create for your puppet.

Controllers & Expressions Series announcement graphic

Creating an icon grid for lip synchronization,

part 2 of 3

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

Expression introduced:
  • framesToTime(
Video content:
  • 0:00 Introduction
  • 0:26 Connecting the Selection Box to the time remapping expression
  • 1:44 Defining the parameters needed for the linear expressions
  • 3:27 Using Math.round()
  • 4:42 Adding the linear expression into the time remapping expression
  • 5:48 Exploring how to map the Selection Box coordinates to the switch layer frames with a single line of code
  • 10:08 Completing the time remapping expression
  • 11:16  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.

Time remapping expression for the Mouth composition

X=thisComp.layer("Selection Box").transform.position[0];

Y=thisComp.layer("Selection Box").transform.position[1];

XF=Math.round(linear(X,0,100,0,2)); //X Frame



Back To Top