Back to Node List

List Map

list_map

Maps each list item through a constrained expression

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<Float>
式を適用した後のリストです
要素数
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
    上級者向けです。どの型でも混ぜられますが、取り出した値の型が下流ノードの期待と合わないと実行時エラーになります。
出力要素の型
output_type
Enum
Float

式の結果として作る要素型です

  • 小数Float
    各要素を小数へ変換します
  • 真偽値Bool
    各要素を真偽値へ変換します
  • Vec2Vec2
    各要素を Vec2 へ変換します
expression
Text
0

未編集の間は、入力要素の型に合う安全な既定式へ切り替わります。item 系の変数は入力要素の型ごとに異なります。index, count, x, y, z, w, vec, vx, vy, flag, time, frame, total_frames は共通です。Map は有効なキー名と item_<キー名> を公開します。入力ピンがつながっている時は Inspector の既定値より入力ピンが優先されます。

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

Applies the same expression to every item in a list. For example, it transforms [1,2,3] into [2,4,6] with item * 2, processing a sequence of values all at once. Its main role is preparing numeric sequences for variants and batch processing.

Usage tips

  • A typical use is transforming an evenly spaced sequence from variant_range or a similar node into a nonlinear sequence with an expression such as item * item (quadratic curve) or sin(item * pi) (arch).
  • Because index / count are available, you can also create values based on item position. Use index / max(count - 1, 1) when the first item must be 0 and the last item must reach 1.
  • Expressions use the same engine as expression_float. Debugging is easier if you first test the expression in a standalone expression_float node.

Related nodes

  • expression_float — single-value version using the same expression engine
  • list_zip / list_enumerate — merge lists or add indices before this node
  • variant_range / seed_range — generate input lists
  • list_create — create a list manually

Read this first

  • expression is evaluated once for every item in the list.
  • For list = [1, 2, 3] and expression = item * 2, this means:
    • The first item evaluates 1 * 2.
    • The second item evaluates 2 * 2.
    • The third item evaluates 3 * 2. These evaluations run in order.

Item-type names and defaults

Names derived from the current item depend on its type. item is not available for every type. When item_type changes, expression switches to the valid default below only while it still contains an automatic default. An expression you edited is kept.

Item type Names derived from the item Automatic default
Number / Float / Int / Bool item item
Color item_r, item_g, item_b, item_a item_r
Vec2 item (Vec2), item_x, item_y item_x
Vec3 item_x, item_y, item_z item_x
Map Key names described below 0
Any and other structured types No common item-derived name 0

With Any, a runtime Number, Color, Vec2, Vec3, or Map item exposes the names for its actual type during evaluation. The default is 0 because it remains valid for a mixed list.

The following common names are available regardless of item type.

Name Meaning Example
index Zero-based position of the item index % 2
count Total number of items index / max(count - 1, 1)
x, y, z, w Auxiliary input pins or numbers entered in the Inspector item * x
vec, vx, vy Auxiliary Vec2 input, or Inspector values vec_x and vec_y length(vec)
flag Auxiliary Bool input or its Inspector default if(flag, 1, 0)
time, frame, total_frames Time information at evaluation sin(time * pi * 2)

When an item is a Map

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

For example, given this item:

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

You can write these expressions directly:

value < 0.5
item_index + 1

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 Item shape Names available in expressions
Ordinary numeric list 1, 2, 3 item, index, count
ListEnumerate { "index": 0, "item": 10 } Current position as index; Map values as item_index, item_item
ListZip { "index": 0, "a": 1, "b": 10 } a, b; the Map index as item_index
CartesianProduct Map with multiple keys Non-reserved keys directly, or each valid key as item_<key>

Common expressions

  • item * 2
    • Doubles each number.
  • item + index
    • Offsets each value by its item index.
  • item * x
    • Transforms every item using a coefficient supplied from outside.
  • value < 0.5
    • Reads value from a Map and produces a Bool.
  • a + b
    • Adds the two values from ListZip.
  • vec2(item, index)
    • Creates a Vec2 list from a numeric list.

Detailed examples

Example 1: Double numbers

Input:

[1, 2, 3]

Settings:

  • item_type = Number
  • output_type = Float
  • expression = item * 2

Output:

list = [2.0, 4.0, 6.0]
count = 3

Example 2: Convert a Map to Bool

Input:

[
  { "index": 0, "value": 0.25 },
  { "index": 1, "value": 0.75 }
]

Settings:

  • item_type = Map
  • output_type = Bool
  • expression = value < 0.5 && item_index == 0

Output:

list = [true, false]
count = 2

Example 3: Add the results of ListZip

Input:

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

Settings:

  • item_type = Map
  • output_type = Float
  • expression = a + b

Output:

list = [11.0, 22.0]
count = 2

Example 4: Change the multiplier for all items using a variable or auxiliary input

Input:

[1, 2, 3]

Settings:

  • item_type = Number
  • output_type = Float
  • expression = item * x
  • x = 10

Output:

list = [10.0, 20.0, 30.0]
count = 3

You can enter x directly in the Inspector or connect Variable Ref to the x input pin.

When to use it

  • To convert the result of a range, seed, zip, or enumerate operation into another sequence of values
  • To lightly process value candidates before passing them to BatchRender

Notes

  • Version 1 uses constrained expressions.
  • It does not run an arbitrary subgraph for every item.
  • Standard variables take priority over reserved Map keys. Read a same-named Map value through item_<key>.
Back to Node List
List Map — PixPipeline Node Reference