Open Anti-Alias opened 3 months ago
I too tried to run "hot_asset_reloading" (cargo run --example hot_asset_reloading --features file_watcher
).
I ran it on the main branch version of bevy, and 0.14.1.
Neither of them worked when changing the scale and rotation, although both versions detect a change of the torus.gltf file, and prints to the console (... INFO bevy_asset::server: Reloading models\torus\torus.gltf because it has changed
)
Maybe rotation and scale on gltf is only updated on app restart, and if so, I think there should be added some documentation, to inform people that some fields are not affected by hot reloading.
I'm on windows 10, I don't know if operating system has anything to do with this though.
I might make a small example reproducing the lack of AssetEvent::<T>::Modified
being fired for a variety of assets.
Today I tried changing the config loading plugin I made (Github Repo), so that it doesn't require a Default implementation, and ran into the same issue as described above.
Before the asset was loaded with asset_server.load(...)
, however I changed it to be instantiated through asset_server.add(...)
, and then loading the asset itself with ron::de::from_str(...)
.
When doing it like this, both AssetEvent::LoadedWithDependencies
and AssetEvent::Added
gets called, however, AssetEvent::Modified
no longer gets called.
This is on bevy version 0.14.1. This means that it is not only and issue with the GLTF asset/assetloader, and at least also a problem with certain custom asset loader implementations.
@kaosat-dev this might be relevant for Blenvy
I can confirm this issue being present in 0.14.1, although it worked correctly in the last Bevy rc as far as I can remember.
AssetEvent::Modified event is not triggered by Embedded asset reloading too.
INFO bevy_asset::server: 1387: Reloading entities.json because it has changed INFO bevy_asset::server: 1387: Reloading entities.png because it has changed
But zero AssetEvents are generated and systems can not reload changed assets.
Bevy version
0.14.1
Relevant system information
Tested on:
What you did
Ran the hot_asset_reloading example on my Window 10 desktop, and Ubuntu laptop.
CLI args:
What went wrong
Updating the torus gltf file does not update the model while running. Specifically, I updated the rotation quaternion in the file. Only restarting the app shows me the change.
Additional information
Editing the base color of the monkey model (same example) in version 0.11 seems to work, though if I add a rotation quaternion, the monkey's rotation only updates upon restarting the app.
On a personal project, I'm listening for image events
AssetEvent<Image>
:This system runs in the Update schedule. When starting up my game, my console logs the following:
After updating / saving an image file image a couple of times, the console log looks like this:
The four new lines at the end are bevy's internal logging. Clearly, bevy is detecting the change, but for some reason, it does not fire
AssetEvent::<Image>::Modified
events.The PBR models that I'm spawning do not seem to update either. They do update if I restart the app, or do something that causes them to reload manually.