Looping
| Function | What it does |
|---|---|
loopOut(type, n) | After the last keyframe, repeats the animation. |
loopIn(type, n) | Before the first keyframe, repeats the animation. |
type defaults to "cycle". n (optional) loops only the last (loopOut) or first (loopIn) n keyframes; 0 or omitted uses them all. Both can be called bare (on this property) or on another property: thisComp.layer("A").transform.rotation.loopOut().
| Type | What it does |
|---|---|
"cycle" | Repeats from the start. |
"pingpong" | Plays forward, then backward. |
"offset" | Repeats, adding the change of each loop on top of the last. |
"continue" | Keeps going at the speed of the last (or first) keyframe. |
A property with fewer than two keyframes isn't looped.
Time
| Function | What it does | Defaults |
|---|---|---|
time | The current time in seconds. | |
valueAtTime(t) | This property's keyframed value at t seconds. | |
prop.valueAtTime(t) | Another property's value at t. | |
timeToFrames(t, fps) | Seconds to a whole frame number. | t = time, fps = comp frame rate |
framesToTime(frames, fps) | Frames to seconds. | fps = comp frame rate |
Examples
loopOut("pingpong")
loopOut("cycle", 2)
valueAtTime(time - 0.25) // lag a quarter second
thisComp.layer("Leader").transform.position.valueAtTime(time - index * 0.1)
Notes
valueAtTime and the loops read keyframed values before modifiers, as AE's valueAtTime on the expression's own property does.