Skip to content
VIDEOMONTAZHERDAVINCI RESOLVE · VIDEO · AI

FUSION · Expressions

Debugging and robust expressions

Systematic diagnosis: type, time, source, mathematics, cache and edge cases.

Fusion / DaVinci Resolve 20–21

After this lesson

  • Locate an error source step by step.
  • Check types, ranges and dependent nodes.
  • Separate expression evaluation from cache and display issues.

Before you start

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

A long formula is easier to debug by reducing it temporarily to a minimal working case. Do not change syntax, nodes and viewing settings simultaneously; otherwise you cannot tell which change helped.

A diagnostic ladder

Start with a constant of the correct type: 1 for Size, Point(0.5,0.5) for Center, Text("Test") for Styled Text. Then check time. Add one reference next, and only then the complete mathematics.

Check the exact node name, input ID, case, parentheses and quotes. Copy the error message before making further changes. An image in the Viewer does not prove that the intended input updated.

Boundary cases

Required checks include the start, end, switching point and the frames immediately before and after it. Test zero, minimum and very large periods. Test a zero denominator for division and a negative argument for sqrt.

Check backward scrubbing and direct jumps to arbitrary frames. The result must not depend on playback history.

The source of the displayed result

Display both the changed node and final MediaOut. If cache is suspect, compare live and cached evaluation using the options available in your Resolve version. Clearing cache does not fix a mathematical error.

The cost of dependencies

Hundreds of cross-time requests and deep reference chains complicate evaluation. Use shared controls, avoid repeated expensive requests and cycles, and measure performance at the final resolution and duration.

Three problem classes need different checks

A syntax error prevents evaluation: look for an extra parenthesis, decimal comma, incorrect ID or unavailable function. A numeric error produces an invalid value: division by zero, a negative square-root argument or an excessive range. A visual error can occur with a correct number: the wrong Viewer, control on the wrong branch, or multiplying transforms.

Do not fix visual problems with random formula coefficients. Set a constant first, confirm that the intended parameter controls the object, and only then restore dependencies. This makes the check reproducible instead of relying on a lucky frame.

ObservationFirst checkNext step
The expression is rejectedSet it to 1Check syntax and IDs one at a time.
Fails at only one pointCheck neighboring framesLook for a zero denominator or a type change.
Correct number, wrong imageCompare the Viewer with the node outputCheck the branch and repeated Transform nodes.
Stopped working after copyingCheck source namesRestore references through Pick Whip.

Out-of-order checks are more useful than one playback

Rendering may request frames in a different order from preview. Compare frames 0, 50, 12 and 50: both requests for 50 must match for deterministic animation. A formula that accumulates state from the previous call is unreliable for arbitrary rendering.

Record initial conditions for external sources: fps, frame format, node names, seed, range, version and dependencies. When machines produce different results, this list supports diagnosis rather than guessing. Missing fonts and plugins especially matter in templates: the mathematics can work while the final image differs.

Parameters and ranges

ParameterWhat it changesExample / check
ConstantChecks the connection between the parameter and image.1 for Size; 0/1 for Blend.
Local timeChecks the time system.Compare the absolute frame with RenderStart.
External referenceChecks whether the source exists.Recreate it using Pick Whip.
Repeated requestChecks determinism.Request one frame twice after visiting another time.

USE IN A COMPOSITION

Build it in Fusion

Transform1 → Size

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.SizeText1.Output → Transform1.InputTransform1.Output → MediaOut1.InputExpression · Expression · InspectorEXPRESSIONExpressionSimple ExpressionText1 · Image node · FlowT+Text1Text+Transform1 · Image node · FlowƒTransform1TransformSizeSize · 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. Save the original formula to a text file.
  2. Check a constant 1.
  3. Check a simple sine wave without external nodes.
  4. Restore external dependencies one at a time and note when the error appears.
SIMPLE EXPRESSION · FUSION
1 + 0.1 * math.sin(2 * math.pi * (time-comp.RenderStart)/60)

Expected result. The problem is narrowed to a specific input, reference or mathematical operation.

Checkpoints

When / what to checkExpectedWhy check it
Constant 1Unchanging sizeExcludes the mathematics.
Pure sine wave0.9…1.1Checks local calculation.
One external dependency at a timeThe failure is isolated to a specific referenceDo not restore the entire graph at once.
Repeat frame 50The same resultChecks dependence on time and inputs alone.

INTERACTIVE EXAMPLE

Change a parameter. Compare the result.

INTERACTIVE EXAMPLE

Pulse

CONTROLLED INPUTTransform1 → Size
VIEWER · FORMULA EVALUATIONPREVIEW
VIDEOMONTAZHER / FUSION

Motion
in the details.

TEACHING VIEWER0015 f
0 f← → one frame at a time25 fps
VALUE GRAPH
Value
0.8811.120 f30 f60 f
Select a point on the graph to go to that frame. Values are checked throughout the range.

Size varies around a base value. Amplitude sets the maximum deviation; period determines the speed.

VALUE AT THIS FRAME 151.1
CHECK THE DEPENDENCY

Set amplitude to 0: the size stops changing. Halve the period: cycles occur twice as often.

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

After several changes, the failure is unclear

Return to the last minimal working example.

Works only when played from the beginning

Remove accumulated state and dependencies on frame evaluation order.

Independent exercise

A formula works with period 60 but fails at Period=0. What should be checked first?

Show the solution and explanation

Division by the period. Limit the control and protect the denominator inside the expression. Then test negative and fractional periods.

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.