Studio Yotsuba
Back to Node List

List Map

list_map

Maps each list item through a constrained expression

Reviewed
Guide available

Input Ports

NameTypeDescription
List
list
List<Any>
Required
Source list
X
x
Number
Optional number variable x
Y
y
Number
Optional number variable y
Z
z
Number
Optional number variable z
W
w
Number
Optional number variable w
Vec
vec
Vec2
Optional vec2 variable
Flag
flag
Bool
Optional bool variable

Output Ports

NameTypeDescription
List
list
List<Float>
Mapped list
Count
count
Int
Number of mapped elements

Parameters

NameTypeDefaultRangeDescription / Options
Item Type
item_type
Enum
Any—

Expected type of incoming list items

  • NumberNumber
    Create a list of numbers (Float or Int)
  • FloatFloat
    Create a list of float values
  • IntInt
    Create a list of integer values
  • BoolBool
    Create a list of boolean values
  • ColorColor
    Create a list of colors
  • TextText
    Create a list of text values
  • ImageImage
    Create a list of images
  • PathPath
    Create a list of paths
  • PixelLinePixelLine
    Create a list of pixel lines
  • Vec2Vec2
    Create a list of 2D vectors
  • Vec3Vec3
    Create a list of 3D vectors
  • OklchAdjustOklchAdjust
    Create a list of OKLCH adjustment sets
  • PalettePalette
    Create a list of palettes
  • ListList
    Create a nested list (list of lists)
  • MapMap
    Create a list of maps
  • TextLayoutTextLayout
    Create a list of text layouts
  • PixelPatchPixelPatch
    Create a list of pixel patches
  • RecordedLayerRecordedLayer
    Create a list of recorded layers
  • AnimationClipAnimationClip
    Create a list of animation clips
  • AsepriteFileAsepriteFile
    Create a list of Aseprite documents
  • RuleGridSpecRuleGridSpec
    Create a list of rule grid specs
  • RuleTileSetRuleTileSet
    Create a list of rule tile sets
  • RuleTileAssetRuleTileAsset
    Create a list of rule tile assets
  • RuleSetRuleSet
    Create a list of rule sets
  • RuleCanvasRuleCanvas
    Create a list of rule canvases
  • RuleResolvedRuleResolved
    Create a list of resolved rule tile placements
  • RuleTileAtlasRuleTileAtlas
    Create a list of rule tile atlases
  • NineSliceNineSlice
    Create a list of nine-slice UI documents
  • FxState2DFxState2D
    Create a list of 2D FX states
  • SpriteSheetSpriteSheet
    Create a list of sprite sheets
  • VariantSnapshotVariantSnapshot
    Create a list of variant snapshots
  • VariantRecipeVariantRecipe
    Create a list of variant recipes
  • VariantRecordVariantRecord
    Create a list of variant records
  • IsoItemIsoItem
    Create a list of iso items
  • IsoSceneIsoScene
    Create a list of iso scenes
  • IsoWorldIsoWorld
    Create a list of iso worlds
  • TileAssetTileAsset
    Create a list of tile assets (e.g. to feed tile_palette_create)
  • TilePaletteTilePalette
    Create a list of tile palettes
  • TileCanvasTileCanvas
    Create a list of tile map canvases
  • TileResolvedTileResolved
    Create a list of resolved tile placements
  • AnyAny
    Advanced: allow any element type. Mixed lists may connect, but downstream nodes can fail if the extracted value type does not match what they expect.
Output Type
output_type
Enum
Float—

Result type of the expression

  • FloatFloat
    Map each item to a float
  • BoolBool
    Map each item to a bool
  • Vec2Vec2
    Map each item to a vec2
Expression
expression
Text
0—

The type-safe default follows Item Type while it remains unedited. Available item variables depend on Item Type; index, count, x, y, z, w, vec, vx, vy, flag, time, frame, and total_frames are shared. Map items expose valid keys both directly and as item_<key>. Connected input pins override Inspector fallback values.

X
x
Float
0-10000–10000 / step 0.01

Fallback value for x when the input pin is not connected

Y
y
Float
0-10000–10000 / step 0.01

Fallback value for y when the input pin is not connected

Z
z
Float
0-10000–10000 / step 0.01

Fallback value for z when the input pin is not connected

W
w
Float
0-10000–10000 / step 0.01

Fallback value for w when the input pin is not connected

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

Fallback X component for vec when the vec input pin is not connected

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

Fallback Y component for vec when the vec input pin is not connected

Flag
flag
Bool
false—

Fallback bool value when the flag input pin is not connected

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