Mutate

Apply random structural mutations to an expression or shape composition.

What it does

Mutate takes a pattern or a shape composition and produces one or more randomly-varied descendants of it. Each variant is built by applying a chosen number of mutation steps: growing new ingredients onto it, replacing existing ones, nudging numeric values, grafting in a piece of a wired donor, pruning parts away, or regrowing a branch from scratch. Seed controls which random variants come out. Severity controls how far numeric nudges stray from their original values.

Set Count above 1 for a list of variants from one Mutate node rather than duplicating the node, for a batch to sort or cherry-pick from.

Mutate carries the same palette Evolve does, with the same meaning: how often each kind of ingredient is used when a mutation introduces something new. The palette shown follows what is wired in, the maths and noise categories for a pattern, the primitives and shape operators for a shape composition.

When to use it

ParameterTypeDefaultWhat it does
inputField or Collection—Expression field or CRC shape to mutate
seedNumber42Random seed for mutation
countNumber1Number of variant outputs (1 = single, N = list of variants)
mutationsNumber3Number of mutation steps per variant
severityNumber0.300Parameter jitter magnitude (higher = larger changes to constants)
grow_weightNumber1Weight for growing the tree (adding operators above existing nodes)
replace_weightNumber1Weight for replacing operators with different ones
tweak_weightNumber1.500Weight for tweaking numeric parameters (constants, slopes, radii)
graft_weightNumber0.500Weight for grafting subtrees from graft sources
prune_weightNumber0.300Weight for pruning (removing operators, simplifying)
regrow_weightNumber0.300Weight for regrowing (replacing subtrees with fresh random ones)
periodicNumber1How often periodic operators are introduced: sin, cos, triangle wave, sawtooth. 0 = never
smoothNumber1How often smooth operators are introduced: tanh, sigmoid, gaussian. 0 = never
sharpNumber0How often sharp operators are introduced: abs, sign, floor, fract. 0 = never
arithmeticNumber1How often two branches are COMBINED (add, multiply) instead of one being wrapped — the tree's bushiness. 0 = never
tiling_opsNumber0How often the tiling operator (fract — repeating patterns) is introduced. Adds to `sharp`'s share of it. 0 = never
sphereNumber1How often a mutation introduces a sphere. 0 = never
cubeNumber1How often a mutation introduces a box. 0 = never
torusNumber1How often a mutation introduces a torus. 0 = never
cylinderNumber0How often a mutation introduces a cylinder. 0 = never
coneNumber0How often a mutation introduces a cone. 0 = never
superquadricNumber1How often a mutation introduces a superquadric. 0 = never
boolean_opsNumber1How often a mutation combines two shapes (union/intersect/subtract) rather than wrapping one. 0 = never
displacedNumber1How often a mutation introduces noise-based surface displacement. 0 = never
offset_opsNumber0How often a mutation introduces a uniform shell offset. 0 = never
repeat_opsNumber0How often a mutation introduces infinite tiling repetition. 0 = never
graft_countNumber0Number of graft source inputs — wire in Fields or Shapes as cross-pollination donors
opacityNumber1Layer opacity (0 = transparent, 1 = opaque). Editable, wirable, keyframable.

Gotchas

Arithmetic decides combining versus wrapping. Regrowing a branch or grafting a donor in either combines two parts (add, multiply; union, intersect, subtract for shapes) or wraps one part in a single new ingredient. Arithmetic, which is Boolean Ops on the shape palette, is how often it combines, measured against everything else in the palette. At the defaults that works out to combining about a third of the time, so a default Mutate wraps roughly twice as often as it combines. Raise Arithmetic for busier, more branched offspring; lower it for offspring that stay closer to the parent's outline.

Graft needs donors. Raise Graft Source count, wire a second pattern or shape into the new inputs, and Graft weight starts splicing pieces of the donors into each variant. With nothing wired, Graft has nothing to pull from and the step falls back to the other mutation types. Donors are picked evenly, so with two wired each contributes about half the grafts.

The mutation-type weights (Grow, Replace, Tweak, Graft, Prune, Regrow) are relative and need not sum to anything in particular. Raise one to make that kind of change more likely per mutation step, or set it to 0 to rule it out.

Tweak nudges in proportion. A numeric nudge is a fraction of the value's own size, so a small number gets a small nudge and a large one gets a large nudge. That keeps a pattern's zoom, a radius and an offset all moving by a sensible amount from one Severity setting, instead of a fixed step that barely touches large values and throws small ones across their whole range. Raise Severity if the variants read as too timid.

Whatever is wired in is accepted. A pattern built by Evolve mutates as the composition it is. A baked field, an image, a volume, or a distance field, is lifted into a one-ingredient composition first, so mutation builds around it rather than passing it through untouched. Shape compositions mutate as shapes. A Collection with nothing shape-like in it is the one case that errors rather than guessing.

Worked example

  1. Add a Mutate node and wire an Evolve (or any shape or pattern) into Input.

  2. Raise Count to 8 to generate a batch of variants instead of one.

  3. Raise Severity if the variants look too similar to the source; lower it for subtler variation.

  4. Nudge Tweak weight up and Grow/Replace down for mostly numeric jitter rather than structural changes, then scrub Seed to browse different batches.

  5. Dial the palette to steer what new ingredients look like: the same Periodic / Smooth / Sharp / Arithmetic / Tiling weights Evolve uses for a pattern, or the primitive and operator weights for a shape.

  6. Raise Graft Source count and wire in a second composition to breed the two together.

See also

Evolve · Sort · Partition · Analytic shapes