Skip to content

Fix inherited nested scenes not updating #107913

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

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

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jun 23, 2025

Fixes #7984 and related issues (#85562 (comment))

However it's broken XD

The bug is twofold. First is that when checking for scene changes, EditorData only checked one level of inheritance. This was trivial to fix and required just 2 lines of change.

The fun begins here:

if (modified_time != ss->get_last_modified_time()) {

ss->get_modified_time() may return either old time or new time.
It returns old time from a copy of old SceneState in node.
However higher levels of inheritance keep their SceneState in a PackedScene, which sits in ResourceCache. This means that when base scene is updated, its SceneState gets replaced. At the time _find_updated_instances() is called, the base scene has the new state, so modified time is the same.

The solution I came up with is discarding base scene path. I just go through the whole inheritance chain and replace SceneState's PackedScene with one that isn't cached, so it doesn't get updated too early. This does work, but in a rather chaotic way. The 2-level inherited scene does refresh properly, but only once. Then you have to reload manually as usual, however the reload may fail or may restore some old state (??). idk what to do about it.

Another related, but probably separate bug, is that root node properties don't get updated to new default values. The method for obtaining default value probably uses wrong state or something.

@KoBeWi KoBeWi added this to the 4.x milestone Jun 23, 2025
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
1 participant