Zack Lovatt

I focus on toolkitting, building custom studio pipelines, expression rigging projects, and creating data-driven animation workflows.

Mail GitHub LinkedIn Skype Vimeo
September 10, 2012

Preset: Pose Flipping

Posted In: downloads, expressions, presets

The Idea

I was recently working on a title sequence for an animated children’s film created in a storybook style (in the spirit of Shrek). To fit the style, all of the characters were animated as cutouts/puppets, with several poses for each character/prop drawn by the talented Peter Lee at Arc Productions. From there, I had to animate the scenes, which included finding an efficient way to cycle between distinct poses, creating the illusion of movement.

As I can’t very well show the work itself (nor the assets), we’ll have to make do with a few buddies. Here’s an example animation, with each pose exploded out so you can see what we’re working with.

The Code

So. Breaking down the task, there are two things going on here– we’re flipping between a set number of poses, and we’re controlling how long each pose will hold before flipping to the next. There’s some setup needed, but we’ll get to that after. To cut straight through, here’s the Time Remap expression:

numPoses = 7; // Total number of poses
holdFrames = 4; // Number of frames to hold

The Explanation

the number of unique poses / frames in the animation
how long to hold on each pose
this converts time into a number of frames, then makes the animation play out at the correct speed — that is, one pose switch every holdFrames
%numPoses uses the modulo operator to continually generate a number between 0-6
the encompassing framesToTime() function changes all of this work being done in frames back into a time value, which Time Remap needs to function.
Now, this expression requires a tiny bit of setup on AE’s side. You need all of your poses in one precomp (to which the expression is applied), and each pose must only last one frame, staggered, like this:

The Application

Otherwise, this is pretty straightforward! Here are two different images with a different number of poses, as well as several hold values.


Would you like to share your thoughts?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.