Comments (5)
I added a note in the readme about the recursive behaviour of loading a folder, thanks for pointing that out.
Keeping a path map for files in directories is also something I would see in the engine. This kind of behaviour also depends on your environment (e.g. usually non of this works in the browser) and should be baked into Bevy's AssetServer in my opinion. Maybe you want to file an issue on the engine repo for this? Once Bevy can do this, I would definitely add support here.
from bevy_asset_loader.
Under the hood, bevy_asset_loader
is just using Bevy's load_folder
here, which already is recursive. Your example should work without any new attribute needed. Does it not work for you?
Filtering for specific types is something I would see in the engine, not in this plugin. Possible APIs in Bevy have been discussed before (see e.g. bevyengine/bevy#2292).
from bevy_asset_loader.
Ah! I wasn't aware of the resistivity of folder loading! Perhaps it's me being blind or maybe this could be made clearer in the docs ?
Maybe it would be worth changing:
You can load all assets in a folder and keep them in an AssetCollection as a vector of untyped handles.
to:
You can recursively load all assets in a folder and keep them in an AssetCollection as a vector of untyped handles.
That's brilliant!
I guess this is also highly coupled to bevy's asset loader but would it be possible to support populating a mapping from relative paths to the handles instead of a simple Vec ?
This would likely involve searching the directory tree manually and then loading each asset individually (i.e. bypassing the load_folder, method), not sure if that's something you'd consider, but It would definitely be useful. One use case I can think of is storing prefabs under folders and linking their corresponding assets based on the path.
from bevy_asset_loader.
No worries,
Yeah that sounds very reasonable, I will go ahead and file an issue.
Thanks!
from bevy_asset_loader.
I see an issue for something like this already exists, I will link it here:
bevyengine/bevy#2147
from bevy_asset_loader.
Related Issues (20)
- Batch loading multiple assets with naming patterns
- May key type for the label of the asset HOT 1
- MacOS collecting HashMap from a Folder fails HOT 2
- bevy_asset_loader not working without the multi-threaded feature but shows no errors or warnings HOT 1
- load_untyped vs Custom AssetLoaders HOT 4
- (partial) Support for Asset loaders without extensions
- texture_atlas_layout not work with ron HOT 1
- Folder collection loading doesn't seem to work on Android HOT 2
- [Question] Loading assets with custom settings HOT 1
- Allow to have a `Handle<LoadedFolder>`
- allow deriving collections as arrays HOT 2
- Depend on bevy's subcrates directly instead of as `bevy` features HOT 7
- Already removed assets in code keeps trying to load it HOT 1
- Automate `reinterpret_stacked_2d_as_array`
- Notify user of derive macro for AssetCollection
- Bevy_asset_loader doesn't work with bevy/asset_processor feature (0.14 Crates Release) HOT 4
- Check loading state with dependencies HOT 2
- Crashes when loading a decent size folder of GLTF HOT 1
- Panic when using `image` annotation on `Handle<Image>` field HOT 2
- Investigate pattern to support asset changes without a loading state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy_asset_loader.