Replace the load_folder API by load_batch#19760
Open
shishanyue wants to merge 18 commits intobevyengine:mainfrom
Open
Replace the load_folder API by load_batch#19760shishanyue wants to merge 18 commits intobevyengine:mainfrom
shishanyue wants to merge 18 commits intobevyengine:mainfrom
Conversation
ItsDoot
reviewed
Sep 3, 2025
Comment on lines
+11
to
+18
| pub fn new<T>(requests: Vec<T>) -> Self | ||
| where | ||
| T: Into<AssetPath<'static>>, | ||
| { | ||
| Self { | ||
| requests: requests.into_iter().map(Into::into).collect(), | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Nit, but nicer (allows more than just vec![foo, bar]):
Suggested change
| pub fn new<T>(requests: Vec<T>) -> Self | |
| where | |
| T: Into<AssetPath<'static>>, | |
| { | |
| Self { | |
| requests: requests.into_iter().map(Into::into).collect(), | |
| } | |
| } | |
| pub fn new<T>(requests: impl IntoIterator<Item = T>) -> Self | |
| where | |
| T: Into<AssetPath<'static>>, | |
| { | |
| Self { | |
| requests: requests.into_iter().map(Into::into).collect(), | |
| } | |
| } |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
About #19727
Solution
Testing
-rewrite the example texture_atlas.rs
Problem
But there have a problem.I can't get the base path.I need in load_batch_internal to glob the all file.
How can I obtain the unprocessed_path and processed_path under load_batch? I have used the crate glob. If I want to use it, I must prepend 'assets' to the path. However, it is evident that we can change it, and even add additional paths like in extra_file. Therefore, I need to retrieve the corresponding full path through AssetPath in load_batch. But I cannot find any method to achieve this.