Add BSN asset catalog: load, save, and labeled sub-asset registration#23648
Draft
jbuehler23 wants to merge 2 commits intobevyengine:mainfrom
Draft
Add BSN asset catalog: load, save, and labeled sub-asset registration#23648jbuehler23 wants to merge 2 commits intobevyengine:mainfrom
jbuehler23 wants to merge 2 commits intobevyengine:mainfrom
Conversation
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Addresses item 3 in #23637: BSN asset catalog loading and serialization.
Depends on #23576 (@pcwalton's dynamic BSN) - so a lot of the changes are duplicated here, and looks larger than it actually is!
Solution
Adds a BSN asset catalog module to
bevy_scene2for managing named assets in.bsnformat.What this adds!
1. Runtime loading (
load_bsn_assets)Parses BSN text containing named asset definitions and inserts them into
Assets<T>stores via reflection. Nothing triggers automatically, you call this when you need to load a catalog at runtime (ie, editor startup, level load).Only non-default fields are written! (metallic: 0.0 is omitted for
RoughStonesince it's the default).Example loads four named materials from the catalog, and displays them on spheres with different PBR properties. You will see that it "loaded" the assets on startup, and then on save you will see the BSN asset catalog get written.
This is a port of
Jackdaw's shared asset catalogue in JSN, for BSN!