Back to Node List

Expression Bool

expression_bool

Evaluates a small expression and outputs a bool

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 です
Vec
vec
Vec2
必要なら使える Vec2 変数です
フラグ
flag
Bool
必要なら使える Bool 変数です

Output Ports

NameTypeDescription
value
Bool
式を評価した結果の真偽値です

Parameters

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

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

Y
y
Float
0-10000–10000 / step 0.01

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

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 > 0.5

true / false を返す式です。 記述例: - x < 0.5 - flag || x > 0.5 - length(vec) >= 4 入力ピンがつながっている時は、Inspector の値より入力ピンが優先されます。

Overview

Produces one true / false value from a short expression. Instead of arranging compare and logical-operation nodes, write a compound condition in one expression, such as flag || x > 0.5. Send the result to a switch or gate condition.

Usage tips

  • Keep a simple comparison that needs only one compare as a node. Once two or more conditions interact, consolidating them here makes the graph easier to read.
  • Because time / frame are available, one expression can describe temporal conditions such as "true only on certain frames" (for example, frame % 4 == 0).
  • This also works as a test bench for a list_filter predicate because it uses the same expression syntax.

Related nodes

  • compare / value_match — use nodes for simple decisions
  • switch / gate — destinations for the Bool value
  • expression_float / expression_vec2 — other types using the same expression engine
  • list_filter — list-based conditional expressions

Read this first

  • The x, y, vec, and flag names here are separate from variables created in the Variables panel.
  • They are the input pin names of the Expression node itself.
  • You can also enter x, y, vec_x, vec_y, and flag directly in the Inspector.
  • To use a variable from the Variables panel, retrieve it with Variable Ref or a similar node and connect it to the relevant input pin.
  • When a value is connected to an input pin, the input-pin value takes precedence over the Inspector value.
  • Unconnected inputs use the following values:
    • x, y = 0
    • vec = [vec_x, vec_y]
    • flag = false

Available features

  • Variables: x, y, 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 < 0.5
  • flag || x > 0.5
  • length(vec) >= 4

Concrete examples

Example 1: Threshold test

  • Set x to 0.25
  • expression = x < 0.5
value = true

Example 2: Compound condition

  • Set flag to false
  • Set x to 0.8
  • expression = flag || x > 0.5
value = true

When to use it

  • When you want to produce a Bool for a Switch or filter condition with only a lightweight expression
  • When you want to test a List Filter predicate on its own first

Notes

  • && / || skip the right side once the result is known. if(condition, A, B) evaluates only the selected branch, so an error in the unselected branch does not affect the result.
  • Numeric rules match the Math nodes: reversed clamp bounds are swapped, sign(0) = 0, and % is a non-negative Euclidean remainder. Division or modulo by zero and sqrt of a negative value produce an error.
  • Values other than Bool can be evaluated, but the final result is converted to true / false.
  • This is not intended for writing complex state machines.
  • While you type an expression, the incomplete intermediate text is evaluated immediately, so an error may appear temporarily.
Back to Node List
Expression Bool — PixPipeline Node Reference