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

Child node is duplicated incorrectly when instancing and adding a scene(which inherit another scene) to the scene tree through editor plugin #54545

Closed
univeous opened this issue Nov 3, 2021 · 1 comment
Labels

Comments

@univeous
Copy link
Contributor

univeous commented Nov 3, 2021

Godot version

3.3.4.stable

System information

Windows 11 21H2

Issue description

I know the title is a little unclear and awkward, but I will try to explain.
Let's say there is a scene A:
image
and scene B inherits A and has its own children:
image
If we instance and add a B scene to scene tree through editor plugin:

tool
extends EditorPluginvar node = load("res://Node2D_inherit.tscn").instance()
	#assume one node is selected.
	get_editor_interface().get_selection().get_selected_nodes()[0].add_child(node)
	node.set_owner(get_editor_interface().get_edited_scene_root())
…

If I right-click the newly added node and check "Editable Children", then save the scene and open it again, strange things will happen:
image
Some children of scene B are duplicated.
This seems only to happen with a scene that inherits another scene. If change the code to make it instance and add scene A, everything seems fine.

Steps to reproduce

Open the Minimal reproduction project, select the root node, click the "Add Scene" button in the canvas editor menu:
image
Right-click the newly added node and check "Editable Children", then save the scene, close it and open it again.

Minimal reproduction project

EditableChildren.zip

@kleonc
Copy link
Member

kleonc commented Nov 3, 2021

Duplicate of #49660, it's fixed since 3.4.beta5 (389e67a).

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

No branches or pull requests

3 participants