Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit15ce14a4c1

README.md

Scene composition

Require @builtin::assetTypes.scene.shared.composition.

compose(generated, intents, settingsEdits, options, previous?) computes a candidate scene document. Each entry in intents is keyed by persistent entity id and contains edits over the value returned by SceneRecords.saved. An entry can also carry captured bookkeeping for component additions. settingsEdits addresses the scene document with its entities field removed.

Options supply componentGuid(typeName) and componentName(guid) resolvers. externalEntities explicitly identifies entities supplied by an enclosing composition.

The result contains candidate, document, blocked, conflicts, and satisfied paths per entity. Field conflicts retain authored values. Missing edited entities, invalid parent graphs, dangling declared entity references and missing component-reference targets block the candidate. A blocked result returns an independent copy of previous as its visible document. Its edits remain the caller's durable input.

planMigration(canonical, visible, generated?, options) converts a legacy saved scene and its composed dirty state into a generated baseline, entity intents and settings intents. It validates that composing these inputs preserves every normalized visible entity and scene setting. Supply a recovered build baseline where available. Without one, retained content becomes authored additions and the plan reports unresolved baseline identities. Legacy deletions remain explicit intents even when only the saved record supplies their prior values. Build identity metadata survives on retained additions. The function writes no files; the migration coordinator owns source snapshots, revision checks, recovery and activation.

The composer validates entity references declared by captured entity_fields annotations and component-reference envelopes. Component schema and asset-specific validation belong to the caller's semantic validation pass. The function computes data; the caller chooses when to commit and activate that data.