Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

entity

The entity.* source ops: live scene entities read into a procedural graph.

Data in procgen otherwise flows one way — graph to scene — so a Generator's only inputs are the numbers in its inspector. These ops are the other direction. They are ordinary source ops, wired like any other at any depth in a graph, and what an artist can grab in the viewport becomes what the graph is built from.

OpReadsYields
entity.transformone entity's poseTransform, plus position / rotation / scale
entity.pointsa set of entities, or one handle entity's childrenpoints (a Geometry), carrying scale and up point attributes
entity.geometryone entity's Model meshGeometry, in the mesh's own space or posed into the world
entity.boundsone entity's world boxBounds, its own or its whole hierarchy's

entity.points is the one that changes what a graph can be: draggable markers become curve control points, scatter seeds, or anything else that eats points.

The Entity reference

An Entity param is a reference, the way an AssetRef references an asset: the entity's Name or its id as a string — the form a graph persists — or a live entity proxy, which a direct proc.ops.entity.* call can hand over. Entity[] is the ordered list form.

A reference that names no entity, an entity carrying no Model when entity.geometry asks for one, an empty set, a handle with no children, an entity with nothing to measure: each raises at the call, naming the param and the reference. None of them yields an empty value for the graph to carry.

Invalidation

A source op has no inputs, so nothing about its wiring changes when the scene does. Its cache key would stay constant while the value it produces moved, and every node downstream would keep serving what was cooked against the old scene — cache = "never" does not fix that, because the op would re-run while its key, and so its consumers' keys, stayed put.

Each op here declares liveKey(params), returning a digest of exactly the scene state its eval reads: the entities' ids and poses, the mesh a Model names, the box an entity occupies. The evaluator folds that digest into the node's cache key alongside its params and upstream keys. Moving an entity therefore re-keys the node that read it and, through the producer key its consumers fold, the whole cone downstream of it — while every branch beside it keeps its cache entry. An unchanged scene re-keys nothing, because the digest is derived from the state rather than from the fact that a cook happened.

procgenEntity.testSuite measures all of it, cascade included.