node item at index - blossommerz/locus-hub GitHub Wiki

Home > Data > Item at Index

< Previous: Flatten | Next: List Length >

Node Library

Item at Index node icon   Item at Index (node)

Pull one item out of a list by its position (0-based; negative counts from the end).

A list of five items numbered 0 to 4; the item at index 2 is highlighted in blue, the rest greyed.

Item at Index node diagram

Category: Data | Add menu: Data > Item at Index

Inputs

  • List (any): the list to pull an item out of.
  • Index (number): which item to pull, 0-based (negative counts from the end). A list of indices pulls one item per index, see below.

Outputs

  • Item (any): the single item at that index, or a list of items when Index is a list.

A list of indices gives a list of items

Wire a single number into Index and you get one item out. Wire a list of numbers in and Item at Index picks one item per index and returns the whole set, in the order the indices came.

That is what makes a per-item pick possible: a Series of seeds through Random gives a list of indices, and that list through Item at Index gives a different item for every position. Feeding a color list in that way is how each item in a collection ends up with its own color.

It indexes plain lists too

Geometry items are not the only thing it reads. A plain list of colors, numbers or strings, the kind Collect produces from non-geometry inputs, indexes by position under the same contract: 0-based, negative counting from the end.

< Previous: Flatten | Next: List Length >

Points inside a group are not items of their own: they travel with the member they belong to. See Lists & collections.

Related

⚠️ **GitHub.com Fallback** ⚠️