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, uselist_slice(start=0, count=8)to test only the first group. count=0means "all the way to the end," not "zero elements." Remember it as the syntax for "everything fromstartonward."- Use
list_filterto select by condition, orlist_getfor only one element.
Related nodes
list_get— extract one elementlist_filter— select by conditionsprite_sheet_pack— an example destination for the extracted frames
Read this first
startspecifies the position at which extraction begins.countspecifies how many elements to take.count=0does 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 Productresult first - When you want to extract only a portion of batch-produced results for preview
Notes
start/countare clamped to the list length.- The upper limits of the Inspector's
start/countsliders adjust automatically to the input list length. - A
Palettecan be treated asList<Color>.