After this lesson
- Separate delay, transition and hold.
- Avoid using a condition to guard an unsafe function call.
- Check frames immediately around the boundary.
Before you start
- Composition
- A separate Fusion Composition. 1920×1080, square pixels, 25 fps.
- Parameter
- Merge1 → Blend
- Range
- Start at comp.RenderStart. Reference frames are local unless stated otherwise.
A condition selects a result; a ramp defines a transition. Switching Blend instantly from 0 to 1 and revealing it over 20 frames are different tasks even though both depend on time.
Instant switching
In Simple Expression, use iif(condition, valueIfTrue, valueIfFalse). For example, iif(time - comp.RenderStart < 30, 0, 1) hides the foreground until local frame 30.
Check the comparison: < 30 enables the object on frame 30, while <= 30 does so on the next frame. Lua uses ~= for not equal, not !=.
Delay and gradual rise
To start on frame 30 and finish on frame 50, subtract 30, divide by 20, then clamp to 0…1. The result is 0 before the start and 1 after the end.
math.min(1, math.max(0, (time - comp.RenderStart - 30) / 20))Do not hide an error in the unselected branch
A function call does not guarantee lazy argument evaluation. Do not expect iif to protect division by zero in one branch. Make the denominator valid or restructure the dependency.
min/max is not a universal repair. Clamping a negative angle to 0…1 destroys the intended animation. Choose limits appropriate to the controlled parameter.
A condition does not always prevent branch evaluation
iif looks like a short if statement, but it is a function call. Arguments are prepared before the result is selected; iif(d==0, 0, 1/d) is not reliable division-by-zero protection. Make the denominator safe first when that fits the task. For a positive duration, a minimum of one is reasonable.
Lua and/or short-circuit, but condition and valueA or valueB depends on the truthiness of valueA. If valueA is false or nil, valueB is selected. For numeric animation, avoid such tricks when a clamped ramp or separate controls will suffice.
Check both sides of the boundary
With a delay of 30 and a 20-frame transition, motion starts at local frame 30 and the title is fully visible at 50. It remains hidden at 29. Testing only 0 and 60 would also pass with an incorrect delay of 20. Check the frame before the start, the start, the middle and the end.
Instant switching is useful for states but does not create a smooth reveal. On brightness it may look like a flash; on position, a teleport. Choose the behavior first: the condition defines when to switch, while the transition function defines how to change.
Parameters and ranges
| Parameter | What it changes | Example / check |
|---|---|---|
| 30 | Delay before the rise starts. | The result is 0 beforehand. |
| 20 | Transition duration. | Halfway is reached after 10 intervals. |
| min/max | Holds the limits at 0…1. | The value stops increasing after 50. |
USE IN A COMPOSITION
Build it in Fusion
Merge1 → Blend
Solid lines are node connections in the Flow. A dashed line is a parameter dependency configured in the Inspector.
Connections by port and parameter4
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
- Create Background1 and Text1; connect them to the yellow Background and green Foreground inputs of Merge1 respectively. Connect Merge1 to MediaOut1.
- Enable Expression on Blend.
- Paste the delayed ramp.
- Check local frames 29, 30, 40, 50 and 60.
math.min(1, math.max(0, (time - comp.RenderStart - 30) / 20))Expected result. Values: 0, 0, 0.5, 1, 1. The first visible increase occurs after the ramp starts.
Checkpoints
| When / what to check | Expected | Why check it |
|---|---|---|
| 29 and 30 | 0 | Checks the start boundary. |
| 40 | 0.5 | Middle of the transition. |
| 50 and 60 | 1 | Final hold. |
INTERACTIVE EXAMPLE
Change a parameter. Compare the result.
The reveal starts at the specified frame
Merge1 → Blendunder control.MERGE → BLEND
The delay shifts the ramp's start. Before it, the value is zero; after the transition ends, it is one.
Delay 30, transition 20: frames 29 and 30 → 0; frame 40 → 0.5; frames 50 and 60 → 1.
Formula for the current settings +
math.min(1, math.max(0, ((time - comp.RenderStart) - 30) / 20))This shows a gradual, delayed reveal. Instant switching with iif is covered separately in the article.
Errors and troubleshooting
The title appears one frame early
Compare strict and inclusive boundaries.
The error remains inside iif
Protect the unsafe operation directly; do not rely on lazy function arguments.
Independent exercise
Move the reveal to frame 60 and extend its duration to 40 frames.
Show the solution and explanation
Subtract 60 instead of 30; divide by 40 instead of 20. Blend should be 0.5 at local frame 80.
Continue learning
Official sources
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.