-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
load_untyped has issues loading scenes from gltf files #10436
Comments
I think it's failing because |
It seems to happen here: bevy/crates/bevy_asset/src/server/mod.rs Line 446 in 0cc1179
For some reason just before the bug happens, Edit: diving deeper: untyped TypeId { t: 237053916966532227674992742134880052298 } scene TypeId { t: 109858301795979688433023594662162045982 } gltf TypeId { t: 125106640790734373050133807998316083405 }
<...>
[/home/nocta/Travail/Perso/Contributions/bevy/crates/bevy_asset/src/loader.rs:376] handle.clone() = StrongHandle<Scene>{ id: Index(AssetIndex { generation: 0, index: 0 }), path: Some(cup.glb#Scene0) }
[/home/nocta/Travail/Perso/Contributions/bevy/crates/bevy_asset/src/loader.rs:377] handle.clone().untyped() = StrongHandle{ type_id: TypeId { t: 125106640790734373050133807998316083405 }, id: Index(AssetIndex { generation: 0, index: 0 }), path: Some(cup.glb#Scene0) } Edit 2: here: bevy/crates/bevy_asset/src/server/mod.rs Line 391 in 0cc1179
path is cup.glb#Scene0 loader.asset_type_id() is 125106640790734373050133807998316083405 loader.asset_type_name() is bevy_gltf::Gltf
|
have same error with gltf |
# Objective Fixes #10436 Alternative to #10465 ## Solution `load_untyped_async` / `load_internal` currently has a bug. In `load_untyped_async`, we pass None into `load_internal` for the `UntypedHandle` of the labeled asset path. This results in a call to `get_or_create_path_handle_untyped` with `loader.asset_type_id()` This is a new code path that wasn't hit prior to the newly added `load_untyped` because `load_untyped_async` was a private method only used in the context of the `load_folder` impl (which doesn't have labels) The fix required some refactoring to catch that case and defer handle retrieval. I have also made `load_untyped_async` public as it is now "ready for public use" and unlocks new scenarios.
# Objective Fixes #10436 Alternative to #10465 ## Solution `load_untyped_async` / `load_internal` currently has a bug. In `load_untyped_async`, we pass None into `load_internal` for the `UntypedHandle` of the labeled asset path. This results in a call to `get_or_create_path_handle_untyped` with `loader.asset_type_id()` This is a new code path that wasn't hit prior to the newly added `load_untyped` because `load_untyped_async` was a private method only used in the context of the `load_folder` impl (which doesn't have labels) The fix required some refactoring to catch that case and defer handle retrieval. I have also made `load_untyped_async` public as it is now "ready for public use" and unlocks new scenarios.
# Objective Fixes bevyengine#10436 Alternative to bevyengine#10465 ## Solution `load_untyped_async` / `load_internal` currently has a bug. In `load_untyped_async`, we pass None into `load_internal` for the `UntypedHandle` of the labeled asset path. This results in a call to `get_or_create_path_handle_untyped` with `loader.asset_type_id()` This is a new code path that wasn't hit prior to the newly added `load_untyped` because `load_untyped_async` was a private method only used in the context of the `load_folder` impl (which doesn't have labels) The fix required some refactoring to catch that case and defer handle retrieval. I have also made `load_untyped_async` public as it is now "ready for public use" and unlocks new scenarios.
Bevy version
0.12.0
What you did
Load a scene using
AssetServer#load_untyped
The following code crashes with a type Id miss match:
The app does not crash when directly loading the asset as a
Handle<Scene>
(as expected).What went wrong
This crashes because at some point it expects a handle Id to have a different type id than it actually has (seems to be
Gltf
instead of the expectedScene
).Log and partial stack trace from running the code above as an example:
Additional information
This currently breaks loading scenes in
bevy_asset_loader
The text was updated successfully, but these errors were encountered: