-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add GltfLoader::new
.
#9120
Merged
Merged
Add GltfLoader::new
.
#9120
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In my application, I'm manually wrapping the built-in Bevy loaders with a wrapper loader that stores some metadata before calling into the inner Bevy loader. This worked for the glTF loader in Bevy 0.10, but in Bevy 0.11 it became impossible to do this because the glTF loader became unconstructible outside Bevy due to the new private fields within it. It's now in fact impossible to get a reference to a GltfLoader at all from outside Bevy, because the only way to construct a GltfLoader is to add the GltfPlugin to an App, and the GltfPlugin only hands out references to its GltfLoader to the asset server, which provides no public access to the loaders it manages. This commit fixes the problem by adding a public `new` method to allow manual construction of a glTF loader.
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
hymm
added
A-Assets
Load files from disk to use for things like images, models, and sounds
P-Regression
Functionality that used to work but no longer does. Add a test for this!
labels
Jul 11, 2023
james7132
approved these changes
Jul 11, 2023
james7132
reviewed
Jul 11, 2023
pcwalton
force-pushed
the
new-gltf-loader
branch
from
July 11, 2023 21:27
fc0c6ce
to
211e519
Compare
This should be ready to merge, I think. |
mockersf
requested changes
Jul 12, 2023
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.
Instead of adding a new method, could you make the fields of GltfLoader
public?
alice-i-cecile
added
the
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
label
Jul 12, 2023
cart
approved these changes
Jul 13, 2023
cart
added a commit
that referenced
this pull request
Aug 10, 2023
# Objective In my application, I'm manually wrapping the built-in Bevy loaders with a wrapper loader that stores some metadata before calling into the inner Bevy loader. This worked for the glTF loader in Bevy 0.10, but in Bevy 0.11 it became impossible to do this because the glTF loader became unconstructible outside Bevy due to the new private fields within it. It's now in fact impossible to get a reference to a GltfLoader at all from outside Bevy, because the only way to construct a GltfLoader is to add the GltfPlugin to an App, and the GltfPlugin only hands out references to its GltfLoader to the asset server, which provides no public access to the loaders it manages. ## Solution This commit fixes the problem by adding a public `new` method to allow manual construction of a glTF loader. --------- Co-authored-by: Carter Anderson <[email protected]>
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-Usability
A targeted quality-of-life change that makes Bevy easier to use
P-Regression
Functionality that used to work but no longer does. Add a test for this!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
In my application, I'm manually wrapping the built-in Bevy loaders with a wrapper loader that stores some metadata before calling into the inner Bevy loader. This worked for the glTF loader in Bevy 0.10, but in Bevy 0.11 it became impossible to do this because the glTF loader became unconstructible outside Bevy due to the new private fields within it. It's now in fact impossible to get a reference to a GltfLoader at all from outside Bevy, because the only way to construct a GltfLoader is to add the GltfPlugin to an App, and the GltfPlugin only hands out references to its GltfLoader to the asset server, which provides no public access to the loaders it manages.
Solution
This commit fixes the problem by adding a public
new
method to allow manual construction of a glTF loader.