Some improvements to ScatterCache#239
Merged
Merged
Conversation
Previously the "Clear Cache" button had no function due to the cleared cache not being saved to disk. This commit solves that. Furthermore, saving was done on the main thread, which can cause the editor to become unresponsive if there are many objects being generated by Scatter nodes (files over 100MB were sure to freeze the editor for a second or two), so now it is saved on a separate thread unless the "dbg_disable_thread" variable is enabled... and the same now applies to loading the scatter cache as well, which did not load on the main thread if that was enabled previously. Related to issue HungryProton#238
Owner
Following up on adjustments requested on the PR.
Contributor
Author
|
And done. If there's anything else, please do share. |
Owner
|
All good, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After expanding my main scene (and littering it with objects populated by scatter), i began to notice that the cache was taking a while to save, freezing the whole editor in the process.
This commit solves that by saving the cache file on a separate thread unless the "dbg_disable_thread" variable is enabled on the ScatterCache node... the "Clear Cache" button now has a use as well, as it now saves a cleared cache file (that is, no transforms or scatter nodes) onto the disk. I can't think of an use for it that's not debugging the saved file or cleaning up garbage data on it, so that's why it saves an effectively empty file.
Also, loading the cache file can now be done on the main thread if "dbg_disable_thread" is set to true as well.
I haven't found any issues on my end after using these changes for about a week, but i'm still open to discussions and suggestions.