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 sub-inherited scene proper node update #73717

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sodaJar
Copy link
Contributor

@sodaJar sodaJar commented Feb 21, 2023

Fixes #7984 sub-inherited scenes aren't updating properly because of two reasons:

  1. It doesn't detect a need to reload after switching to sub-inherited scenes
  2. Even if it reloads, phantom nodes that were deleted in an ancestor scene still remain

The problem appears to be that somehow after saving a parent scene, the inherited state is still has old version of the parent scene which allows inherited scenes to check for changes. However, this is not the case for some reason with the ancestor scene states.

So during check_and_update_scene(), the edited scene root is packed so user changes are kept, but the editor doesn't know which nodes that are there were 'original' and which were inherited from an ancestor scene, so it just keeps all the nodes.

For it to detect changes and update properly, the packed scene needs to know which nodes are inherited. This fix adds to edited scenes a set of node paths that only needs to be updated right before an ancestor scene is saved so it knows which nodes are inherited. The set is cleared after each reload of the sub-inherited scene to signal that it's up to date.

(I suspect there is a way to make the base scene states update properly which solves the problem but haven't had time to look at it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub-inherited scene is not updated properly in the editor
2 participants