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

Sub-inherited scene is not updated properly in the editor #7984

Open
Tracked by #4778
RandomShaper opened this issue Mar 8, 2017 · 9 comments · May be fixed by #73717
Open
Tracked by #4778

Sub-inherited scene is not updated properly in the editor #7984

RandomShaper opened this issue Mar 8, 2017 · 9 comments · May be fixed by #73717

Comments

@RandomShaper
Copy link
Member

RandomShaper commented Mar 8, 2017

Operating system or device - Godot version:
Godot 2.1 and 3.0 probably too, after applying #7978 or #7979, respectively (without them the issues are much more serious)

Issue description:
If a scene indirectly inherits another, it doesn't get properly updated in the editor. The editor won't trigger the reload of the most derived scene, but will apply partially the changes made to the base scene.

Steps to reproduce:

  1. Create a scene hierarchy (inheritance) like this: C inherits B which inherits A.
  2. Open A and C in the editor.
  3. Add some node to A.
  4. Switch to C. Notice it isn't reloaded.
  5. Reload manually with Revert Scene.
  6. Switch back to A.
  7. Remove the node you created.
  8. Switch again to C. Notice how the node you created now appears as owned.
    9.a. If you reload C again, everything will be in place (with the phantom node gone).
    9.b. If instead you save C, the node will be commited to the scene as if it had been created there initially.

Link to minimal example project:
Maybe one day.

@RandomShaper RandomShaper changed the title Sub-inheritance scene update Sub-inheried scene does not update properly in the editor Mar 8, 2017
@RandomShaper RandomShaper changed the title Sub-inheried scene does not update properly in the editor Sub-inheried scene is not updated properly in the editor Mar 8, 2017
@RandomShaper RandomShaper changed the title Sub-inheried scene is not updated properly in the editor Sub-inherited scene is not updated properly in the editor Mar 9, 2017
@kubecz3k
Copy link
Contributor

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

@Piet-G
Copy link
Contributor

Piet-G commented Sep 16, 2018

Could not reproduce in master

@Chaosus
Copy link
Member

Chaosus commented Sep 16, 2018

And in 2.1.5 ?

@Piet-G
Copy link
Contributor

Piet-G commented Sep 16, 2018

Could not reproduce in 2.1.5 as well.

@Chaosus
Copy link
Member

Chaosus commented Sep 16, 2018

Thanks !

@KoBeWi
Copy link
Member

KoBeWi commented Apr 12, 2021

I tried the steps from the OP and seems like it's still happening in cee5414 and 3.3 rc8

@foxydevloper
Copy link
Contributor

foxydevloper commented Jul 23, 2021

I was looking into this issue and determined that the problem seems to be rooted in
EditorData::_find_updated_instances and
SceneState::_parse_node.

When you change scene tabs, it uses EditorData::_find_updated_instances to:

  1. Check to see if the inherited scene of the selected scene was updated by comparing last_modified time.
  2. Check children of the selected scene to see if any of the instances were updated by recursively calling EditorData::_find_updated_instances

If so, it triggers a reload of the scene. When the scene is reloaded, it runs SceneState::_parse_node, this function seems to:

  1. Find if the inherited scene of the scene had any changes. If it finds any, it replicates them to the scene if there wasn't an override.
  2. Recursively calls SceneState::_parse_node on all children of the scene so that they're updated if their inherited scene changes.

The issue is that step 1. for both these functions only check one level of inheritance. It seems like they should instead recursively check if the scene a scene inherited from also had an inherited scene that changed, and if so replicate the properties from the change.

Also, this issue, #41492, and #10156 all seem to be due to this same problem.

@Gegbee
Copy link

Gegbee commented Jan 20, 2023

Just wanted to confirm that this is still prevalent in Godot 4.0 beta 8 as of 1/19/2023. If I have time in the coming weeks I am going to try to look into it.

@Gegbee
Copy link

Gegbee commented Jan 20, 2023

Sorry for another notification, but if anybody is searching for a temporary solution, you can just make the children of the grandchild-inherited scene their own saved scene files. It still is not optimal but can help significantly speed up the workflow while the bug is not fixed.

@sodaJar sodaJar linked a pull request Feb 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants