Back to Node List

List Filter

list_filter

Keeps only list items whose predicate evaluates to true

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
リスト
list
List<Any>
Required
絞り込む元のリストです
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
リスト
list
List<Any>
条件を満たした要素だけを残したリストです
要素数
count
Int
残った要素数です

Parameters

NameTypeDefaultRangeDescription / Options
要素の型
item_type
Enum
Any

入力リスト要素の期待型です

  • 数値(汎用)Number
    Float と Int の両方を扱える数値リストです
  • 小数Float
    小数値のリストです
  • 整数Int
    整数値のリストです
  • ON/OFFBool
    ON/OFF のリストです
  • Color
    色のリストです
  • 文字Text
    文字のリストです
  • 画像Image
    画像のリストです
  • パスPath
    パスのリストです
  • ピクセル線PixelLine
    ピクセル線のリストです
  • Vec2Vec2
    2D ベクトルのリストです
  • Vec3Vec3
    3D ベクトルのリストです
  • OKLCH補正OklchAdjust
    OKLCH基準の明るさ・鮮やかさ・色相・透明度の補正セットのリストです
  • パレットPalette
    パレットのリストです
  • リストList
    リストのリストを作ります
  • マップMap
    マップのリストです
  • 文字レイアウトTextLayout
    文字レイアウトのリストです
  • ピクセルパッチPixelPatch
    ピクセルパッチのリストです
  • 記録レイヤーRecordedLayer
    記録レイヤーのリストです
  • アニメーションクリップAnimationClip
    アニメーションクリップのリストです
  • AsepriteファイルAsepriteFile
    Aseprite document のリストです
  • ルールグリッドRuleGridSpec
    RuleGridSpec のリストです
  • ルールタイルセットRuleTileSet
    RuleTileSet のリストです
  • ルールタイル素材RuleTileAsset
    RuleTileAsset のリストです
  • ルールセットRuleSet
    RuleSet のリストです
  • ルールキャンバスRuleCanvas
    RuleCanvas のリストです
  • 解決済みルール配置RuleResolved
    RuleResolved のリストです
  • ルールタイルアトラスRuleTileAtlas
    RuleTileAtlas のリストです
  • 9スライスNineSlice
    9スライスUI素材のリストです
  • 2D FX 状態FxState2D
    FxState2D のリストです
  • スプライトシートSpriteSheet
    スプライトシートのリストです
  • バリアントスナップショットVariantSnapshot
    variant snapshot のリストです
  • バリアントレシピVariantRecipe
    variant recipe のリストです
  • バリアントレコードVariantRecord
    variant record のリストです
  • IsoItemIsoItem
    IsoItem のリストです
  • IsoSceneIsoScene
    IsoScene のリストです
  • IsoWorldIsoWorld
    IsoWorld のリストです
  • タイル素材TileAsset
    タイル素材のリストです(tile_palette_create の入力などに使います)
  • タイルパレットTilePalette
    タイルパレットのリストです
  • タイルマップTileCanvas
    タイルマップのリストです
  • 解決済みタイル配置TileResolved
    解決済みタイル配置のリストです
  • Any(上級者向け)Any
    上級者向けです。どの型でも混ぜられますが、取り出した値の型が下流ノードの期待と合わないと実行時エラーになります。
条件式
predicate
Text
true

この式が true になった要素だけを残します。既定の true はすべての要素型で有効です。 要素由来の名前は型別です: Number/Float/Int/Bool は item、Color は item_r/g/b/a、Vec2 は item と item_x/y、Vec3 は item_x/y/z。その他の構造化型には要素由来の名前がありません。 Map は有効な非予約キーを直接、すべての有効キーを item_<キー名> で参照できます。予約キー item, index, count, x, y, z, w, vec, vx, vy, flag, time, frame, total_frames より標準変数が優先されます。 入力ピンがつながっている時は Inspector の既定値より優先されます。 記述例: - item >= 0.75 - item_r > 0.5 - index % 2 == 0 - value < 0.5 && item_index == 0

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 入力ピンが未接続の時に使う真偽値です

Overview

Selects elements from a list with a conditional expression. Only elements for which an expression such as item >= 0.75 evaluates to true remain. Use it to thin candidates, select by threshold, or extract a regular pattern such as "even positions only."

Usage tips

  • It is the counterpart to list_map (transformation): map processes every element, while filter selects elements. When using both, filter → map avoids unnecessary work.
  • Expose a threshold through the x input pin for interactive workflows where a slider adjusts how aggressively the candidates are filtered.
  • Remember that the count changes. When connecting to a downstream setup that expects a fixed count (such as list_unpack), check the count output.

Related nodes

  • list_map — transform instead of select
  • list_slice — extract by position instead of condition
  • expression_bool — single-value Bool version using the same expression engine
  • variant_range / cartesian_product — sources of candidates to filter

Read this first

  • predicate is evaluated once for every element.
  • The default predicate true is valid for every item type and initially keeps all elements.
  • An element remains when the result is true and is discarded when it is false.
  • Thus, with list = [0.25, 0.75, 1.25] and predicate = item >= 0.75:
    • 0.25 >= 0.75 is false, so it is discarded
    • 0.75 >= 0.75 is true, so it remains
    • 1.25 >= 0.75 is true, so it remains

Names available by item type

Names derived from the current item depend on its type. item is not available for every type.

Item type Names derived from the item
Number / Float / Int / Bool item
Color item_r, item_g, item_b, item_a
Vec2 item (Vec2), item_x, item_y
Vec3 item_x, item_y, item_z
Map Key names described below
Other structured types No item-derived expression variable

With Any, a runtime Number, Color, Vec2, Vec3, or Map item exposes the names for its actual type during evaluation. The following common names are available regardless of item type.

Name Meaning Example
index The zero-based position of the element index % 2 == 0
count Total number of elements index / max(count - 1, 1)
x, y, z, w Auxiliary input pins or numbers supplied in the Inspector item >= x
vec, vx, vy Auxiliary Vec2 input, or the Inspector's vec_x, vec_y length(vec) > 1
flag Auxiliary Bool input, or the Inspector default flag && index > 0
time, frame, total_frames Timing information at evaluation frame % 2 == 0

Map elements

When an element is a Map, a non-reserved key that is a valid identifier (such as value, a, or _seed) can be written directly in the condition. Every valid key is also exposed with the item_ prefix.

For example, if an element is:

{ "index": 0, "value": 0.25 }

You can write these directly in the condition:

value < 0.5
item_index == 0

index always means the current position in the list. Use item_index to read the Map's index key. The reserved names item, index, count, x, y, z, w, vec, vx, vy, flag, time, frame, and total_frames keep their standard meaning; use item_<key> for a Map value with one of those names. A valid identifier starts with an ASCII letter or _ and continues with ASCII letters, digits, or _; other keys are not exposed as expression variables.

How to read common inputs:

Input source Element shape Names available in the condition
Ordinary numeric list 0.25, 0.75, 1.25 item, index, count
List Enumerate { "index": 0, "item": 10 } Current position as index; Map values as item_index, item_item
List Zip { "index": 0, "a": 1, "b": 10 } a, b; the Map index as item_index
Cartesian Product Map with multiple keys Non-reserved keys directly, or each valid key as item_<key>

Common expressions

  • item >= 0.75
    • Retains only values at or above the threshold.
  • index % 2 == 0
    • Retains only even positions.
  • item >= x
    • Retains only elements at or above a threshold supplied from outside.
  • value < 0.5 && item_index == 0
    • Filters a Map with multiple conditions.
  • a * 10 == b
    • Filters by the relationship between two lists from List Zip.

Concrete examples

Example 1: Retain only values at or above 0.75

Input:

[0.25, 0.75, 1.25]

Settings:

  • item_type = Float
  • predicate = item >= 0.75

Output:

list = [0.75, 1.25]
count = 2

Example 2: Retain part of a List Zip result

Input:

[
  { "index": 0, "a": 1, "b": 10 },
  { "index": 1, "a": 2, "b": 20 }
]

Settings:

  • item_type = Map
  • predicate = a * 10 == b

Output:

list = [
  { "index": 0, "a": 1, "b": 10 },
  { "index": 1, "a": 2, "b": 20 }
]
count = 2

Example 3: Retain only even positions

Input:

[10, 20, 30, 40, 50]

Settings:

  • item_type = Number
  • predicate = index % 2 == 0

Output:

list = [10, 30, 50]
count = 3

Example 4: Use a variable or auxiliary input as the threshold

Input:

[0.25, 0.75, 1.25]

Settings:

  • item_type = Float
  • predicate = item >= x
  • x = 0.75

Output:

list = [0.75, 1.25]
count = 2

Enter x directly in the Inspector, or connect a Variable Ref to the x input pin.

When to use it

  • When you want to retain only batch-production candidates that meet a condition
  • When you want to reduce the number of candidates before sending them to Batch Render

Notes

  • v1 is based on constrained expressions.
  • It is not intended to run an arbitrary subgraph as a predicate.
  • Standard variables take priority over reserved Map keys. Read a same-named Map value through item_<key>.
Back to Node List
List Filter — PixPipeline Node Reference