-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Assets: fix first hot reloading #9804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After digging around, I agree with both of these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce the issue and the fix in the asset_processor
example.
One thing I noticed: with the fix, everything will be reloaded once after startup. I guess the processing is triggering some file event? But I would not block on that since it only happens the first time and is less of an issue compared to no hot reloading at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed merge conflicts. This removes your "no watching for asset processor server" change, as the equivalent already exists thanks to the Multiple Asset Sources pr.
# Objective - Hot reloading doesn't work the first time it is used ## Solution - Currently, Bevy processor: 1. Create the `imported_assets` folder 2. Setup a watcher on it 3. Clear empty folders, so the `imported_assets` folder is deleted 4. Recreate the `imported_assets` folder and add all the imported assets - On a first run without an existing `imported_assets` with some content, hot reloading won't work as step 3 breaks the file watcher - This PR stops the empty root folder from being deleted - Also don't setup the processor internal asset server for file watching, freeing up a thread --------- Co-authored-by: Carter Anderson <[email protected]>
# Objective - Hot reloading doesn't work the first time it is used ## Solution - Currently, Bevy processor: 1. Create the `imported_assets` folder 2. Setup a watcher on it 3. Clear empty folders, so the `imported_assets` folder is deleted 4. Recreate the `imported_assets` folder and add all the imported assets - On a first run without an existing `imported_assets` with some content, hot reloading won't work as step 3 breaks the file watcher - This PR stops the empty root folder from being deleted - Also don't setup the processor internal asset server for file watching, freeing up a thread --------- Co-authored-by: Carter Anderson <[email protected]>
Objective
Solution
imported_assets
folderimported_assets
folder is deletedimported_assets
folder and add all the imported assetsimported_assets
with some content, hot reloading won't work as step 3 breaks the file watcher