Skip to content
VIDEOMONTAZHERDAVINCI RESOLVE · VIDEO · AI

FUSION · Expressions

Time, frames, fps and composition boundaries

Why time is not seconds, how to account for RenderStart, and where off-by-one errors appear.

Fusion / DaVinci Resolve 20–21

After this lesson

  • Convert frames to seconds without an implicit fps value.
  • Distinguish absolute and local frames.
  • Count inclusive ranges correctly.

Before you start

Composition
A separate Fusion Composition. 1920×1080, square pixels, 25 fps.
Parameter
Transform1 → Angle
Range
Start at comp.RenderStart. Reference frames are local unless stated otherwise.

Most unusual-looking expressions are behaving correctly but using a different time system. Distinguish the absolute composition frame, local time, seconds and normalized progress.

Four different quantities

time is the requested time in frame units. time - comp.RenderStart is the offset from the render range start. Divide that offset by the frame rate to get seconds, or by the interval length to get relative progress.

RenderStart is a composition range boundary, not a universal promise of the first visible frame after every trim or nesting operation. Check the start on the actual Fusion Clip or title in Edit. These recipes specify fps explicitly: a variable named fps does not appear automatically.

One turn per second

For a 25 fps composition, the following formula produces 360 degrees in 25 frames. At 50 fps, replace 25 with 50 to preserve the speed in seconds.

SIMPLE EXPRESSION · FUSION
360 * (time - comp.RenderStart) / 25

Inclusive boundaries

The range 0…99 contains 100 frames, but 99 frame intervals separate its first and last samples. For progress reaching 1 exactly on the last frame, use RenderEnd - RenderStart. Add 1 when counting frames.

A one-frame composition has an interval length of zero: protect the denominator. Motion blur may request intermediate times, so avoid rounding time unnecessarily.

SIMPLE EXPRESSION · FUSION
math.min(1, math.max(0, (time - comp.RenderStart) / math.max(1, comp.RenderEnd - comp.RenderStart)))

Independence from evaluation order

Do not build animation by accumulating a value from the previous frame. Fusion may evaluate frames out of order, go backwards and use a cache. A sound procedural formula determines its result only from its inputs and time.

Lock seconds or frames?

360*t/25 produces one turn over 25 frame intervals. At 25 fps that is one second; at 50 fps it is half a second. The expression cannot discover the frame rate from the number 25. When transferring it, update the divisor or expose an FPS control matching the composition.

Decide the creative requirement first: should the title appear over 12 frames or 0.48 seconds? For the former, keep 12 when changing fps. For the latter, recalculate the frame duration. For long clocks and stopwatches, do not round 23.976 or 29.97 to 24 or 30; the discrepancy accumulates.

Why end minus start is not the frame count

0…100 contains 101 displayed frames and 100 intervals between them. To make progress exactly 0 on the first frame and 1 on the last, divide by 100. To calculate the duration of 101 frames at 25 fps, use 101/25=4.04 seconds. These are different questions, and each formula is correct for its purpose.

A one-frame range has zero intervals. math.max(1, end−start) prevents division by zero, but progress remains 0. This is deliberate behavior, not a way to display the final state automatically. Choose the state of a one-frame title separately.

RangeFramesIntervals
0…100101100
1001…1101101100
20…2010

Parameters and ranges

ParameterWhat it changesExample / check
timeThe requested evaluation time.Not a real-time playback counter.
comp.RenderStartStart of the render range.Use it as local zero.
comp.RenderEndThe final frame of the range.Subtract the start for normalization.
fpsThe frame rate specified in the formula.At 25 fps, one turn takes 25 intervals.

USE IN A COMPOSITION

Build it in Fusion

Transform1 → Angle

FUSION / FLOWNodes and parameter control
100%
ImageControl in the InspectorScroll or drag the graph. Choose “Fit” to see all of it.
Solid lines are node connections in the Flow. A dashed line is a parameter dependency configured in the Inspector. A solid arrow's color matches its destination input. Modifiers are shown separately from the Flow.control.Value → Transform1.AngleText1.Output → Transform1.InputTransform1.Output → MediaOut1.InputExpression · Expression · InspectorEXPRESSIONExpressionSimple ExpressionText1 · Image node · FlowT+Text1Text+Transform1 · Image node · FlowƒTransform1TransformAngleAngle · an Inspector parameter, not an image portMediaOut1 · Image node · Flow↗MediaOut1MediaOut
Parameter · InspectorImage
Select a node or a colored arrow

Solid lines are node connections in the Flow. A dashed line is a parameter dependency configured in the Inspector.

Connections by port and parameter3

Color is determined by the destination input. Dashed connections are configured in the Inspector; they do not add an RGBA wire to the Flow.

Assembly steps

  1. Use an asymmetric shape or word.
  2. Set the composition frame rate to 25 fps.
  3. Add the formula to Angle.
  4. Compare the start with the frame 25 frames later.
SIMPLE EXPRESSION · FUSION
360 * (time - comp.RenderStart) / 25

Expected result. One second produces a complete turn; the numeric angle continues increasing.

Checkpoints

When / what to checkExpectedWhy check it
0Angle=0°Starting orientation.
6.25Angle=90°A mathematical quarter-cycle; it may fall between whole frames.
25Angle=360°The orientation matches 0°, but the numeric value differs.
Start 1001, frame 1026Angle=360°Moving the start does not move the phase.

INTERACTIVE EXAMPLE

Change a parameter. Compare the result.

INTERACTIVE EXAMPLE

Rotation

CONTROLLED INPUTTransform1 → Angle
VIEWER · FORMULA EVALUATIONPREVIEW
F
ONE REVOLUTION — 360°
TEACHING VIEWER0025 f
0 f← → one frame at a time25 fps
VALUE GRAPH
Value
-172.87201612.80 f50 f100 f
Select a point on the graph to go to that frame. Values are checked throughout the range.

A linearly increasing angle. The graph shows complete revolutions; the Viewer shows the object's orientation.

VALUE AT THIS FRAME 25360
CHECK THE DEPENDENCY

Choose the start, middle and end of the range. Compare the number beneath the preview with its position on the graph.

The formula runs in the browser; the preview shows its result on a teaching object. Fusion's image processing is not reproduced here.

Errors and troubleshooting

Speed changed after changing fps

A period in frames and a duration in seconds are different settings.

The animation does not start at zero

Check RenderStart, clip boundaries and the actual range instead of subtracting a guessed timeline frame number.

Independent exercise

How many frames are in 1001…1100, and what denominator produces progress from 0 to 1?

Show the solution and explanation

100 frames; the distance between the endpoints is 99. Divide by 99 to reach one on the last frame.

Continue learning

Official sources

Blackmagic Design · Fusion Reference ManualThe chapter “Using Modifiers, Expressions, and Custom Controls”. Page numbers depend on the PDF edition.
Blackmagic Design · Modifiers referenceThe Modifiers section. Available commands depend on the input type and Fusion version.

An original educational walkthrough. The browser model explains the principle but does not run Fusion. Control placement depends on the version; save the original composition before replacing a parameter's control source.