Skip to content

Loop

Cycles upstream content over a fixed-length window.

Category: Time Menu path: Time > Loop

Ports

PortTypeDirectionDescription
inimageRgba16finputUpstream animated content.
outimageRgba16foutputLooped version of the upstream content.

Parameters

ParamTypeDefaultDescription
modeenumCycleOne of Cycle / PingPong / HoldLast. See "How It Works".
lengthscalar30Loop window length in comp frames. Minimum 1.

Expose Channels

PortTypeOverrides
length_inscalarlength

How It Works

The output frame is computed by mapping comp_frame into a [0, length) window:

  • Cycle (default): modified_frame = comp_frame mod length. The window repeats forward forever — frames 0..length play, then frames 0..length again, then 0..length again, ...
  • PingPong: same window, but every other cycle plays in reverse — 0→length−1, then length−1→0, then 0→length−1, ... Useful for back-and-forth swing motions.
  • HoldLast: the first length frames play normally; everything past that holds on length−1 (the last frame in the window). Like a clip that stops at the end without disappearing.

Re-evaluates upstream at the computed modified_frame using the same primitive as TimeShift and FreezeFrame.

Usage Examples

Looping animation

30-frame walk cycle → Loop(mode=Cycle, length=30)Output. Plays the walk cycle forever.

Pendulum / breathing motion

Animated swing 0..60 → Loop(mode=PingPong, length=60)Output. Smoothly reverses each cycle for a continuous back-and-forth.

Hold the last frame

30-frame intro animation → Loop(mode=HoldLast, length=30). Plays the intro once, then freezes on the final frame.

Animated loop length

Time → Math → Loop.length_in. Ramp the loop length to gradually slow down a cycle, or speed it up.

Tips

  • Loop is comp-frame anchored at 0 — the loop window starts at frame 0 of the comp, not the layer's clip start. Use TimeShift upstream of Loop to align differently.
  • For PingPong, an even-cycle starts at 0; odd-cycle plays in reverse. The seam where forward meets reverse is the same content frame (no jump).
  • For animated content with simulations, ensure the simulation is stable across the looped range. Stateful sims like PointAdvect cache by frame index, so cycling re-uses cached past frames cheaply.
  • Time Shift — re-anchor the loop with an offset.
  • Freeze FrameHoldLast is conceptually a Loop whose window matches a single point.
  • Posterize Time — combine with Loop for choppy looped motion.
  • Echo — sample at multiple offsets and blend rather than cycle.
  • FileCache — bake upstream for fast loop reads.