Skip to content

scene_assets.h

Ludus Wiki · API overview · Browse API

File

Durable, content-addressed scene assets shared by ludus-cook and the Editor.
Byte-identical port of the retired Python scene_assets.py. Loose files are the storage profile: immutable artifacts live in assets/objects/<key>.bin and assets/catalog.json is the commit point, so readers never observe half an import. Level documents (.lulevel) bind logical UUIDs; the catalog resolves exact artifact revisions. Levels and catalogs cross this API as canonical JSON bytes (sorted keys, compact separators, ASCII escapes, trailing newline), exactly as they are stored on disk.
Writers take an exclusive flock on assets/.scene-writer.lock; readers take a shared lock only when that file exists. Locks are re-entrant per thread for the same project root; upgrading a reader to a writer fails with AssetErrorCode::Busy. Every function performs synchronous file I/O and is intended for tool processes and Editor worker threads.

Declared in modules/content/scene_cook/include/ludus/content/scene_cook/scene_assets.h