Copy & instancing

Randomise pscale in VEX

Give every point a random size so copies vary. Set @pscale on the target points before a Copy to Points, using fit01 and rand.

What it does

Writes a random per-point @pscale so that copies or instances placed on those points come out at varied sizes. rand(@ptnum) gives a stable 0..1 value per point, and fit01 remaps it into the size range you want.

When to use it

Use it on the target points before a Copy to Points or when rendering points as instances - scattered rocks, foliage, debris, any time uniform copies look too regular.

The VEX code

// Run on the TARGET points, before Copy to Points.
@pscale = fit01(rand(@ptnum), 0.5, 1.5);
Context: paste this into an Attribute Wrangle running over points, unless noted otherwise.

Inputs and assumptions

Common mistakes

Frequently asked questions

Where do I set pscale for copy to points?

On the target points - the points you copy onto - before the Copy to Points SOP. It reads @pscale from each point as a uniform scale.

How do I get non-uniform random scale?

Use a vector v@scale instead of the float @pscale, for example v@scale = set(1, fit01(rand(@ptnum),1,3), 1) to stretch vertically.

Open Houdini VEX Lab