-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support for nested folders #41
Comments
Under the hood, 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). |
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:
to:
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. |
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. |
No worries, Yeah that sounds very reasonable, I will go ahead and file an issue. Thanks! |
I see an issue for something like this already exists, I will link it here: |
I would love to see some support for nested folder structures, for example:
perhaps in the form of an argument to the asset attribute, maybe
recursive
?alternatively the folder could be modelled as a dictionary, with keys representing the relative/absolute paths, in case these have some meaning to the developer.
In the case that the folder contains mixed assets, these could simply be ignored to accommodate use-cases where different asset types must be stored alongside each other.
Happy to help if necessary!
The text was updated successfully, but these errors were encountered: