five-on-it / apps/tools/src/export-level
apps/tools/src/export-level
From a scene document to level data: every node that is a block (it, or the source mesh it is an instance of, carries an enabled block script) or a kit piece (its source mesh says what it is in metadata.foi: { kind, collider, roads? }, the mesh modelled in Blender and installed in the scene) becomes a placement in the game's frame, a kit piece's mesh is mirrored into the game's frame and welded into the piece library, and the placements become a LevelData. Nodes under the _blocks library are the block sources themselves and are skipped; meshes that are neither are reported as warnings so a stray box does not go unnoticed. Every problem names its node. A pitched road slab is a road that climbs (see placementsToLevel).