Skip to content
VIDEOMONTAZHERDAVINCI RESOLVE · VIDEO · AI

FUSION · Practical recipes

A progress bar with a fixed left edge

Animate the mask width and compensate its position so the bar grows from left to right rather than from the center.

Fusion / DaVinci Resolve 20–21; check the interface in your build

After this lesson

  • Keep the left edge of a growing bar fixed.
  • Link two parameters on one mask without creating a cycle.
  • Check the start and end of the fill.

Before you start

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

Rectangle defines its width relative to its center. Changing only Width makes the bar grow in both directions. To keep the left edge fixed, Center must move by half the current width.

Graph

The fill and track use two separate mask branches. Connect Rectangle1 to BackgroundFill's blue Effect Mask input; connect the static RectangleTrack to BackgroundTrack's blue Effect Mask input. BackgroundTrack's output goes to MergeTrack's yellow Background input, and BackgroundFill goes to its green Foreground input.

Composite the resulting bar over the main Background1 using Merge1: connect Background1 to the yellow input and MergeTrack to the green input. Connect Merge1 to MediaOut1. The target bar spans X=0.2 to X=0.8, giving a maximum width of 0.6. Both masks have Height=0.04; the top and bottom edges are not animated.

Width

For Width, enter a clamped ramp multiplied by 0.6. The value reaches its maximum after 100 frames and stays there.

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

Compensating the center

Use the expression below for Center. The left edge is centerX-width/2, which is always 0.2. Do not link Width back to Center: that would create a cycle.

SIMPLE EXPRESSION · FUSION
Point(0.2 + Rectangle1.Width/2, 0.5)

Checkpoints

Local frame 0: Width=0, so the fill is invisible. Frame 50: Width=0.3 and Center.X=0.35. Frame 100: Width=0.6 and Center.X=0.5. In all three cases, the left edge stays at 0.2.

This requires two dependencies, not just one

A rectangle mask expands around its Center. A Width formula alone makes the bar grow in both directions. For rightward growth only, set Center.X = L + Width/2, where L is the fixed left edge. Center.X−Width/2 then always equals L, regardless of progress.

Use L=0.2 and a maximum width of 0.6: the complete bar spans X=0.2 to X=0.8. Halfway through the duration, Width=0.3 and Center.X=0.35. Do not link Width back to Center: that would create a circular dependency. The dependency graph runs in one direction: time → Width → Center.

SIMPLE EXPRESSION · FUSION
Point(0.2 + Rectangle1.Width/2, 0.5)

The track, rounded corners and 100%

For a stationary track, create a separate RectangleTrack with Width=0.6, Height=0.04 and Center=(0.5,0.5). Connect it to the blue Effect Mask input of a darker BackgroundTrack. Use MergeTrack to place the track under BackgroundFill: the yellow Background input receives the track, and the green Foreground input receives the fill. Do not use the same animated mask for both Background nodes, or both parts will grow.

At zero width, the mask result may be practically invisible, as intended. Soft Edge, Border Width and pronounced rounding affect the apparent edge, so first check the geometry without them. If you need a percentage counter, derive it from the same clamped progress rather than independent time with a different denominator. After 100 frames, the width holds instead of continuing to grow.

Parameters and ranges

ParameterWhat it changesExample / check
L=0.2The fixed left edge.Center.X − Width/2 = 0.2.
0.6Maximum normalized width.1152 pixels in Full HD.
100Fill duration in frame intervals.Frame 100 is the first exact 100% state.
Height=0.04Mask height.Approximately 43 pixels at 1080p.
RectangleTrackThe stationary track mask beneath the fill.Width=0.6; Height=0.04; Center=(0.5,0.5); no animation.

USE IN A COMPOSITION

Build it: from an empty composition to verification

Rectangle1 → Width, then Center

FUSION / FLOWMask, fill and a fixed left edge
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 → Rectangle1.Width / CenterRectangle1.Mask → BackgroundFill.Effect MaskRectangleTrack.Mask → BackgroundTrack.Effect MaskBackgroundTrack.Output → MergeTrack.BackgroundBackgroundFill.Output → MergeTrack.ForegroundMergeTrack.Output → Merge1.ForegroundBackground1.Output → Merge1.BackgroundMerge1.Output → MediaOut1.InputExpression · Expression · InspectorEXPRESSIONExpressionWidth + CenterRectangle1 · Mask node · FlowMRectangle1RectangleWidth / CenterWidth / Center · an Inspector parameter, not an image portBackgroundFill · Image node · Flow▧BackgroundFillBackgroundRectangleTrack · Mask node · FlowMRectangleTrackRectangleBackgroundTrack · Image node · Flow▧BackgroundTrackBackgroundMergeTrack · Image node · Flow⊕MergeTrackMergeBackground1 · Image node · Flow▧Background1BackgroundMerge1 · Image node · Flow⊕Merge1MergeMediaOut1 · Image node · Flow↗MediaOut1MediaOut
Parameter · InspectorEffect MaskBackgroundForegroundImage
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 parameter8

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

One driving value controls both the width and the compensating offset.

Assembly steps

  1. Create a 1920×1080 Fusion Composition with square pixels at 25 fps. Leave at least 151 frames for checking: local range 0…150.
  2. Add BackgroundFill and Rectangle1, keeping these names. Connect Rectangle1's output to BackgroundFill's blue Effect Mask input. Choose the fill color on BackgroundFill and set Alpha=1.
  3. On Rectangle1, set Height=0.04, Soft Edge=0 and Corner Radius=0, and enable Solid. Start with Width=0.6 and Center=(0.5,0.5) so you can check the bar's shape in the Viewer before animating it.
  4. Enable Expression on Width and paste the formula beneath the assembly steps. Then enable Expression on Center and enter the formula from “Compensating the center”: Point(0.2 + Rectangle1.Width/2, 0.5). The reference must point to this same Rectangle1.
  5. Create separate RectangleTrack and BackgroundTrack nodes. Set the track mask to Width=0.6, Height=0.04, Center=(0.5,0.5), Soft Edge=0 and Corner Radius=0, with Solid enabled. Connect it to BackgroundTrack's blue Effect Mask input, choose a darker color, and set Alpha=1. This mask must have no keyframes or expressions.
  6. Add MergeTrack: connect BackgroundTrack to the yellow Background input and BackgroundFill to the green Foreground input. The fill now sits over the stationary track.
  7. Add the main Background1 and final Merge1. Connect Background1 to Merge1's yellow Background input and MergeTrack's output to its green Foreground input. Connect Merge1 to MediaOut1 and display the result in the Viewer.
  8. Check local frames 0, 50, 100 and 150. At zero, only the track is visible; at 50, the bar is half full; from 100 onward, the fill reaches the end. At every frame, Rectangle1's Center.X−Width/2 must equal 0.2.
  9. Add rounding and smoothing only after checking the geometry. Check the edge again: styling must not conceal a change in its actual position.
SIMPLE EXPRESSION · FUSION
0.6 * math.min(1, math.max(0, (time-comp.RenderStart)/100))

Expected result. The bar fills from left to right without moving its left edge.

Checkpoints

When / what to checkExpectedWhy check it
0Width=0; Center.X=0.2There is no fill, but the stationary track remains visible.
50Width=0.3; Center.X=0.35Half full.
100Width=0.6; Center.X=0.5Full length.
150The same values as at frame 100The upper clamp is active.

INTERACTIVE EXAMPLE

Change a parameter. Compare the result.

INTERACTIVE EXAMPLE

Progress bar

CONTROLLED INPUTRectangle1 → Width + Center
VIEWER · FORMULA EVALUATIONPREVIEW
FUSION / PROCEDURAL DESIGN

Every frame
in its place.

LEFT EDGE: 0.238%
TEACHING VIEWER0038 f
0 f← → one frame at a time25 fps
VALUE GRAPH
Value
-0.070.30.670 f75 f150 f
Select a point on the graph to go to that frame. Values are checked throughout the range.

Width grows while Center compensates for half the change. The left edge stays at x = 0.2.

VALUE AT THIS FRAME 380.228
CHECK THE DEPENDENCY

Move past the transition end. The value should hold rather than keep increasing.

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

The bar grows from the center

The compensating Center formula has not been added.

The dependency is circular

Width depends only on time; Center reads Width, but not the other way around.

The track grows with the fill

Check BackgroundTrack's blue connection: it needs a separate, static RectangleTrack. The animated Rectangle1 must control only BackgroundFill.

Independent exercise

The left edge is 0.1 and the maximum width is 0.8. How should the formulas change?

Show the solution and explanation

Use a multiplier of 0.8 for Width and a base of 0.1 for Center: Point(0.1 + Rectangle1.Width/2, 0.5).

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.