Back to Node List

List Slice

list_slice

Extracts a contiguous slice from a list

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<Number>
Required
切り出し元のリストです

Output Ports

NameTypeDescription
リスト
list
List<Number>
切り出した部分リストです
要素数
count
Int
切り出した要素数です

Parameters

NameTypeDefaultRangeDescription / Options
要素の型
item_type
Enum
Number

このノードが切り出すリスト要素の型を選びます

  • 数値(汎用)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
    上級者向けです。どの型でも混ぜられますが、取り出した値の型が下流ノードの期待と合わないと実行時エラーになります。
開始
start
Int
0-1024–1024

開始インデックスです。負の値は 0 にクランプされます

個数
count
Int
00–1024

切り出す個数です。0 の場合は末尾まで切り出します

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
List Slice — PixPipeline Node Reference