Skip to main content

vArrayWeightByMeshProx

Outputs a 0 to 1 weight per point from its distance to the closest mesh vertex.

IntermediateMograph / ArrayArrayScriptValJSON
vArrayWeightByMeshProx node

vArrayWeightByMeshProx takes an array of XYZ points and a mesh, and outputs one weight per point on the Output socket. A second output, Points, holds the points projected toward the mesh.

Parameters​

ParameterTypeDefaultDescription
Max DistanceFloat0.5Distance at which the weight reaches 1. Minimum 0.0001, slider 0.0001 to 10, default 0.5.
FalloffDropdownLinearLinear (default), Squared or Root. The shape of the weight.
Invert WeightInteger0Uses 1 minus the weight when on. Default off.
Project AmountFloat1How far the Points output moves toward the closest vertex. Range 0 to 1, default 1.
PointsDATATYPE—Points to weigh.
+1 more parameters
ParameterTypeDefaultDescription
Mesh PointsDATATYPE—Mesh vertices that distances are measured to.
Read the full description

For each point the node finds the closest Mesh Points vertex and takes the distance d. The raw weight is min(1, d / Max Distance), which is 0 at the mesh and 1 at Max Distance or farther. Falloff shapes it: Linear uses it as it is, Squared squares it, Root takes the square root. Invert Weight turns the weight into 1 minus it. Max Distance defaults to 0.5 and has a minimum of 0.0001.

The Points output holds each point moved toward its closest vertex by Project Amount (0 to 1, default 1), so by default it holds the vertices. Both outputs have the array and size wrapper. With an empty mesh both outputs are empty.

Example Connections​

vArrayPointsOnGrid.Output -> vArrayWeightByMeshProx.ArrayPoints
vArrayFromOBJ.Points -> vArrayWeightByMeshProx.MeshPoints
vArrayWeightByMeshProx.Output -> vArrayApplyMask.Mask