-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Save & load): new crate bevy_gltf_save_load + lots of upgrades & improvements #95
Merged
Conversation
This file contains 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
* added example * experimenting with generating gltf * changes to standard bevy scene serialization to get a better grasp
…in main scenes * ie if a collection instance (or its original collection) has a "dynamic" (aka mutable, saveable etc) flag it can get exported to a seperate gltf file (essentially acting like an "initial save") * the rest of the levels (the "static" data) is exported WITHOUT the dynamic objects and CAN BE REUSED with save files !!! * very inneficient for now, but works fine
…mple ! * both initial load & load-after-save work similarly * ie load static level data first, then load "saved" data , inject into game world, done ! * it REALLY works !! and so simple !! * to make sure entities get respawned with their blueprints, "SpawnHere" components get injected back into saveable entities before the actual saving * very minor nitpick : loaded data for dynamic scene is still agressively cached by Bevy so you need to restart to get the latest save to work
* saving & loading repeateadly now works correctly
* cleaned up save & load, now works with events where you can specify save file * found a crucial bug with children added to a blueprint instance.. wip * experimenting with save filtering * experimenting with adding flags to all sub entities of a blueprint instance * attempts at fixing these hierarchy problems at the crate level (where it should be) * experimenting with entity id remapping etc * etc
* simplified spawning process, no more spawning children containg blueprints etc * simplified post process : instead of copying original entity into blueprint root we now copy blueprint root data (components & children) into the original entity ! * much simplier code wise * solves issue with needing to register components that we only use on the bevy side (not gltf) since we are not copying the bevy data into the blueprints data * removes need for remapping entity ids when nesting blueprints at runtime * modified aabb calculation to match other changes * a ton of related cleanups, more to come
…nts internal logic * added copyComponents helper to copy components from one entity to another, excluding existing components on the target entity, & some bells & whistles * components are now correctly copied from the blueprint to the original entity * removed second post process step as it is not needed anymore * cleaned up code
* further cleanups * bumped version for future release
* found a way to seperate extraction of root (no parent other than dynamicroot) from other entities to avoid serializing their parents, which leads to issues * basically saving & loading, even with dynamically spawned hierarchies WORKS * experimented with loading level as blueprint * added clearing of loaded dynamicscene handle after it has been loaded: you can now save & load any number of times withouth issues * renamed previously failing spawn system (because of unregistered components) that now works correctly in all relevant examples * tweaks & more experiments
* scene filter + save path root are now configurable * related changes + various other cleanups
* cleanups, related tweaks
* moved code around to have it working * updated boilerplate (cargo files etc) * added LoadingFinished event & its handling in example to change state in the user code , not the crate * removed any references to state in the crate * experimented with injecting the static world name into the dynamic data, so that the save file contains information about the static world & loading of the static data is now done after the dynamic data is loaded * various minor tweaks & changes
* for saving: added removal & cleanup logic for children component with children that have been filtered out: ie no more invalid children getting stored in the save files ! * added sending of event once saving is done * cleanups & tweaks
…handling * saving & loading state are now GameStates, not appStates * added a bit of ui when entering saving & loading states & cleanup when exiting * improved handling of save & load events
…ew issues * now injecting a resource after the initial event to make sure it lives long enough for all systems * added a second marker resource to make sure the "post process" part has time to run & is seperate from the first part * removed sub sets * various tweaks & experiments
* added NoInBlueprint component to have finer control over whether to inject the 'InBlueprint' component or not * minor cleanups
* transforms are now optional when spawning a blueprint * added NoInBlueprint (optional) component to prevent injecting of "InBlueprint" components when we do not want it * added Library (optional) component, so we can override library path when we want * sorted parameters to main functions, optional ones at the end
* moved out bevy_gltf_blueprints/basic_save to a new bevy_gltf_save_load examples folder * lots of cleanups
* removed transform from bundle * cleaned up the code a bit * updated the README
* renamed entity_filter to component_filter * moved a few components to the presets (ie always present) components * added & fleshed out docs * tweaks & cleanups
* cleaned up some assets
* added optional convenience AddToGameWorld component to automatically add entities to the game world, if there is one
* renamed dynamic/static split preference for more clarity * updated & fleshed out docs
* bumped patch version for release
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.
feat(bevy_gltf_save_load): saving & loading implemented
that have been filtered out: ie no more invalid children getting stored in the save files !
feat(examples/save-load): example for the new crate
feat(bevy_gltf_blueprints): significant rewrite of how the crate works
we now copy blueprint root data (components & children) into the original entity ! fixes Fix need to register every component for bevy_gltf_blueprints, even if they are not needed for the gltf -> components logic #96
since we are not copying the bevy data into the blueprints data
components on the target entity, & some bells & whistles
chore(bevy_gltf_components): removed verbose output, cleaned it up a bit
feat(tools/auto_export): added option to split out "dynamic" objects in main scenes
flag it can get exported to a seperate gltf file (essentially acting like an "initial save")
can be reused with save files !