Davinci Resolve / Fusion Expression Cheat Sheet
|
time
Current frame number of the fusion composition
time | time*3 (speed up) | time/3 (slow down)
comp.RenderEnd
Length in frames of the fusion composition
sin()
Math function that returns -1 to 1 over time
sin(time) = -1 to 1
abs()
Math function that always returns a positive value
abs(-42) = 42
floor()
Math function that always rounds a number down
floor(4.77) = 4
ceil()
Math function that always rounds a number up
ceil(4.77) = 5
iif()
Condition check that will return one of two different values. iif(check,valueTrue,valueFalse)
iif(time<40,333,444)
if time==30 this will return 333 min()
Returns the lesser of the 2 values
min(value1,value2)
max()
Returns the greater of the 2 values
max(value1,value2)
random(min,max)
Returns a random number between the min and max values
random(1,10)
Returns a random number between 1 and 10 Point()
Expression that represents a position on the screen in x,y values
Point(x,y)
Point(.5,.5) - Center of screen | Countdown Timer
Counts down from a set number of sections. Example below is for 24 frames per second.
max(floor(60-(time/24)),0)
60=number of seconds for countdown Percent Complete
Use this expression to get a value from 0 (start of composition) to 1 (end of composition).
time/comp.RenderEnd
os.date()
Returns the current date/time in a custom format. Replace the % values.
os.date("today is %A, in %B")
Date/Time Variables
%a abbreviated weekday name (e.g., Wed)%A full weekday name (e.g., Wednesday) %b abbreviated month name (e.g., Sep) %B full month name (e.g., September) %c date and time (e.g., 09/16/98 23:48:10) %d day of the month (16) [01-31] %H hour, using a 24-hour clock (23) [00-23] %I hour, using a 12-hour clock (11) [01-12] %M minute (48) [00-59] %m month (09) [01-12] %p either "am" or "pm" (pm) %S second (10) [00-61] %w weekday (3) [0-6 = Sunday-Saturday] %x date (e.g., 09/16/98) %X time (e.g., 23:48:10) %Y full year (1998) %y two-digit year (98) [00-99] %% the character `%´ Text Width/Height
Use expressions to create a rectangle mask that dynamically matches the width/height of the text
Width of Text1
(Text1.Output.DataWindow[3]-Text1.Output.DataWindow[1])/Text1.Output.Width Height of Text1 Node:GetValue()
Returns a property value at a specific time.
Node:GetValue("Angle",time-30)
Returns the node angle property from 30 frames back Node:GetValue("Center",time-30).Y Returns the node Y position from 30 frames back comp:GetPrefs()
Returns information about the current composition
Frame Rate Width Height |