You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a duplicating a node (via Node.duplicate()) that is the root of a sub-scene, control nodes that create internal child nodes will have multiple child nodes in the duplicated version.
The expected result is to produce a node tree with only one set of internal nodes for those controls:
SpinBox
┠╴@LineEdit@21
┖╴@Timer@22
However, the duplicated scene has extra internal nodes:
In the case of spinbox, the extra lineedit is drawn on top of the original. The extra lineedit does not properly cause the value of the spinbox to change, and the up/down buttons only affect the original lineedit. The bug affects other control nodes too (like OptionButton), but I have only seen functionality impacted with SpinBox. It can be prevented by setting the node's scene_file_path to an empty string before duplicating.
Steps to reproduce
create a new scene
create a sub-scene by dragging a .tscn file into the node tree in the editor
make a script duplicate that subscene with Node.duplicate()
add the duplicate to the scene
Alternatively, the sub-scene can be created at runtime from a packed scene and then duplicated.
Godot version
4.1.3.stable and v4.2.beta.custom_build [d443f12]
System information
Godot v4.1.3.stable unknown - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 00:52:20 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)
Issue description
When a duplicating a node (via
Node.duplicate()
) that is the root of a sub-scene, control nodes that create internal child nodes will have multiple child nodes in the duplicated version.The expected result is to produce a node tree with only one set of internal nodes for those controls:
However, the duplicated scene has extra internal nodes:
In the case of spinbox, the extra lineedit is drawn on top of the original. The extra lineedit does not properly cause the value of the spinbox to change, and the up/down buttons only affect the original lineedit. The bug affects other control nodes too (like OptionButton), but I have only seen functionality impacted with SpinBox. It can be prevented by setting the node's scene_file_path to an empty string before duplicating.
Steps to reproduce
Alternatively, the sub-scene can be created at runtime from a packed scene and then duplicated.
Minimal reproduction project
ControlDuplicateIssue.zip
The first column of controls uses a sub-scene created in the editor, and exhibits the bug in the second row.
The second column uses a local version of the sub-scene (made via right click -> make local in the editor) and does not exhibit the bug.
The third column creates and adds a sub-scene from a script, and exhibits the bug in the second row.
The fourth column is like the third, but circumvents the bug by first setting the node's scene_file_path to an empty string before duplicating.
The text was updated successfully, but these errors were encountered: