Skip to main content

vScriptValForEachIndexed

Offsets, scales, rotates or randomizes points by their index or group, with optional animation.

AdvancedMograph / ScriptValScriptValArrayJSON
vScriptValForEachIndexed node

vScriptValForEachIndexed takes an array of XYZ points and applies one of 16 changes that depend on each point's index or group. Group Size cuts the array into groups, and Auto Animate scales the amounts over time.

Parameters​

ParameterTypeDefaultDescription
ModeDropdownOffset X by IndexOne of 16 changes, default Offset X by Index. Offset X, Y or Z by Index, Offset X, Y or Z by Group, Scale by Index, Rotate X, Y or Z by Group, Random Offset X, Y or Z by Group, Random Offset X, Y or Z by Index.
Group SizeInteger8Points per group, used by the by-Group, Rotate and Random Offset by Group modes. Minimum 1, slider 1 to 128, default 8.
Index AmountFloat0.01Amount per point number, used by the by-Index offsets and Scale by Index. Default 0.01.
Group AmountFloat0.1Amount per group, used by the by-Group offsets and the rotations (degrees). Default 0.1.
Random MinFloat-0.1Low end of the random range. Slider -10 to 10, default -0.1. Shown for the Random Offset modes.
+9 more parameters
ParameterTypeDefaultDescription
Random MaxFloat0.1High end of the random range. Slider -10 to 10, default 0.1. Shown for the Random Offset modes.
Auto AnimateInteger0Multiplies the amounts by an animation factor when on. Default off.
SpeedFloat1.0Multiplies the render time. Slider 0.01 to 10, default 1. Shown when Auto Animate is on.
Duration (frames)Integer30Length of one animation cycle in frames. Minimum 1, slider 1 to 240, default 30. Shown when Auto Animate is on.
EasingDropdownLinearLinear (default), Ease In, Ease Out, Ease In-Out or Ease Out-Back. Used by Off, Loop and Ping-Pong only.
Loop ModeDropdownOffOff (default, plays once), Loop, Ping-Pong, Step Mode (8 steps), Sine Wave, Triangle Wave or Sawtooth Wave.
InputDATATYPE—Points to change. Input that does not start with a list is passed through.
MaskDATATYPE—Optional numbers, one per point. A point is changed where the value is above 0. Missing entries count as 1.
Invert MaskInteger0Changes the points where the mask is 0 or below instead. Default off.
Read the full description

Mode selects one change. The Offset modes add the point number (counted from 0) times Index Amount (by Index), or the group number times Group Amount (by Group), to X, Y or Z. Scale by Index multiplies the point by 1 + the point number times Index Amount. The Rotate modes turn the point around X, Y or Z by the group number times Group Amount degrees.

The Random Offset modes add a value between Random Min and Random Max, taken from a fixed hash of the group or point number, so the result repeats. A Mask value above 0 applies the change to that point, and Invert Mask swaps the cases.

Auto Animate multiplies the amounts by a factor from the render time, Speed and Duration, using the Loop Mode and Easing curve.

Example Connections​

vScriptValPointsOnGrid.Output -> vScriptValForEachIndexed.Input
vScriptValForEachIndexed.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input