Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

procgen.patch

Changes what one node call in a graph's code is given, without editing its text by hand. The call is named by the local it declares (call = "spots" for local spots = g.points.disc({ ... })) or by a line it spans.

  • set = { count = 80 } gives an input a plain value: a number, string, boolean, vector or a table of them.
  • set = { radius = { expr = "radius * 2" } } gives it code: a local's name, a formula, another call.
  • unset = { "seed" } leaves inputs to the node's defaults.

A call written with values by position is rewritten naming its inputs. The edit is written only once the graph builds with it, so a value the node does not take is refused naming the inputs it does.

procgen.modify makes the structural edits around a call (adding, removing, repointing, renaming, inputs and outputs). Part of procgen.toolbox, called as tools.use("procgen", "patch", ...) (zero procgen patch in the engine shell). Returns { line, callee, source, diagnostics }.