UI Parameters Panel Expressions

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 nodeself.parameterName
A parameter on a different noderef('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.

15

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.

"Hello World"

This is useful for creating dynamic labels. If the referenced node has the label 'Primary', the expression will evaluate to the string shown below.

"Color: Primary"

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.

"#84a9d7"

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.

In simple terms: Think of it like a stopwatch. It starts at 0 and keeps counting seconds as your animation plays.

frame()

Returns the current global animation frame number.

In simple terms: Like time(), but instead of seconds, it counts frames. At 30fps, frame() goes 0, 1, 2... up to 30 in one second.

Math

if(condition, value_if_true, value_if_false)

Returns one of two values based on a condition.

In simple terms: A decision-maker. If the condition is met, it gives you the first value; otherwise, it gives you the second.
ARGUMENTS
ArgumentDescription
conditionThe expression to evaluate.
value_if_trueThe value to return if the condition is true.
value_if_falseThe value to return if the condition is false.
LIVE EXAMPLE
0

abs(x)

Returns the absolute value of a number (making it positive).

In simple terms: Turns any negative number into its positive twin. Like removing the minus sign in front.
ARGUMENTS
ArgumentDescription
xThe number.
LIVE EXAMPLE
10

floor(x)

Returns the largest integer less than or equal to a number.

In simple terms: Think of it like always rounding down. Even 3.9 becomes 3.
ARGUMENTS
ArgumentDescription
xThe number.
LIVE EXAMPLE
3

ceil(x)

Returns the smallest integer greater than or equal to a number.

In simple terms: Always rounds up. Even 3.1 becomes 4.
ARGUMENTS
ArgumentDescription
xThe number.
LIVE EXAMPLE
4

round(x)

Returns the value of a number rounded to the nearest integer.

In simple terms: Normal rounding rules: 3.4 → 3, 3.5 → 4.
ARGUMENTS
ArgumentDescription
xThe number.
LIVE EXAMPLE
4

clamp(value, min, max)

Constrains a number to be within a specific range.

In simple terms: Like a fence that stops values from going lower than min or higher than max.
ARGUMENTS
ArgumentDescription
valueThe value to clamp.
minThe minimum bound.
maxThe maximum bound.
LIVE EXAMPLE
90

fit(value, oldMin, oldMax, newMin, newMax)

Re-maps a number from one range to another. Also known as linear interpolation.

In simple terms: Acts like a translator for numbers. Example: a speedometer reading 0–1 can be translated to 0–100 km/h.
ARGUMENTS
ArgumentDescription
valueThe incoming value to be converted.
oldMinThe lower bound of the value’s current range.
oldMaxThe upper bound of the value’s current range.
newMinThe lower bound of the value’s target range.
newMaxThe upper bound of the value’s target range.
LIVE EXAMPLE
50

min(values)

Returns the smallest of two or more numbers.

In simple terms: Picks the smallest number from the group. Like finding the shortest kid in class.
ARGUMENTS
ArgumentDescription
valuesTwo or more numbers to compare.
LIVE EXAMPLE
150

max(values)

Returns the largest of two or more numbers.

In simple terms: Picks the biggest number from the group. Like finding the tallest kid in class.
ARGUMENTS
ArgumentDescription
valuesTwo or more numbers to compare.
LIVE EXAMPLE
0

pow(base, exponent)

Returns the base to the exponent power.

In simple terms: Like saying base × base × base... exponent times. Example: pow(2,3) = 2×2×2.
ARGUMENTS
ArgumentDescription
baseThe base number.
exponentThe exponent.
LIVE EXAMPLE
8

sqrt(x)

Returns the square root of a number.

In simple terms: What number multiplied by itself gives you x? sqrt(16) = 4, because 4×4 = 16.
ARGUMENTS
ArgumentDescription
xThe number.
LIVE EXAMPLE
4

Trigonometry

sin(angle)

Returns the sine of an angle provided in radians.

In simple terms: Makes a smooth wave going up and down between -1 and 1. Great for making bouncing or swinging motions.
ARGUMENTS
ArgumentDescription
angleThe angle in radians.
LIVE EXAMPLE
1

cos(angle)

Returns the cosine of an angle provided in radians.

In simple terms: Like sin(), but shifted. Starts at 1 instead of 0. Together with sin(), it makes circles.
ARGUMENTS
ArgumentDescription
angleThe angle in radians.
LIVE EXAMPLE
6.123233995736766e-17

tan(angle)

Returns the tangent of an angle provided in radians.

In simple terms: It’s like sin ÷ cos. Often used for slopes or angles of steepness.
ARGUMENTS
ArgumentDescription
angleThe angle in radians.
LIVE EXAMPLE
0.9999999999999999

asin(x)

Returns the arc sine (in radians) of a number.

In simple terms: The reverse of sin(). You give it the wave value (between -1 and 1), it tells you the angle.
ARGUMENTS
ArgumentDescription
xA number between -1 and 1.
LIVE EXAMPLE
1.5707963267948966

acos(x)

Returns the arc cosine (in radians) of a number.

In simple terms: Reverse of cos(). Give it a cos value, it tells you the angle.
ARGUMENTS
ArgumentDescription
xA number between -1 and 1.
LIVE EXAMPLE
1.5707963267948966

atan(x)

Returns the arc tangent (in radians) of a number.

In simple terms: Reverse of tan(). Feed it a slope value, it tells you the angle.
ARGUMENTS
ArgumentDescription
xA number.
LIVE EXAMPLE
0.7853981633974483

atan2(y, x)

Returns the angle in radians between the positive x-axis and the point (x, y).

In simple terms: Imagine drawing a line from the origin (0,0) to (x,y). atan2 tells you the angle of that line.
ARGUMENTS
ArgumentDescription
yThe y-coordinate.
xThe x-coordinate.
LIVE EXAMPLE
0.7853981633974483

deg(radians)

Converts an angle from radians to degrees.

In simple terms: Changes the unit from “radians” (math mode) to “degrees” (like on a protractor).
ARGUMENTS
ArgumentDescription
radiansAn angle in radians.
LIVE EXAMPLE
180

rad(degrees)

Converts an angle from degrees to radians.

In simple terms: Turns degrees (circle slices you know from school) into radians (circle slices math prefers).
ARGUMENTS
ArgumentDescription
degreesAn angle in degrees.
LIVE EXAMPLE
3.141592653589793

Random

rand(seed)

Returns a pseudo-random number between 0 and 1. Providing the same seed will always return the same number.

In simple terms: Gives you a random number between 0 and 1. If you use a seed (like frame number), it’s repeatable instead of different every time.
ARGUMENTS
ArgumentDescription
seedAn optional seed value.
LIVE EXAMPLE
0.9650931040878277

Referencing

ref(nodeId, paramPath)

Gets the value of a parameter from another node in the graph.

In simple terms: Lets you “wire up” one parameter to another, so when one changes, the other follows.
ARGUMENTS
ArgumentDescription
nodeIdThe ID of the node to reference.
paramPathThe parameter path (e.g., "position.x").
LIVE EXAMPLE
300

See Also