Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Clamped number list

Clamps a list of numbers to a range and forces a minimum gap between the values.


Inputs

  • list

    • The list of values to clamp and space.
  • mode

    • Sets the direction that values move in when they sit closer together than the minimum spacing. These are collapse out from index, collapse up, and collapse down.
      • collapse out from index holds the value at the index input in place and pushes the values on either side of it away from it.
      • collapse up pushes values towards the maximum.
      • collapse down pushes values towards the minimum.
  • index

    • The index of the value in the incoming list that the rest of the list collapses out from. The first value in the list is index 0.
  • minimum

    • The value that defines the lower bound of the output list.
  • maximum

    • The value that defines the upper bound of the output list.
  • minimum spacing

    • The value that defines the smallest gap allowed between two values in the output list.
  • pad borders

    • When true, the minimum spacing gap is also applied between the first value and the minimum, and between the last value and the maximum. When false, values are allowed to sit on the bounds.

Outputs

  • list

    • The list of values after clamping and spacing have been applied.

Note(s)

  • The index input only has an effect when mode is set to collapse out from index.

  • The index input counts positions in the incoming list, before any spacing is applied. The output list is sorted into ascending order once the operation has finished.

  • Useful for tidying up the output of a Random number node, keeping generated values inside a usable range and stopping them from bunching together.

  • Other names for this node include: ClampedList.