-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
BSN editor infrastructure: write-back, asset catalog, persistent document - as implemented in Jackdaw #23637
Copy link
Copy link
Open
Description
Summary
Based on experimentation in Jackdaw (a 3D editor I created before BSN), I've found several pieces of BSN infra needed for editor tooling that would benefit the ecosystem.
@cart's PR #23630 explicitly mentions "It is not yet possible to write a World to BSN" as a gap. The subsequent PRs I plan to raise helps to address that, and other related gaps.
What we needed for a functioning BSN based editor in Jackdaw
- BSN write-back - serialize ECS World to
.bsntext (inverse of thebsn!macro) - Default-diffing - only emit non-default component fields (reduces noise, improves readability)
- Enum variant field serialization -
ColliderConstructor::Sphere { radius: 2.5 }not justColliderConstructor::Sphere- this was raised in discord as a bug I believe, but I've already had a fix for this inJackdaw - Asset catalog - shared named assets in
.bsnformat, referenced across scenes - Handle path resolution - bidirectional
Handle<T><---> asset path conversion - Persistent AST - retain parsed BSN for live editing (this was raised by @pcwalton in Implement dynamic BSN (.bsn asset format) #23576)
SceneDocument/SceneAssetCatalogAPIs - my solution for ergonomic editing viaScenePatchinstead of raw function calls
Planned PRs (building blocks first, then API)
- BSN scene writer (
serialize_to_bsn) - immediately necessary and beneficial, default-diffing for entity components and enum variant fields - Add BSN scene writer: serialize ECS World to .bsn text #23639 - Fix enum struct variant application in dynamic BSN - PR in @pcwalton's branch: Fix enum struct and tuple variant application in dynamic BSN pcwalton/bevy#21
- BSN asset catalog loading and serialization - Add BSN asset catalog: load, save, and labeled sub-asset registration #23648
- Persistent BSN AST and bidirectional sync
-
SceneDocumentAPI - editing viaScenePatch, load/save/spawn -
SceneAssetCatalogAPI - named shared asset management
Context
I've been working on converting Jackdaw to a BSN editor (inspector edits, entity creation, hierarchy changes, etc) where we write through BSN, and the ECS is derived from it so we can render previews in the viewport and such. I tried to keep the solution as generic as possible in Jackdaw so that we can upstream and prepare for the wider bevy-editor buildout based on these enhancements
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels