-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
disapperaring nodes after reparenting #27222
Comments
IMO this is a serious issue as it leads to data loss. In addition to the examples in this issue and #27246, the node deletion occurred for me when I changed the type of an "arbitrary" child node (i.e. it wasn't the old or new root node). Due to the part of the node tree I was looking at, the deletion of the nodes wasn't immediately apparent so it wasn't until some time later that I even noticed that the nodes had been deleted. By which time it wasn't obvious what had caused the issue. It was only later when I went back to re-create my scene that I noticed that it was the "Change Type" step that triggered the deletion. In addition when I hovered over the node (maybe the eye?) Godot crashed:
This crash occurred again when I re-opened the project and hovered the mouse pointer over the node:
(1) Edited to add crash logs (2) Edited to add: Just discovered that if I close & reopen the editor/project before changing the node type the deletion & crash doesn't occur. To me that suggests the underlying issue is related to bad state occurring from the root change. |
The code in question seems to be located here: godot/editor/scene_tree_dock.cpp Lines 560 to 616 in c1fae20
The "blame" history suggests a number of "recent" changes have occurred in this piece of code, including some dealing with similar issues: (1) Edited to add: Including one commit entitled "Fixed setting node as root deleting all non-children of that node." here: 6f96db4 (2) Edited to add: Related: #22921? |
Additional context: I've since experienced the |
Similar problem here. I rerooted a simple Node2D with not much in it, just a Sprite, instantiated it, renamed it... and then the instance got nuked, its interior got replaced by empty Node2Ds, and now the project was erroring, and I was unable to save. This, for anyone who doesn't know that they shouldn't REROOT + RENAME, or whatever other bug is related to rerooting, is a catastrophic Godot bug. It can destroy complex hierarchies of nodes, which in turn can probably wreck an entire project. Pls up the priority as much as possible, and fix this asap. |
#29865 is likely yet another report of the same problem. |
There have been a few unofficial reports in the Godot discord that I think are worth mentioning, too. 1 (link)
2 (link)
|
I'd like to note that I have the same issue. I'm not sure what's causing it but sometimes I'll look and suddenly one of my nodes will be missing. I'm using macOS, Godot v3.1.1 |
Yep, I lost a whole scene too and another guy did report so in Q&A: https://godotengine.org/qa/47401/godot-randomly-deleting-nodes It also happens "randomly", so it's a show stopper bug! |
Ok, so the reproduction steps in the OP work 100% of the time, always. I used this fact trying to pinpoint the issue. I've been printing children count everywhere, trying to find where the data loss happens. Ultimately, the issue comes to these steps:
What happens here:
So the issue is triggered by save and scene tab change. If you save and then reload scene, everything will work correctly. Now, as for the cause... I have no idea what it is XD I only discovered that commenting out this line: Line 1217 in 2f63811
will prevent nodes from disappearing when switching tabs. This is the line that saves the scene resource to the file. Looks like it might modify the node in some way that breaks the scene tree, but this only happens when you switch tab. And just now I discovered that you can do above-mentioned steps in 2->1->3 order and it will break too .-. |
Could one or more people please try to reproduce this with a build of the current master or a nightly build from here: https://hugo.pro/projects/godot-builds/? I briefly/roughly tried to reproduce this issue with a nightly build ( My guess was that it may have been fixed by #31237 but I'm slightly confused because that PR was by @KoBeWi who mentioned being able to reproduce the issue in #27222 (comment). Update: It seems the Mac nightly build I was using hadn't been updated for a while so YMMV. |
No, the issue isn't fixed in the latest master branch. I did my tests there. If it works for you in a nightly build, you probably did reproduction steps incorrectly. |
Thanks for confirming that @KoBeWi. It seems that #27246 was mis-categorised as duplicate of this issue because that "Make Scene Root" + "Change Type" issue seems to now have been fixed (and was what I was reproducing). However, when I used the |
FYI: It seems if one notices the nodes have disappeared it's possible to choose "Revert Scene" and they will be recovered--even though the scene tab doesn't have a " |
Causing a crash during scene updateOkay, so, the discovery of the "Revert Scene" possibility enabled me to cause a crash that looks like (when I changed to use GLES2 rather than GLES3):
I caused this by loading the project with the
(For a quicker crash just do steps 15-20.) More detail via
|
…r scene Hopefully fixes godotengine#24484 and fixes godotengine#27222.
…r scene Hopefully fixes godotengine#24484 and fixes godotengine#27222.
…r scene Hopefully fixes godotengine#24484 and fixes godotengine#27222. (cherry picked from commit cfc779c)
Godot version:
3.1
OS/device including version:
Windows 7 SP1
Issue description:
Editor issue | Persiting node | Reparenting | saving scene | High impact | reproducable
Child nodes dissapears after reparenting Character scene.
Should not delete nodes after reparenting
Steps to reproduce:
1, Open Main and Character scene.
2, Select Character scene. Add child node Position2d to character.
3, Select Position2d - Make scene root.
4, Save Character scene. - Important step
5, Switch to Main scene and switch back to character.
6, Character scene will be empty. Only Position2d node will be available.
Note: I reparented couple of times and saved the scene. Godot crashed :(
Thank you.
Snow31_disappearingNodes.zip
The text was updated successfully, but these errors were encountered: