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
Copy/pasting a Scene with exported Node references to its own children results in a pasted Scene that has exported Node references pointing at the copied Scene's children.
I expect this to instead result in all Node references that were children of the copied Node to point at the children of the pasted Node.
Steps to reproduce
I had this issue in C# and was able to reproduce in a minimal GDScript project as well (attached). It may be difficult to notice the reference is off without explicitly editing the exported nodes. I set the material of an Exported MeshInstance3D and it became apparent that instances I'd copy/pasted did not have the MeshInstance3D references I'd expected them to.
these references have this issue on copy/paste:
[Export] private MeshInstance3D _meshInstance = null;
or @export var _meshInstance : MeshInstance3D;
In the attached project I've included a test_scene.tscn file with various copies of colored_cube.tscn, a simple scene that assigns a red material to a mesh instance in _ready(). The "Dragged In" nodes were dragged in from the project file hierarchy, while the "Copy Pasted" nodes were copy and pasted within the scene editor. When you run the project you can see that this results in only the "Dragged In" cubes editing the correct mesh instance.
If you open test_scene.tscn in a text editor, you can also see that the "Copy Pasted" scene nodes have edited _meshInstance values. In editor this is quite difficult to notice because you can only see this by hovering over the node's field and there are no other markings indicating this value has been edited.
TyrusPeace
changed the title
Copy/pasting a Scene with exported Node references within another Scene makes those Node references absolute, pointing at the copied Scene's children rather than the pasted Scene's children.
Copy/pasting a Scene with exported child Node references points at the copied Scene's children rather than the pasted Scene's children.
Oct 18, 2023
Godot version
v4.1.2.stable.mono.official [399c9dc]
System information
Godot v4.1.2.stable.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA; 31.0.15.2756) - AMD Ryzen 9 5900HS with Radeon Graphics (16 Threads)
Issue description
Copy/pasting a Scene with exported Node references to its own children results in a pasted Scene that has exported Node references pointing at the copied Scene's children.
I expect this to instead result in all Node references that were children of the copied Node to point at the children of the pasted Node.
Steps to reproduce
I had this issue in C# and was able to reproduce in a minimal GDScript project as well (attached). It may be difficult to notice the reference is off without explicitly editing the exported nodes. I set the material of an Exported MeshInstance3D and it became apparent that instances I'd copy/pasted did not have the MeshInstance3D references I'd expected them to.
these references have this issue on copy/paste:
[Export] private MeshInstance3D _meshInstance = null;
or
@export var _meshInstance : MeshInstance3D;
In the attached project I've included a test_scene.tscn file with various copies of colored_cube.tscn, a simple scene that assigns a red material to a mesh instance in _ready(). The "Dragged In" nodes were dragged in from the project file hierarchy, while the "Copy Pasted" nodes were copy and pasted within the scene editor. When you run the project you can see that this results in only the "Dragged In" cubes editing the correct mesh instance.
If you open test_scene.tscn in a text editor, you can also see that the "Copy Pasted" scene nodes have edited _meshInstance values. In editor this is quite difficult to notice because you can only see this by hovering over the node's field and there are no other markings indicating this value has been edited.
Minimal reproduction project
godot-NodeCopyReport.zip
The text was updated successfully, but these errors were encountered: