Assets appear to be loaded by case-insensitive filename, but watched for changes by case-sensitive filename.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.11.0
## Relevant system information
Reproduced on both Windows 10 and 11.
## What you did
I attempted to implement asset hot reloading based on the examples
## What went wrong
In testing I found that all my assets loaded properly, but only a seemingly random subset of them automatically reloaded. I added a system to print out all asset events, and changing the 'bad' files didn't fire any asset events at all.
Help on the bevy discord ultimately noticed that the working files have capitalization matching the names as written in-code, and the non-working ones do not. Experimentally changing capitalization of the actual files and strings in code confirmed this.
## Additional information
An easy repro method is to take `examples/asset/hot_asset_reloading.rs`. To easily see changes I edited `"metallicFactor" : 0,` in the asset file, switching it between 0 and 1. In the example as provided it works fine. If I change `let scene_handle = asset_server.load("models/monkey/Monkey.gltf#Scene0");` to `let scene_handle = asset_server.load("models/monkey/monkey.gltf#Scene0");` and rerun it, the scene loads fine initially but now does not respond to changes to the file.
It's my understanding that some platforms have filesystems that care about case where Windows does not, so I imagine this might be a consequence of support for those platforms, but the inconsistent behavior seems bug-like to me.
Contributor guide
Research direction
Run examples/asset/hot_asset_reloading.rs using the capitalization mismatch described in the report, then inspect the asset loading and file-watching paths involved. Compare the behavior for Monkey.gltf and monkey.gltf; the issue is resolved when edits to either referenced capitalization trigger the expected asset reload events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100