Back to Node List

Expression Float

expression_float

Evaluates a small expression and outputs a float

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
X
x
Number
数値変数 x です
Y
y
Number
数値変数 y です
Z
z
Number
数値変数 z です
W
w
Number
数値変数 w です
Vec
vec
Vec2
必要なら使える Vec2 変数です
フラグ
flag
Bool
必要なら使える Bool 変数です

Output Ports

NameTypeDescription
value
Float
式を評価した結果の小数です

Parameters

NameTypeDefaultRangeDescription / Options
X
x
Float
0-10000–10000 / step 0.01

入力ピンが未接続の時に使う x の値です

Y
y
Float
0-10000–10000 / step 0.01

入力ピンが未接続の時に使う y の値です

Z
z
Float
0-10000–10000 / step 0.01

入力ピンが未接続の時に使う z の値です

W
w
Float
0-10000–10000 / step 0.01

入力ピンが未接続の時に使う w の値です

Vec X
vec_x
Float
0-10000–10000 / step 0.01

vec 入力ピンが未接続の時に使う X 成分です

Vec Y
vec_y
Float
0-10000–10000 / step 0.01

vec 入力ピンが未接続の時に使う Y 成分です

フラグ
flag
Bool
false

flag 入力ピンが未接続の時に使う真偽値です

expression
Text
x

使える変数: x, y, z, w, vec, vx, vy, flag, time, frame, total_frames 記述例: - x + y * 2 - sin(time * pi * 2) - if(flag, x, y) 入力ピンがつながっている時は、Inspector の値より入力ピンが優先されます。

Overview

Evaluates a short formula written as text and outputs one number. It can consolidate a calculation that would require several math_op or math_func nodes into one, such as floor(x*4)/4. Use it to tidy a graph when numeric wiring becomes hard to read.

Usage tips

  • A single expression is usually clearer for calculations that would need three or more numeric nodes. For one simple operation, math_op makes the intent more visible in the graph.
  • You can use time / frame directly in an expression without connecting time_source. For example, sin(time * pi * 2) produces one sine-wave cycle.
  • if(condition, a, b) replaces the numeric equivalent of compare + switch with one expression.
  • The go-to pixel snap expression is floor(x * number_of_steps) / number_of_steps.

Related nodes

  • math_op / math_func — node-based equivalents
  • list_map — transform every list item with the same expression engine
  • compare / switch — propagate a Bool condition to other types
  • float_input — supply variables

Read this first

  • The x, y, z, w, vec, and flag used here are not variables created in the variable panel.
  • They are input pin names belonging to the Expression node itself.
  • You can also enter x, y, z, w, vec_x, vec_y, and flag directly in the Inspector.
  • To use a variable created in the variable panel, retrieve it with Variable Ref or a similar node and connect it to the corresponding input pin.
  • When a value is connected to an input pin, that value takes priority over the Inspector value.
  • Unconnected inputs are treated as follows:
    • x, y, z, w = 0
    • vec = [vec_x, vec_y]
    • flag = false

Available items

  • Variables: x, y, z, w, vec, vx, vy, flag, time, frame, total_frames
  • Operators: + - * / %, == != < <= > >=, && || !
  • Functions: min, max, clamp, abs, floor, ceil, round, sign, sin, cos, tan, sqrt, pow, lerp, vec2, x, y, length, if

Common expressions

  • x + y * 2
  • sin(time * pi * 2)
  • if(flag, x, y)
  • length(vec) * 0.5

Detailed examples

Example 1: Simple addition

  • Set x to 0.5.
  • Set y to 2.
  • Set expression = x + y * 2.
value = 4.5

Example 2: Leaving inputs unconnected

  • Do not connect any inputs.
  • Set expression = x + 1.

In this case, x is treated as 0.

value = 1

Example 3: Using time

  • Set expression = sin(time * pi * 2).

As time changes from 0.0 to 1.0, the result completes one sine-wave cycle.

When to use it

  • To write a small formula that does not justify arranging several numeric nodes
  • To test an expression on its own before putting it in ListMap

Notes

  • && / || skip the right side once the result is known, and if(condition, A, B) evaluates only the selected branch.
  • Reversed clamp bounds are swapped, sign(0) = 0, and % is the Euclidean remainder in 0 <= result < |right operand|. As with the Math nodes, division or modulo by zero and sqrt of a negative value produce an error.
  • This is not intended for long logic or operations with side effects.
  • Version 1 is a lightweight escape hatch.
  • While editing an expression, even an incomplete intermediate string is evaluated immediately, so an error may appear temporarily.
Back to Node List
Expression Float — PixPipeline Node Reference