Skip to main content

vArrayFromPolylineBG

Sample a path drawn over a connected background image into evenly spaced points.

BeginnerMograph / ArrayArrayScriptValJSON
vArrayFromPolylineBG node

vArrayFromPolylineBG outputs an array of XYZ points taken at equal distances along a path drawn in the viewer. A background image connected to the Background socket is passed to the Canvas output, and its shape sets the aspect correction.

Parameters​

ParameterTypeDefaultDescription
BackgroundImage—Image shown behind the drawn path. It is passed to the Canvas output and sets the aspect used by Aspect Correct.
Reset PathInteger0.0Button that clears the drawn path.
Point CountInteger64Number of points taken along the path. Minimum 2, default 64.
Closed LoopInteger0.0When on, the path is treated as closed and the first point is not repeated at the end. Default off.
Flip YInteger1.0Negates Y after sampling. Default on.
+4 more parameters
ParameterTypeDefaultDescription
Flip XInteger1.0Negates X after sampling. Default on.
Aspect CorrectInteger1.0Divides Y by the width divided by the height of the Background image, or by 16 / 9 without an image. Default on.
Scale XFloat2.0Multiplier applied to X. Minimum 0, default 2.
Scale YFloat2.0Multiplier applied to Y. Minimum 0, default 2.
Read the full description

The Path control is a spline that is drawn in the viewer over the Background image. The node takes Point Count positions along the path at equal fractions of its length. Without Closed Loop the first point is at the start and the last at the end of the path. With Closed Loop on, the spacing is divided by Point Count instead of Point Count - 1, so the first point is not repeated at the end.

Each point is then changed in this order. Flip X and Flip Y negate the X and Y values. Aspect Correct divides Y by the width divided by the height of the Background image, or by 16 / 9 when no image is connected. Scale X and Scale Y multiply the values. Z is always 0. Flip X, Flip Y and Aspect Correct are on by default, and both scales default to 2.

The Background image is passed to the Canvas output without changes, so the same image can be used behind the drawn path. If the path has fewer than two points, the node stops without producing points. Reset Path clears the drawn path. Point Count is rounded to a whole number and has a minimum of 2.

The node is the same as vArrayFromPolyline except for the Background input and the aspect source. It has no canvas color controls.

Example Connections​

Loader.Output -> vArrayFromPolylineBG.Background
vArrayFromPolylineBG.Output -> vArrayCameraProjection.ArrayA
vArrayCameraProjection.Output -> vArrayShapeRender.ArrayPoint
Background.Output -> vArrayShapeRender.Input