Tutorial 142: Retiming Animations

Joe Clay | Sep 21, 2018

This week we take a look at how to retime animations for Mograph Templates. This expression will allow you to retime your animations while preserving the timing of the intro and outro animations—only the hold point is flexible. This way, you can have Motion Graphics Templates that can be retimed without time remapping in your main comp—which can have odd effects with animated Master Properties.

This expression can be applied to nearly every property since it ends with valueAtTime(). I've set this up by making a layer called controller, which is where the markers go. To split markers, option/alt+click on them and drag. Make a marker that covers your intro animation and one that covers the outro animation.

//Retime animations
dur = thisComp.layer("Controller").effect("Duration")("Slider");
m = thisComp.layer("Controller").marker;
animIn = m.key(1).time;
hold = animIn + m.key(1).duration;
animOut = m.key(2).time;
outDur = m.key(2).duration;
end = animOut + outDur;
if(time < hold) {
    t = time;
} else if(time > dur-outDur) {
    t = linear(time,dur-outDur,dur,animOut,end);
} else {
    t = hold;

If you'd like the time between intro and outro to remap instead of hold, you can replace t = hold; above with the following:

t = linear(time,hold, dur-outDur, hold, animOut);

And that's all you need to retime your animations for templates. As for the rest of the template setup, that's for another tutorial. But if you'd like to see how this one is built, the project file below includes the setup.

Also, make sure to check out Evan Abram's tutorial, Controlling Time in Templates on the subject for another approach.

Grab the Project Files

Get the project file through our Gumroad Store. This project file contains the setup shown in the tutorial with all of the expressions built, including ones not shown in the tutorial. There is no mograph template built in here yet—you'd just need to drag the controls into the Essential Graphics Panel. Because of that, a version for AE back to CC v13 is included. Without access to Essential Graphics, you'll have to make a comp for each animation you want to make.

If you're buying project files, consider becoming a Patron. At the $5/mo. tier, you get access to project files as they come out and some tutorials also come with additional BTS content showing more of the builds.

Get the project on Gumroad

Become a Patron

If you'd like to help support Workbench, check out our Patreon page. Thank you for even considering clicking this link to support what we're doing. We appreciate it. Patrons get all sorts of benefits, from R&D files, setups, and elements to early product releases.

Check out our Patreon Today