#Help with Asset workflow

5 messages · Page 1 of 1 (latest)

tardy ferry
#

Hello, I am a newbie to bevy but have really enjoyed the ECS workflow so far. I know that bevy is in its early stages , but in order to learn bevy and rust, I have decided to make an application for editing custom assets that I can then export to my future game assets folder. I have already used the example from the bevy examples to create a custom Asset, but it seems most of the documentation is around loading assets. All of the assets have a name field that is a String and I would the associated file name to be changed when the asset name is changed. What is the recommended way to perform save operations on assets and/or changing the file names with the change of the asset name? Should I use the std::fs library or the built in bevy::asset::io library or should I be using the AssetSaver implementation

velvet copper
#

I'm a bevy noob, but if you're implementing AssetLoader::load, then using AssetSaver::save would be the logical step.

tardy ferry
#

I agree, but with loading you get the AssetServer resource and call the load method. However AssetServer doesn’t have a save method and I can’t seem to find another resource type that has that save method. Additionally I would still like the ability to rename the file without losing connection to all the Handle’s for that asset. So I’m also toying with the idea of manual file write operations and firing an event that has the old id and the new load path that would just update the handle in another system. But that seems like it may be overly complicated and then I discovered the bevy::asset::io module and was wondering internally if that handles all of that for me

#

Then I also stumbled across the AssetTransformer trait and didn’t know how that is supposed to be factored in

dim dirge
#

I think there are details for how another user did this here #assets-dev message