What is it for?
- Selecting one created image variant to pass downstream
- Switching color, number, palette, and other candidates by index
- Promoting
indexto an input pin and switching candidates over time from a numeric node
Overview
An N-way switch that selects one of several candidates by number. It extends the
two-way switch and is useful for choosing image variants or stepping through
discrete options.
Usage tips
- Manual selection is the basic pattern: arrange candidates and compare them with
index, such as alternative colors or shapes. - Promote
indexto an input pin 📌 and connect an integer waveform or counter to animate through candidates in order. If the input is fractional, convert it to an integer first withmath_func(Floor). - For a dynamic or large number of candidates, a list with
list_create+list_getscales better. Value Select suits a small set of manually arranged candidates.
Related nodes
switch— two choices controlled by a Boollist_get— retrieve by index from a list, the list-based equivalentint_input— externalize the selection indexvariant_select— selection in a variant workflow
Notes
indexis zero-based, starting at0.index = 2selectsitem_2.- An out-of-range
indexis clamped to the first or last candidate. - If the selected input is unconnected, the node first falls back to
item_0. Ifitem_0is also unconnected, it uses the first connected candidate. - Only when no candidates are connected does
valuebecome an empty output. - Changing
value_typealso changes the types of candidate inputs and thevalueoutput. - Normally, connect the same type to every candidate.
- This is a normal evaluation node. Connected candidate branches are graph dependencies. Unchanged candidates are cached, but this is not a Lazy Select that completely excludes unselected branches from evaluation.
Anyis for advanced use. A connection may be accepted, but if the selected value does not match the type expected downstream, evaluation produces a warning or node error.
Examples
- Select one of four image candidates
- Set
value_type = Image. - Connect images to
item_0..item_3. - Switch the chosen candidate with
index.
- Set
- Switch images over time
- Promote
indexto an input pin and connect it fromTime Sourceor a numeric node.
- Promote
- Switch among several color candidates
- Set
value_type = Color. - Pass the selected color to a downstream color input.
- Set
- Switch among palette candidates
- Set
value_type = Palette. - Use it to compare appearances with different palettes.
- Set