Giter Site home page Giter Site logo

Comments (5)

NiklasEi avatar NiklasEi commented on August 16, 2024 1

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.

NiklasEi avatar NiklasEi commented on August 16, 2024

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.

makspll avatar makspll commented on August 16, 2024

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.

makspll avatar makspll commented on August 16, 2024

No worries,

Yeah that sounds very reasonable, I will go ahead and file an issue.

Thanks!

from bevy_asset_loader.

makspll avatar makspll commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.