Skip to main content

vScriptValClamp

Limits every number in an array to the range from Min to Max.

BeginnerMograph / ScriptValScriptValArrayJSON
vScriptValClamp node

vScriptValClamp takes an array of numbers or points, including nested lists, and outputs it with every number held between Min and Max. Values already inside the range are unchanged.

Parameters​

ParameterTypeDefaultDescription
MinFloat0Lower limit. Allowed -10 to 10, default 0.
MaxFloat1Upper limit. Allowed -10 to 10, default 1.
Auto Swap Min/MaxInteger1Exchanges Min and Max when Min is larger. Default on.
InputDATATYPE—Data to process.
Read the full description

Every number at any depth of the input is replaced by Min if it is below Min, and by Max if it is above Max. Entries that are not numbers are kept as they are, and the list structure is preserved. The defaults 0 and 1 hold all values in the 0 to 1 range.

Min and Max accept -10 to 10. With Auto Swap on, which is the default, the two values are exchanged when Min is larger than Max. With it off and Min larger than Max, values below Min become Min and all other values become Max.

The array length and the order of its entries do not change. Only the values are limited, so the node can follow any node that outputs numbers or points.

Example Connections​

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