Studio Yotsuba
Back to Node List

List Slice

list_slice

Extracts a contiguous slice from a list

Reviewed
Guide available

Input Ports

NameTypeDescription
List
list
List<Number>
Required
Source list

Output Ports

NameTypeDescription
List
list
List<Number>
Sliced sub-list
Count
count
Int
Number of sliced elements

Parameters

NameTypeDefaultRangeDescription / Options
Item Type
item_type
Enum
Number—

Choose which type of list this node should slice

  • 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.
Start
start
Int
0-1024–1024

Start index (0-based). Negative values clamp to 0.

Count
count
Int
00–1024

How many elements to keep. 0 means to the end.

Overview

Extracts a contiguous portion of a list (M elements starting at position N). Use it for position-based subsets such as "try only the first eight" or "preview only part of the batch-produced results."

Usage tips

  • It is useful for trial runs of expensive batch-production chains. Before passing all 120 combinations from cartesian_product, use list_slice(start=0, count=8) to test only the first group.
  • count=0 means "all the way to the end," not "zero elements." Remember it as the syntax for "everything from start onward."
  • Use list_filter to select by condition, or list_get for only one element.

Related nodes

  • list_get — extract one element
  • list_filter — select by condition
  • sprite_sheet_pack — an example destination for the extracted frames

Read this first

  • start specifies the position at which extraction begins.
  • count specifies how many elements to take.
  • count=0 does not mean "zero elements"; it means everything to the end.

Start with this example

Suppose the input list is:

["A", "B", "C", "D", "E"]

Example 1: start = 1, count = 2

list = ["B", "C"]
count = 2

Example 2: start = 2, count = 0

list = ["C", "D", "E"]
count = 3

Example 3: start = 99

When the start position exceeds the list length, the result is an empty list.

list = []
count = 0

When to use it

  • When you want to send only the first eight candidates into another process
  • When you want to test part of a Cartesian Product result first
  • When you want to extract only a portion of batch-produced results for preview

Notes

  • start / count are clamped to the list length.
  • The upper limits of the Inspector's start / count sliders adjust automatically to the input list length.
  • A Palette can be treated as List<Color>.
Back to Node List