-
-
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
Fix GLTF scene dependencies and make full scene renders predictable #10745
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but any chance we add tests for some of these things so they don't regress in the future?
@@ -711,6 +711,13 @@ impl AssetServer { | |||
.unwrap_or(RecursiveDependencyLoadState::NotLoaded) | |||
} | |||
|
|||
/// Returns true if the asset and all of its dependencies (recursive) have been loaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth linking to this from the standard is_loaded
method.
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
I'm on board for more tests, but that will require engineering effort that would otherwise delay 0.12.1 so I'm not going to block on that. |
…10745) # Objective Fixes #10688 There were a number of issues at play: 1. The GLTF loader was not registering Scene dependencies properly. They were being registered at the root instead of on the scene assets. This made `LoadedWithDependencies` fire immediately on load. 2. Recursive labeled assets _inside_ of labeled assets were not being loaded. This only became relevant for scenes after fixing (1) because we now add labeled assets to the nested scene `LoadContext` instead of the root load context. I'm surprised nobody has hit this yet. I'm glad I caught it before somebody hit it. 3. Accessing "loaded with dependencies" state on the Asset Server is boilerplatey + error prone (because you need to manually query two states). ## Solution 1. In GltfLoader, use a nested LoadContext for scenes and load dependencies through that context. 2. In the `AssetServer`, load labeled assets recursively. 3. Added a simple `asset_server.is_loaded_with_dependencies(id)` I also added some docs to `LoadContext` to help prevent this problem in the future. --- ## Changelog - Added `AssetServer::is_loaded_with_dependencies` - Fixed GLTF Scene dependencies - Fixed nested labeled assets not being loaded --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Objective
Fixes #10688
There were a number of issues at play:
LoadedWithDependencies
fire immediately on load.LoadContext
instead of the root load context. I'm surprised nobody has hit this yet. I'm glad I caught it before somebody hit it.Solution
AssetServer
, load labeled assets recursively.asset_server.is_loaded_with_dependencies(id)
I also added some docs to
LoadContext
to help prevent this problem in the future.Changelog
AssetServer::is_loaded_with_dependencies