Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

procgen.play

Plays a saved .procGraph on the preview stage, with nothing added to the scene, and answers what that play cost and what it drew. The graph plays from its first frame at its own rate, under the preview studio's camera and light, in a temporary generator that is taken away afterwards. Reach for it to measure an effect, or to see it at chosen moments, without standing it in the world.

  • graph names the .procGraph asset, by its VFS path or its name.
  • inputs gives values for the graph's inputs by name: each a value, or a path over the play's time, { { t, value }, ... }, linear between its points and held at its ends.
  • seconds is how long it plays. A timeline with an end plays one pass when none is given and never past its end; a timeline with no end plays 2 s when none is given.
  • at lists graph times in seconds to take a picture at, each of what the play draws, alone and framed to fit.
  • width and height size the pictures (default 512 by 512).

Every frame of the play is moved to and waited on with its clock held, however long its cook takes, so each frame is presented once and what each cost is recorded. Any other key is refused, naming the ones it takes.

tools.use("procgen", "play", { graph = "/source/scratch/Grow.procGraph", inputs = { grow = 2 }, seconds = 1, at = { 0.5 } })

Part of procgen.toolbox, called as tools.use("procgen", "play", ...) (zero procgen play in the engine shell). Returns { seconds, pictures, profile, graphs, report, playback }: the seconds played, one picture per time of at in order (each with the time the play presented), the profile report's text, its per-graph lines, the whole profile report, and where the play stood at the end.