Bevy version
0.3 from cargo
Operating system & version
Windows 10
What you did
Upgraded from bevy 0.1 to 0.3
Tried to load an asset with assert_server.load("folder/asset.ext")
What you expected to happen
Asset loaded.
What actually happened
Asset loader fails with file not found
Additional information
This is in a workspace application. Where assets are at the root,
I have also moved them into being next to the exectuable project (in case it is ran from there).
Copying the assets to be near the compiled .exe file in the target folder.
Running it directly instead of cargo run.
Also changing the path to be windows style.
While this is a custom asset, it appears to me its failing to try to load even find the files. I'm not sure why, i suspect maybe the behaviour of current working directory + relative paths is the issue here.
thread 'thread 'IO Task Pool (1)IO Task Pool (0)' panicked at '' panicked at 'called `Result::unwrap()` on an `Err` value: PathLoaderError(NotFound("assets/ship.aseprite"))called `Result::unwrap()` on an `Err` value: PathLoaderError(NotFound("assets/background.aseprite"))', ', C:\Users\Beau\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_asset-0.3.0\src\asset_server.rsC:\Users\Beau\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_asset-0.3.0\src\asset_server.rs::295295::6060
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'task thread panicked while executing: Any', C:\Users\Beau\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_tasks-0.3.0\src\task_pool.rs:75:18
The windows on my DELL XPS 13 don’t allow me to go beyond login phase.
I am currently using my IMAC as ac backup
Kind regards,
Raza77
On Sun, Nov 8, 2020 at 8:29 AM btrepp notifications@github.com wrote:
Bevy version
0.3 from cargo
Operating system & version
Windows 10
What you did
Upgraded from bevy 0.1 to 0.3
Tried to load an asset with assert_server.load("folder/asset.ext")
What you expected to happen
Asset loaded.
What actually happened
Asset loader fails with file not found
Additional information
This is in a workspace application. Where assets are at the root,
I have also moved them into being next to the exectuable project (in case
it is ran from there).
Copying the assets to be near the compiled .exe file in the target folder.
Running it directly instead of cargo run.
Also changing the path to be linux style.While this is a custom asset, it appears to me its failing to try to load
even find the files.thread 'thread 'IO Task Pool (1)IO Task Pool (0)' panicked at '' panicked at 'called
Result::unwrap()on anErrvalue: PathLoaderError(NotFound("assets/ship.aseprite"))calledResult::unwrap()on anErrvalue: PathLoaderError(NotFound("assets/background.aseprite"))', ', C:\Users\Beau.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_asset-0.3.0\src\asset_server.rsC:\Users\Beau.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_asset-0.3.0\src\asset_server.rs::295295::6060note: run with
RUST_BACKTRACE=1environment variable to display a backtrace
thread 'main' panicked at 'task thread panicked while executing: Any', C:\Users\Beau.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_tasks-0.3.0\src\task_pool.rs:75:18—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/bevyengine/bevy/issues/810, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHGK5TFZRJEJS2PVZYNAHS3SOYGAHANCNFSM4TOBRLRQ
.>
Raza Amir
I ran into this as well and looked at the updated examples. Since 0.3.0 bevy assumes you will use a folder named "assets"
So if you used to do let font: Handle<Font> = asset_server.load("assets/fonts/FiraMono-Medium.ttf");
you need to change it to let font: Handle<Font> = asset_server.load("fonts/FiraMono-Medium.ttf");
So in your case you probably need to create an assets folder, and put your files there.
(Rust is already fairly strict about file structure so I think it's an ok change to enforce consitency, but I also don't mind much either way.)
Also for anyone who is a bit perplexed as to where the assets folder should be. Here's what I have (in a workspace project)
assets at workspace root = doesn't work
assets at target/debug/assets = works only if running compiled game from target/debug
assets at workspaceroot/mainentry/assets = works.
For me workspace_root/assets worked btw. In case we mean the same thing with workspace_root (where your Cargo.toml is located).
Yup the rules are:
ROOT/assets. The "assets" folder can be configured by overriding the AssetFolderSettings resource.cargo run it will automatically detect the cargo workspace root and make that ROOTROOT the folder containing the binary
Most helpful comment
I ran into this as well and looked at the updated examples. Since 0.3.0 bevy assumes you will use a folder named "assets"
So if you used to do
let font: Handle<Font> = asset_server.load("assets/fonts/FiraMono-Medium.ttf");you need to change it to
let font: Handle<Font> = asset_server.load("fonts/FiraMono-Medium.ttf");So in your case you probably need to create an
assetsfolder, and put your files there.(Rust is already fairly strict about file structure so I think it's an ok change to enforce consitency, but I also don't mind much either way.)