Skip to content

Hot asset reloading example does not update when saving torus.gltf #14698

@Anti-Alias

Description

@Anti-Alias

Bevy version

0.14.1

Relevant system information

Tested on:

  • Windows 10
  • Linux (Ubuntu)

What you did

Ran the hot_asset_reloading example on my Window 10 desktop, and Ubuntu laptop.

CLI args:

cargo run --example hot_asset_reloading --features file_watcher

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>:

pub fn read_image_events(
    mut events: EventReader<AssetEvent<Image>>,
) {
    for event in events.read() {
        println!("Got event: {event:?}");
    }
}

This system runs in the Update schedule.
When starting up my game, my console logs the following:

Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 3, generation: 0} }
Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 5, generation: 0} }
Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 4, generation: 0} }

After updating / saving an image file image a couple of times, the console log looks like this:

Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 3, generation: 0} }  // Old
Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 5, generation: 0} }  // Old
Got event: Added { id: AssetId<bevy_render::texture::image::Image>{ index: 4, generation: 0} }  // Old
2024-08-10T20:33:26.687117Z  INFO bevy_asset::server: Reloading maps\tilesets\spring_forest.png because it has changed // New
2024-08-10T20:33:26.769548Z  INFO bevy_asset::server: Reloading maps\tilesets\spring_forest.png because it has changed // New
2024-08-10T20:33:39.859572Z  INFO bevy_asset::server: Reloading maps\tilesets\spring_forest.png because it has changed // New
2024-08-10T20:33:39.951233Z  INFO bevy_asset::server: Reloading maps\tilesets\spring_forest.png because it has changed // New

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions