Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset Server incorrectly parsing files with # in their name #13192

Open
thebluefish opened this issue May 3, 2024 · 2 comments · May be fixed by #13272
Open

Asset Server incorrectly parsing files with # in their name #13192

thebluefish opened this issue May 3, 2024 · 2 comments · May be fixed by #13272
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Design This issue requires design work to think about how it would best be accomplished

Comments

@thebluefish
Copy link
Contributor

Bevy version

0.13

What you did

  • Created a file assets/A#.ron
  • Attempted to load this file with bevy

What went wrong

Loading fails, the AssetServer returns LoadState::Failed for the relevant handle. The server appears to be attempting to load file "A" with a "#.ron" label.

Additional information

Based on this issue, I discovered that we can first convert the file to a Path:

asset_server.load("A#.ron") // fails
asset_server.load(Path::new("A#.ron")) // works
asset_server.load(Path::new("foo.gltf#Scene0")) // fails

However this is not a great solution, IMO ideally these could be unified in some way and a better method for handling the delimiter found.

@thebluefish thebluefish added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 3, 2024
@bugsweeper
Copy link
Contributor

bugsweeper commented May 3, 2024

Would it be comfortable to do it via tuple like asset_server.load((Path::new("A#.ron"), "Scene0")) ?

@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Design This issue requires design work to think about how it would best be accomplished and removed S-Needs-Triage This issue needs to be labelled labels May 3, 2024
@bugsweeper
Copy link
Contributor

bugsweeper commented May 8, 2024

@thebluefish there is a way to set path with hash and subasset at same time explicitly with code like this
asset_server.load(AssetPath::from_path(Path::new("A#.ron")).with_label("Scene0"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
3 participants