Skip to content

BSN editor infrastructure: write-back, asset catalog, persistent document - as implemented in Jackdaw #23637

@jbuehler23

Description

@jbuehler23

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

  1. BSN write-back - serialize ECS World to .bsn text (inverse of the bsn! macro)
  2. Default-diffing - only emit non-default component fields (reduces noise, improves readability)
  3. Enum variant field serialization - ColliderConstructor::Sphere { radius: 2.5 } not just ColliderConstructor::Sphere - this was raised in discord as a bug I believe, but I've already had a fix for this in Jackdaw
  4. Asset catalog - shared named assets in .bsn format, referenced across scenes
  5. Handle path resolution - bidirectional Handle<T> <---> asset path conversion
  6. Persistent AST - retain parsed BSN for live editing (this was raised by @pcwalton in Implement dynamic BSN (.bsn asset format) #23576)
  7. SceneDocument / SceneAssetCatalog APIs - my solution for ergonomic editing via ScenePatch instead of raw function calls

Planned PRs (building blocks first, then API)

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions