#Editing DynamicScenes "live"

1 messages · Page 1 of 1 (latest)

frigid jungle
#

I'm working on a utility to let me play "paper doll" with Components and Entities - basically take an arbitrary list of Components from my project and drag + drop them onto a tree of entities/children.

It seems to me that DynamicScene should be an ideal way to represent that tree of entities, but I'm kind of unclear as to how I'd make new DynamicEntities and insert them into an existing DynamicScene - like do I just pin a "fake" World somewhere and have it generate entities for me?

Also, how the hell does one deal with (de)serializing asset handles for stuff like images etc.? Should I be rolling my own solution for this or is there something baked into Bevy for me to use?

frigid jungle
#

After some research:

AFAICT nothing in core Bevy provides fit-for-purpose answers to "how do I serialize asset handles."

The plumbing involved in loading Assets provides some hooks you could leverage if you're loading scenes as Assets, but if you're dog-fooding data from a running instance of Bevy such as with an editor or save-game, you also have to solve for "how do I serialize asset handles," because writing down a pointer address probably isn't going to be very useful. This project has some useful plumbing for reference - see src/reflect/prefab.rs & src/reflect/snapshot/buidler.rs

Research continues in identifying whether or not there's a "not awful" way to generate placeholder Entity values for use in a DynamicScene or if this is even a remotely good idea.

GitHub

A framework for saving and loading application state in Bevy. - hankjordan/bevy_save