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;
}
valueAtTime(t);

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

The best way to get our project files is to become a patron on Patreon. For $5 a month, you get access to all of the tutorial project files we've made available as well as other monthly projects, rigs, R&D, elements, early product previews, and BTS content not available anywhere else! You can also purchase just this project file on our Gumroad Store if you would rather do that.

Get access to all of our project files on Patreon or Get this single project file on Gumroad

Workbench tools are used by designers at hundreds of amazing companies