Expressions allow you to use mathematical formulas and functions to drive parameter values, creating dynamic and procedural effects. Instead of a static number, you can use a live formula that responds to time, animation frames, or other parameters.
To use an expression, right-click a parameter and select “Edit Expression”.
Globals
You can use the following global values in any expression:
- time(): Returns the current animation time in seconds.
- frame(): Returns the current animation frame number.
Referencing Parameters
There are two ways to reference other parameters: self for internal references (on the same node) and ref() for external references (on other nodes). The system automatically enforces this rule to ensure clarity and prevent errors.
The Golden Rule of Referencing
The application automatically chooses the correct syntax for you when you copy and paste parameter references. This ensures that expressions are always clear and presets are always portable.
| If you are referencing… | The syntax will use… | 
|---|---|
| A parameter on the same node | self.parameterName | 
| A parameter on a different node | ref('other_node_id', 'parameterName') | 
The self Object
Use the self object to create relationships between a node’s own properties. The autocomplete menu will show all available properties when you type self.
Example: To make a rectangle’s height always be half of its width: =self.width * 0.5
The ref() Function
Use the ref() function to link a parameter to a value on a different node. It takes two arguments: the ID of the source node and a string path to the source parameter.
Example: To link a rectangle’s width to a circle’s radius: =ref('circle_node_id', 'radius') * 2
Working with Data Types
Integers
You can perform a lot of arithmetic operations on integers. Try live example below.
The expression engine supports more than just numbers. You can also manipulate strings and colors.
Strings
The '+' operator can be used to concatenate (join) strings, like in JavaScript. You can join multiple strings together.
This is useful for creating dynamic labels. If the referenced node has the label 'Primary', the expression will evaluate to the string shown below.
Colors
Color parameters can accept expressions that resolve to a valid HEX color string (e.g., "#ff0000"). This allows you to dynamically link colors between nodes.
Function Reference
The following is a complete list of all built-in functions available in the expression engine.
Time
time()
 Returns the current global animation time in seconds.
frame()
 Returns the current global animation frame number.
Math
if(condition, value_if_true, value_if_false)
 Returns one of two values based on a condition.
ARGUMENTS
| Argument | Description | 
|---|---|
| condition | The expression to evaluate. | 
| value_if_true | The value to return if the condition is true. | 
| value_if_false | The value to return if the condition is false. | 
LIVE EXAMPLE
abs(x)
 Returns the absolute value of a number (making it positive).
ARGUMENTS
| Argument | Description | 
|---|---|
| x | The number. | 
LIVE EXAMPLE
floor(x)
 Returns the largest integer less than or equal to a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | The number. | 
LIVE EXAMPLE
ceil(x)
 Returns the smallest integer greater than or equal to a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | The number. | 
LIVE EXAMPLE
round(x)
 Returns the value of a number rounded to the nearest integer.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | The number. | 
LIVE EXAMPLE
clamp(value, min, max)
 Constrains a number to be within a specific range.
ARGUMENTS
| Argument | Description | 
|---|---|
| value | The value to clamp. | 
| min | The minimum bound. | 
| max | The maximum bound. | 
LIVE EXAMPLE
fit(value, oldMin, oldMax, newMin, newMax)
 Re-maps a number from one range to another. Also known as linear interpolation.
ARGUMENTS
| Argument | Description | 
|---|---|
| value | The incoming value to be converted. | 
| oldMin | The lower bound of the value’s current range. | 
| oldMax | The upper bound of the value’s current range. | 
| newMin | The lower bound of the value’s target range. | 
| newMax | The upper bound of the value’s target range. | 
LIVE EXAMPLE
min(values)
 Returns the smallest of two or more numbers.
ARGUMENTS
| Argument | Description | 
|---|---|
| values | Two or more numbers to compare. | 
LIVE EXAMPLE
max(values)
 Returns the largest of two or more numbers.
ARGUMENTS
| Argument | Description | 
|---|---|
| values | Two or more numbers to compare. | 
LIVE EXAMPLE
pow(base, exponent)
 Returns the base to the exponent power.
ARGUMENTS
| Argument | Description | 
|---|---|
| base | The base number. | 
| exponent | The exponent. | 
LIVE EXAMPLE
sqrt(x)
 Returns the square root of a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | The number. | 
LIVE EXAMPLE
Trigonometry
sin(angle)
 Returns the sine of an angle provided in radians.
ARGUMENTS
| Argument | Description | 
|---|---|
| angle | The angle in radians. | 
LIVE EXAMPLE
cos(angle)
 Returns the cosine of an angle provided in radians.
ARGUMENTS
| Argument | Description | 
|---|---|
| angle | The angle in radians. | 
LIVE EXAMPLE
tan(angle)
 Returns the tangent of an angle provided in radians.
ARGUMENTS
| Argument | Description | 
|---|---|
| angle | The angle in radians. | 
LIVE EXAMPLE
asin(x)
 Returns the arc sine (in radians) of a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | A number between -1 and 1. | 
LIVE EXAMPLE
acos(x)
 Returns the arc cosine (in radians) of a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | A number between -1 and 1. | 
LIVE EXAMPLE
atan(x)
 Returns the arc tangent (in radians) of a number.
ARGUMENTS
| Argument | Description | 
|---|---|
| x | A number. | 
LIVE EXAMPLE
atan2(y, x)
 Returns the angle in radians between the positive x-axis and the point (x, y).
ARGUMENTS
| Argument | Description | 
|---|---|
| y | The y-coordinate. | 
| x | The x-coordinate. | 
LIVE EXAMPLE
deg(radians)
 Converts an angle from radians to degrees.
ARGUMENTS
| Argument | Description | 
|---|---|
| radians | An angle in radians. | 
LIVE EXAMPLE
rad(degrees)
 Converts an angle from degrees to radians.
ARGUMENTS
| Argument | Description | 
|---|---|
| degrees | An angle in degrees. | 
LIVE EXAMPLE
Random
rand(seed)
 Returns a pseudo-random number between 0 and 1. Providing the same seed will always return the same number.
ARGUMENTS
| Argument | Description | 
|---|---|
| seed | An optional seed value. | 
LIVE EXAMPLE
Referencing
ref(nodeId, paramPath)
 Gets the value of a parameter from another node in the graph.
ARGUMENTS
| Argument | Description | 
|---|---|
| nodeId | The ID of the node to reference. | 
| paramPath | The parameter path (e.g., "position.x"). |