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

Fix node tree caching #2500

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

MoritzBrueckner
Copy link
Collaborator

Fixes #2219.

Since 7a1acb6 there was a workaround in place to ensure that the cache of logic trees gets cleared very frequently because the depsgraph updates don't reflect all updates to logic trees. But because the always() callback only runs twice a second, it could happen that changes made to a tree weren't reflected in the build if the user starts the build before the always() callback was run. Now that we have dedicated tree update callbacks for live patching, we can use them to clear the cache on each change made to the node tree and get rid of the old workaround.

Note that the current approach is still a bit over-conservative (less than before though), for example the cache is also cleared when you start dragging a connection from a socket but cancel the operation before reaching the target socket. So there is still some potential for improvement in the future.

Fixes armory3d#2219.

Since armory3d@7a1acb6 there was a workaround in place to ensure that the cache of logic trees gets cleared very frequently because the depsgraph updates don't reflect all updates to logic trees. But because the `always()` callback only runs twice a second, it could happen that changes made to a tree weren't reflected in the build if the user starts the build before the `always()` callback was run. Now that we have dedicated tree update callbacks for live patching, we can use them to clear the cache on each change made to the node tree and get rid of the old workaround.

Note that the current approach is still a bit over-conservative (less than before though), for example the cache is also cleared when you start dragging a connection from a socket but cancel the operation before reaching the target socket. So there is still some potential for improvement in the future.
@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Jun 6, 2022
@luboslenco luboslenco merged commit 3cf226f into armory3d:master Jun 7, 2022
@luboslenco
Copy link
Member

Thanks!

@MoritzBrueckner MoritzBrueckner deleted the fix-logictree-cache branch June 7, 2022 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logic nodes] Armory 3D wont refresh node graphs after changing node connections or removing nodes.
2 participants