[3.x] SceneTreeFTI
- Fix force_update
flag for invisible nodes
#107178
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.
If the
force_update
flag remained set after the node was removed from the update lists, the node would never be updated in future. This could occur with hidden nodes that were moved after hiding.Fixes #107142
Backport of #107175
Explanation
The
SceneTreeFTI
relies on node flags being in sync with nodes being on various update lists. This bug occurred for the forced frame update list, because the node flag was being cleared in the tree traversal, however invisible nodes were never having their flag cleared, and once the list was cleared the flag and the list became out of sync.At further node movements, the logic determined incorrectly that the node was already on the update list.
We fix it by removing the flag manually on every node in the list rather than at traversal time.
Notes