[Ilia Kotchen] “I have an object animating along a path. It animates from the first point to the last point as it should. My question is: Without redrawing the path in reverse, how can I make that object follow along the path from the last point to the first point instead?”
Alt+click the position stopwatch for the item you wish to reverse, and enter the following expression:
// expression to reverse keyframe evaluation in time
// i.e., the first keyframe will be used last, and the last will be used first
// everything in between will also be reversed, because we will essentially run
// time backwards in this property only
// we need 2 or more keyframes on the property to be able to reverse them
if (numKeys > 1) {
// We're going to look at the current time, then figure out where it is in relation to the range of time
// from the first keyframe to the last. We will store in t the interpolation of what that value would be
// if that exact range of time were reversed, running backwards from the last frame to the first
t = linear(time, key(1).time,key(numKeys).time,key(numKeys).time,key(1).time);
// get the value of the property at the reversed time
valueAtTime(t);
} else value // if we have less than 2 keyframes, just return the underlying value
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]