Add an expression
Enable Expr on a supported parameter, choose ExprTK or Tcl, enter a formula and apply it. The language is saved with the parameter.
Use Copy expression and Paste expression from the parameter menu. Copy animation separately, then paste it at its original frames or relative to the current frame.
How the value is chosen
An enabled, valid expression overrides animation. Otherwise Comp uses the animation track, then the constant value. Disable the expression to return to the existing keys or value.
Invalid expressions show a diagnostic. Expression edits support undo and redo.
Choose the language
ExprTK handles numeric formulas. Tcl handles numeric formulas or text templates, depending on the parameter type.
| Mode | Use it for | Example |
|---|---|---|
| ExprTK | Numeric formulas, interpolation, color conversions and sampling another parameter. | mix(0, 100, smoothstep(1, 24, frame)) |
| Tcl, numeric target | Numeric formulas, parameter and metadata lookups, or the ExprTK bridge. | [metadata lens.focal 50] |
| Tcl, text or file-path target | Literal text with the supported bracket commands inserted into it. | shot.[format %04d [frame]].exr |
ExprTK arithmetic uses + - * / % ^, with ^ for powers. Comparisons use < <= == != >= >; the aliases = and <> also work. Logic uses and or xor nand nor xnor, not(x), and the short-circuit operators & and |.
Tcl arithmetic uses + - * / % , with for powers. Comparisons use < <= == != >= >; logic uses &&, || and !. Integer operations also support ~ & | ^ << >>: here ^ means bitwise XOR. Use int(frame) when an integer operand is needed, and use a decimal such as 100.0 to avoid integer division.
Both numeric modes support condition ? value_if_true : value_if_false. Parentheses group an expression; commas separate function arguments. For example, frame < 24 ? 0 : 1 switches from 0 to 1 at frame 24.
Supported parameter types
| Parameter | Support |
|---|---|
| Integer, Float and Double | Numeric expressions with ExprTK or Tcl. |
| Text and ordinary file paths | Tcl expressions where the parameter exposes expression controls. Node names and dedicated camera/lens import paths remain fixed controls. |
| Dropdowns | Normally fixed choices. Reformat / Filter explicitly supports expressions. |
| Checkboxes, colors, splines and parametric curve collections | No general expression support. |
Context values
Use the bare names in either numeric mode, such as frame / fps. In a Tcl text template, insert the corresponding bracket command, such as frame_[frame].
| Value | Meaning | Tcl command |
|---|---|---|
frame | Current frame number. | [frame] |
time | Current time in seconds, based on frame and project FPS. | [time] |
fps | Project frame rate. | [fps] |
frame_start, frame_end, frame_count | Composition frame range and inclusive length. | [frame_start], [frame_end], [frame_count] |
comp_width, comp_height | Composition size in pixels. | [comp_width], [comp_height] |
comp_aspect | Composition width divided by height. | [comp_aspect] |
comp_center_x, comp_center_y | Half the composition width and height. | [comp_center_x], [comp_center_y] |
pi, e | Mathematical constants. | [pi], [e] |
ExprTK also provides true, false, epsilon and inf. Use 1 and 0 for Tcl conditions. A numeric expression must return a finite number, even when inf is used as an intermediate bound.
Reference another parameter
Use this.parameter for another parameter on the current node and NodeName.parameter for a parameter elsewhere in the graph. References use exact, identifier-style node names and parameter keys. They support frame offsets such as (t-2) and fractional offsets such as (t-0.5).
For these examples, name a Transform node Driver and animate its translateX parameter. Put the expression on a different numeric parameter.
Scale another parameter:
Driver.translateX * 2Read two frames earlier:
Driver.translateX(t-2)Sample at an explicit frame with ExprTK:
value(Driver.translateX, frame - 2)Sample the same parameter with Tcl:
[value Driver.translateX t-2]t means the current frame inside a reference suffix or Tcl frame argument. It is not a standalone context variable.
An explicit frame argument sets the base frame. Reference offsets are applied relative to it; combine them only when both are intended.
Use the actual parameter key. Referencing a parameter from its own expression creates a cycle. Renaming a node updates supported references, and circular dependencies produce diagnostics.
Examples
The following formulas use ExprTK.
An oscillating value with an amplitude of 5 around 10:
10 + 5 * sin(frame / 10)A 0–1 ramp over 100 frames. ExprTK's argument order is clamp(lower, value, upper):
clamp(0, (frame - frame_start) / 100.0, 1)Repeatable organic variation:
6 * (noise(frame / 8.0) - 0.5)A smooth move from 0 to 100 between frames 1 and 24:
mix(0, 100, smoothstep(1, 24, frame))A repeatable per-frame offset, centered around zero:
20 * (random(frame, 7) - 0.5)A numeric sRGB value converted to linear light:
from_sRGB(0.5)ExprTK math functions
Arguments such as x, a and b can be numbers or numeric expressions; ... allows more comma-separated arguments.
| Functions | Use | Example |
|---|---|---|
abs(x), sgn(x) | Absolute value and sign: −1, 0 or 1. | abs(-5) → 5 |
ceil(x), floor(x), round(x), trunc(x), frac(x) | Rounding, truncation and the fractional part. | floor(2.8) → 2 |
roundn(x, digits) | Round to a number of decimal places. | roundn(1.2345, 2) → 1.23 |
min(a, b, ...), max(a, b, ...), sum(a, b, ...), avg(a, b, ...), mul(a, b, ...) | Minimum, maximum, sum, average and product. | avg(2, 4, 6) → 4 |
clamp(lower, x, upper) | Keep x within the bounds. | clamp(0, 1.5, 1) → 1 |
iclamp(lower, x, upper) | Move a value inside the interval to the nearest boundary; leave outside values alone. | iclamp(0, 0.25, 1) → 0 |
inrange(lower, x, upper) | Return 1 inside the inclusive interval, otherwise 0. | inrange(1, frame, 24) |
pow(x, power), root(x, degree), sqrt(x) | Powers and roots. | root(27, 3) → 3 |
mod(x, divisor) | Floating-point remainder. | mod(5.5, 2) → 1.5 |
exp(x), expm1(x) | Exponential, and exponential minus 1. | exp(0) → 1 |
log(x), log10(x), log2(x), logn(x, base), log1p(x) | Natural, base-10, base-2 and arbitrary-base logarithms; natural log of 1+x. | logn(8, 2) → 3 |
sin(x), cos(x), tan(x), cot(x), sec(x), csc(x) | Trigonometry in radians and reciprocal functions. | sin(pi / 2) → 1 |
asin(x), acos(x), atan(x), atan2(y, x) | Inverse trigonometry, returning radians. | atan2(1, 1) → pi/4 |
sinc(x) | sin(x)/x, with a value of 1 at zero. | sinc(0) → 1 |
sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) | Hyperbolic functions and their inverses. | cosh(0) → 1 |
deg2rad(x), rad2deg(x), deg2grad(x), grad2deg(x) | Convert angles between degrees, radians and gradians. | rad2deg(pi) → 180 |
hypot(x, y) | Length of a two-component vector. | hypot(3, 4) → 5 |
erf(x), erfc(x), ncdf(x) | Error function, complementary error function and standard normal cumulative distribution. | ncdf(0) → 0.5 |
equal(a, b), not_equal(a, b) | Numeric equality checks with ExprTK's floating-point tolerance. | equal(0.1 + 0.2, 0.3) → 1 |
mand(a, b, ...), mor(a, b, ...), not(x) | All/any non-zero tests and logical negation. | mand(1, 2, 0) → 0 |
shl(x, n), shr(x, n) | Multiply or divide by 2 to the integer power n. | shl(3, 2) → 12 |
Comp helpers for ExprTK
In Tcl, call these ExprTK helpers through [expression ...].
| Function | Use and arguments | Example |
|---|---|---|
random() | Repeatable random value in [0, 1), changing with the frame. Supply one to four numeric seeds to make it depend on those seeds instead. | random(frame, 7) |
noise(x), noise(x, y), noise(x, y, z) | Smooth repeatable noise in [0, 1]. | noise(frame / 8.0) |
fbm(x), fbm(x, y), fbm(x, y, z), fbm(x, y, z, octaves) | Layered noise in [0, 1]. The default is 4 octaves; an explicit count is rounded and limited to 1–12. | fbm(frame / 16.0, 0, 0, 6) |
turbulence(x), turbulence(x, y), turbulence(x, y, z), turbulence(x, y, z, octaves) | Layered absolute noise in [0, 1], with the same octave options as fbm. | turbulence(frame / 16.0, 0, 0, 6) |
value(reference), value(reference, frame) | Read a numeric parameter at the current or specified frame. The first argument must be a direct parameter reference. | value(Driver.translateX, frame - 2) |
curve(reference), curve(reference, frame) | The same parameter-sampling operation as value in this release. It does not bypass expressions or access HueCorrect's parametric curves. | curve(Driver.translateX, frame - 0.5) |
mix(a, b, amount), lerp(a, b, amount) | Linear interpolation: a + (b−a)×amount. The amount is not clamped. | mix(2, 10, 0.25) → 4 |
step(edge, x) | Return 0 below the edge, otherwise 1. | step(24, frame) |
smoothstep(edge0, edge1, x) | A smooth 0–1 transition, clamped outside the two edges. | smoothstep(1, 24, frame) |
from_sRGB(x), to_sRGB(x) | Decode an sRGB scalar to linear light, or encode a linear scalar as sRGB. | to_sRGB(from_sRGB(0.5)) → 0.5 |
from_rec709f(x), to_rec709f(x) | Decode a Rec.709 scalar to linear light, or encode it back. | to_rec709f(from_rec709f(0.5)) → 0.5 |
from_byte(x) | Divide a byte-scale scalar by 255. | from_byte(128) → about 0.502 |
to_byte(x) | Clamp a scalar to [0, 1], multiply by 255 and round. | to_byte(0.5) → 128 |
Noise and random results are repeatable for the same inputs and evaluation context. They drive parameter values; they do not generate image pixels directly.
Tcl math functions
Only the 28 functions below are available in Tcl numeric expressions and [expr ...]. Use parentheses and commas, as in pow(2, 3).
| Functions | Use | Example |
|---|---|---|
abs(x) | Absolute value. | abs(-5) → 5 |
ceil(x), floor(x), round(x) | Rounding. | round(2.6) → 3 |
int(x), wide(x), entier(x), double(x) | Convert numeric types; the integer conversions truncate toward zero. | double(5) / 4 → 1.25 |
sqrt(x), isqrt(integer) | Square root and integer square root. | isqrt(81) → 9 |
pow(x, power), exp(x) | Power and exponential. | pow(2, 3) → 8 |
log(x), log10(x) | Natural and base-10 logarithms. | log10(100) → 2 |
sin(x), cos(x), tan(x) | Trigonometry in radians. | cos(0) → 1 |
asin(x), acos(x), atan(x), atan2(y, x) | Inverse trigonometry, returning radians. | atan2(1, 1) → pi/4 |
sinh(x), cosh(x), tanh(x) | Hyperbolic functions. | sinh(0) → 0 |
fmod(x, divisor), hypot(x, y) | Floating-point remainder and two-component length. | hypot(3, 4) → 5 |
min(a, b, ...), max(a, b, ...) | Minimum and maximum of numeric arguments. | min(1, max(0, frame / 100.0)) |
ExprTK helpers such as clamp, mix, smoothstep and the color conversions are not Tcl math functions. Use the [expression ...] bridge when needed:
[expression mix(0, 100, smoothstep(1, 24, frame))]Tcl bracket commands
Only the commands below and the 13 context commands listed earlier are supported. Square brackets insert results; commands can be nested.
| Command forms | Use | Example |
|---|---|---|
[value reference], [value reference frame] | Read a parameter. In a text target, value can return a string parameter; in a numeric target, it reads a number. | [value Driver.translateX t-2] |
[numvalue reference], [numvalue reference frame] | Always read the reference as a number, including inside a text template. | offset_[numvalue Driver.translateX] |
[metadata key], [metadata key default], [metadata key default frame] | Read metadata available to the node. A missing key returns the default, or 0 in numeric mode / empty text in text mode. Numeric defaults must be finite numbers; they also cover non-numeric metadata. | [metadata lens.focal 50 t-1] |
[random], [random seed] | Repeatable random value, changing by frame with no seed. Accepts up to four numeric seeds. | [random [frame] 7] |
[noise x], [noise x y], [noise x y z] | Smooth noise in [0, 1]. | [noise [expr {frame / 8.0}]] |
[fbm x], [fbm x y], [fbm x y z], [fbm x y z octaves] | Layered noise with the same octave rules as ExprTK. | [fbm [expr {frame / 16.0}] 0 0 6] |
[turbulence x], [turbulence x y], [turbulence x y z], [turbulence x y z octaves] | Layered absolute noise in [0, 1]. | [turbulence 0.25] |
[expr {formula}], [expr formula] | Evaluate a numeric formula using the Tcl math list above. | [expr {frame + 1}] |
[expression formula], [expression {formula}] | Evaluate a numeric formula using the ExprTK functions and Comp helpers above. | [expression from_sRGB(0.5)] |
[format %d number], [format %0Nd number] | Format an integer, optionally with zero padding. N is a width from 1 to 64. Numeric input is truncated toward zero. Other format specifiers are unavailable. | [format %04d [frame]] |
For value and numvalue, a reference must be written directly as this.parameter or NodeName.parameter, optionally with (t), (t+N) or (t-N). A frame argument may be a finite frame number, t, t+N or t-N; N may be fractional.
Command arguments are separated by spaces. Noise, random and format arguments must be numbers or nested commands that produce numbers. Write [noise [expr {frame / 8.0}]], not [noise frame/8]. Metadata keys and text defaults are single words, without quotes or spaces.
Tcl text and file paths
Text outside brackets is literal. Put arithmetic inside [expr ...] or [expression ...]. Use forward slashes in file paths and do not wrap the template in quotes.
A four-digit frame number:
renders/shot.[format %04d [frame]].exrAt frame 12 this produces renders/shot.0012.exr.
A path offset by one frame:
renders/shot.[format %04d [expr {frame + 1}]].exrCopy the path from an Input node:
[value Input1.filePath]A metadata label, with a fallback when the key is absent:
Lens: [metadata lens.model unknown]Replace the example node names, parameter keys and metadata with ones from your project.
Expression limits
Expressions are formulas or text templates, not scripts. Loops, assignments, variable declarations, procedures, script and package loading, file access, process execution and network commands are unavailable. ExprTK statement forms such as swap and assert are also unsupported.
Use frame, not $frame. Tcl input cannot contain semicolons, backslashes, quotes or line breaks.
Braces may wrap the formula inside [expr ...] or [expression ...]. Other command arguments cannot be quoted. Commands such as set, if, proc, string, file, open and exec are unavailable.
Tcl expansion allows at most 16 nesting levels, 256 substitutions and 32,768 characters. Arguments must be in the function's numeric domain; the final result must be finite.
Animation and parametric curves
Animation curves describe a parameter over time. Parametric curves, such as HueCorrect's hue curves, describe an adjustment over another coordinate. Parametric curve shapes are static in this release; their points are not timeline keyframes.