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

Copy/pasting a Scene with exported child Node references points at the copied Scene's children rather than the pasted Scene's children. #83564

Closed
TyrusPeace opened this issue Oct 18, 2023 · 2 comments
Labels

Comments

@TyrusPeace
Copy link

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

@AThousandShips
Copy link
Member

@TyrusPeace 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
@AThousandShips
Copy link
Member

AThousandShips commented Oct 22, 2023

Thank you for reporting, closing as a duplicate of:

If it is not a duplicate please comment

@AThousandShips AThousandShips marked this as a duplicate of #82670 Oct 22, 2023
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

2 participants