Share

randomize_selection

Randomizes the shapes placed on the points of an instances object.

Inputs

points

The instances object whose points are to be assigned random shape IDs.

weights

The probabilities that a point will be assigned a random shape.

  • 0 or less means that a point's shape is never randomized.
  • Values in the range 0—1 are the chance of a point's shape being randomized. For example, 0.5 means that there is a 50% probability that a point's shape gets randomized.
  • 1.0 or more means that a point's shape is always randomized.

If nothing is connected, the default weight is 1 for all points. This is an interpreted auto port that accepts the following types:

  • A single float is interpreted as a constant value for all points.
  • An array<float> is interpreted as values per point. The array gets resized to match the number of points, if necessary.
  • An array<bool> is interpreted as values of 0 (false) or 1 (true) per point.
  • A string is interpreted as the name of an existing geo property, and its values are used.
  • A ScalarField is sampled at each position of the geometry's components.
  • An array<long> specifies the indices to be assigned a value of 1. Other indices are assigned 0.

Randomization

min, max

The minimum and maximum random shape IDs to generate. The random values are in the range [min, max), meaning greater than or equal to min and less than max.

seed

The seed of the random number generator.

distribution

An FCurve that controls the distribution of random IDs. The default shape has no bias, but you can edit the curve to favor higher or lower IDs. This is mostly useful if the order of IDs has a meaning, for example, if they are in order of size. For more control of the distribution, consider using randomize_selection_by_probabilities instead of this compound.

Property

property

The name of the property that determines which shape gets instanced. You can change this if your graph is not using the default point_instance_id. The property must be of type array<long>.

component

The target component of the property port. This can usually be left unchanged.

Outputs

out_points

The instances object with randomized instance selections.

instance_ids

The point_instance_id values that were set on the geometry.

Was this information helpful?