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

Make Scene Root deletes other nodes from the scene #24484

Closed
ondrowan opened this issue Dec 19, 2018 · 17 comments · Fixed by #32412
Closed

Make Scene Root deletes other nodes from the scene #24484

ondrowan opened this issue Dec 19, 2018 · 17 comments · Fixed by #32412

Comments

@ondrowan
Copy link

ondrowan commented Dec 19, 2018

Godot version: 3.1 alpha 3

OS/device including version: Windows 10 64-bit

Issue description: Using "Make Scene Root" deletes other nodes from the scene.

Steps to reproduce:

Create any scene with one node. Instantiate it in some other scene. Create other random node in the first scene. Click "Make Scene Root". Everything looks good so far. Save the scene, switch to another scene, switch back to this scene and all other nodes but the root node are gone.

@ondrowan
Copy link
Author

ondrowan commented Dec 20, 2018

I found another similar bug. I had a Level1 scene inherited from generic Level scene. Level1 scene had instances of Player and HUD which I decided to move to Level scene instead. After doing so, Level1 scene showed Player and HUD twice, which was a bit confusing since I had no idea which one should I delete. It turns out that it considered both pairs of these nodes inherited from base Level.

Before:
image

After:
image

Duplicates disappeared after saving and switching to another tab.

I think it's similar visual glitch as I described in original post. And it makes me question if it's visual glitch in that case as well and it should indeed be a destructive operation.

@bojidar-bg bojidar-bg added this to the 3.1 milestone Dec 21, 2018
@bojidar-bg
Copy link
Contributor

@ondrowan Just to confirm: did the original issue (not the second post) happen in an inherited scene or in a normal scene?

@Piet-G
Copy link
Contributor

Piet-G commented Dec 22, 2018

Create any scene with one node. Create other random node. Click "Make Scene Root". Everything looks good so far. Save the scene, switch to another scene, switch back to this scene and all other nodes but the root node are gone.

I can't get this to reproduce, do you have more detailed instructions?

@ondrowan
Copy link
Author

@bojidar-bg I tried it with normal scene.

@dualmatrix I just tried it on MacOS with both alpha 3 and alpha 4, and cannot reproduce it now as well. Unfortunatelly, I don't have access to a Windows computer (where I was able to reproduce it on several occasions) for another 2 weeks or so.

@ondrowan
Copy link
Author

@dualmatrix I replicated it in alpha 4 in the end, but didn't realize there's one more thing to be done. Given scene has to be instantiated in some other scene. I've updated original post.

@vinterskog
Copy link

Ran into this bug today and lost some work. Should be high priority imho, this is scary...

@Piet-G
Copy link
Contributor

Piet-G commented Jan 15, 2019

Given scene has to be instantiated in some other scene.

Hmm that seems weird, wonder why that happens, I can't really come up with a reason why that would change the bevaviour, will take a look.

@Piet-G
Copy link
Contributor

Piet-G commented Jan 17, 2019

So I tested a bunch and I'm totally stuck as to what causes this, usually when a node dissapears from the tree it's because the owner wasn't set properly but I checked and that seemed to work fine in this case.
It almost must have to do with it being an instance, since it only happens when you open a scene that instances it afterwards.

Does anyone know of a property related to instancing that might not be transferred properly from the old to the new parent?

@reduz
Copy link
Member

reduz commented Jan 17, 2019

I added special checks so you can't use on instantiated scenes, should avoid trouble in the future. Let me know if you can still get it to break (I can't).

@ondrowan
Copy link
Author

@reduz I've just tried nightly build and the bug I've described in OP doesn't seem to be fixed. Nodes are still lost when changing parent of scene that's instantiated in other scene.

@reduz
Copy link
Member

reduz commented Jan 22, 2019

There, now it forbids you to do it on inherited scenes too.

@ondrowan
Copy link
Author

@reduz Sorry for late confirmation. The original scenario I've described is still happening though.

@bojidar-bg
Copy link
Contributor

Reopening then.

@bojidar-bg bojidar-bg reopened this Mar 16, 2019
@Toiya
Copy link

Toiya commented Mar 18, 2019

Just ran into this myself with Godot 3.1 stable and Ubuntu 18.04, and was not able to undo with CTRL + Z. I'm very much a beginner with both Godot and open source contributing, but if there's anything I can help out with, let me know!

@perroboc
Copy link

Just tested this on 3.1 windows 10 and the bug is still there. Here's a gif to show the problem:

godot_node_problem

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Apr 3, 2019
@sriedi7
Copy link

sriedi7 commented Jun 3, 2019

I also discovered this issue myself, days ago.

But notice after you save the instanced scene, you switch to another scene (that have that scene instanced), back to instance scene, the nodes will be deleted. BUT, do not save the scene now, instead revert it or reopen it. The nodes will be back.

@aabmets
Copy link

aabmets commented Jul 31, 2019

I'm having the same issue on 3.1.1 stable. This is hampering my work progress greatly. Please fix ASAP

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