Skip to main content

vScriptValConvert2D_3D

Regroups the values of each array element into groups of 1, 2 or 3 values.

BeginnerMograph / ScriptValScriptValArrayJSON
vScriptValConvert2D_3D node

vScriptValConvert2D_3D takes an array of value lists and cuts each list into groups of the size chosen by Convert To. With X Y Z, a 2D point {x, y} becomes {x, y, 0}.

Parameters​

ParameterTypeDefaultDescription
Convert To:DropdownXGroup size: X (1 value, default), X Y (2 values) or X Y Z (3 values, with the last group padded with 0).
InputDATATYPE—Data to process.
Read the full description

Convert To sets the group size: X is 1, X Y is 2 and X Y Z is 3. Each input element is read from the start in groups of that size, and each group becomes one element of the output. Groups never span two input elements.

With X Y Z, a last group that has fewer than 3 values is filled with 0, so {x, y} becomes {x, y, 0}. With X or X Y, a short last group stays short. A 3D point converted with X Y becomes {x, y} followed by {z}.

The output has one element per group, so its length can be larger than the input length.

Example Connections​

vScriptValFromPolyline.Output -> vScriptValConvert2D_3D.ArrayA
vScriptValConvert2D_3D.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input