Skip to content
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

Reuse and hot reload folder handles #10210

Merged
merged 5 commits into from
Oct 26, 2023

Conversation

NiklasEi
Copy link
Member

@NiklasEi NiklasEi commented Oct 21, 2023

Objective

  • Folder handles are not shared. Loading the same folder multiple times will result in different handles.
  • Once folder handles are shared, they can no longer be manually reloaded, so we should add support for hot-reloading them

Solution

  • Reuse folder handles based on their path
  • Trigger a reload of a folder if a file contained in it (or a sub folder) is added or removed
    • This also covers adding/removing/moving sub folders containing files

@cart cart added this to the 0.12 milestone Oct 21, 2023
@NiklasEi NiklasEi force-pushed the reuse_and_reload_folder_handles branch from 7e21e69 to 3a89d9c Compare October 21, 2023 01:48
@NiklasEi NiklasEi added C-Feature A new feature, making something new possible A-Assets Load files from disk to use for things like images, models, and sounds labels Oct 21, 2023
@NiklasEi NiklasEi force-pushed the reuse_and_reload_folder_handles branch from 3a89d9c to 3bf15bf Compare October 22, 2023 13:39
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on the changes here, but I definitely think we should document this behavior.

@NiklasEi
Copy link
Member Author

I extensively tested this change together with asset processing using the asset_processing example. The PR is now handling more asset source events and seems to work well with processing.

@cart cart enabled auto-merge October 26, 2023 22:04
@cart cart added this pull request to the merge queue Oct 26, 2023
Merged via the queue into bevyengine:main with commit bfca438 Oct 26, 2023
ameknite pushed a commit to ameknite/bevy that referenced this pull request Nov 6, 2023
# Objective

- Folder handles are not shared. Loading the same folder multiple times
will result in different handles.
- Once folder handles are shared, they can no longer be manually
reloaded, so we should add support for hot-reloading them


## Solution

- Reuse folder handles based on their path
- Trigger a reload of a folder if a file contained in it (or a sub
folder) is added or removed
- This also covers adding/removing/moving sub folders containing files

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Folder handles are not shared. Loading the same folder multiple times
will result in different handles.
- Once folder handles are shared, they can no longer be manually
reloaded, so we should add support for hot-reloading them


## Solution

- Reuse folder handles based on their path
- Trigger a reload of a folder if a file contained in it (or a sub
folder) is added or removed
- This also covers adding/removing/moving sub folders containing files

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
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-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants