godot icon indicating copy to clipboard operation
godot copied to clipboard

Loss of changes on branches with multiple nested scenes (when duplicating or exporting as new scenes)

Open L30n4rd0-4rg3nt1n0 opened this issue 11 months ago • 0 comments

Tested versions

-Reproducible in: Godot v4.3.dev (c9c17d6ca)

System information

Godot v4.3.dev (c9c17d6ca) - Debian GNU/Linux trixie/sid trixie - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (nvidia) - Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz (8 Threads)

Issue description

Duplicating a branch with multiple nested (and edited) scenes results in changes to the second level of nesting being lost. This also happens when the branch is exported as a scene.

Steps to reproduce

To illustrate what I'm saying, I'm sharing a project with several scenes (I also show some photos).

-cube.tscn: A rigid body with BOX mesh. -Platform.tscn: A rigid body with a PLANE mesh. -cube_on_platform.tscn: The cube (cube.tscn) is placed on the platform (Platform.tscn). 00

-scene.tscn: I use an instance of "cube_on_platform.tscn", but I rotate it and change the color of the cube. For that I recursively set the "editable children" option twice. 01

-scene_2.tscn: Same as "scene.tscn" but duplicating the modified branch. In principle, the changes are applied to the duplicate. But if I save, close and reopen, it only survives the rotation but the color edition is lost (which corresponds to the second level of nesting), it back to original setting . 02

-scene_3.tscn: Same as "scene_2.tscn", but after creating the duplicate I apply the "editable children" option again (since I realized that the children are closed although the changes are still visible). If I save, close and reopen, the changes now survive (unlike "scene_2.tscn"). 03

-scene_4.tscn: Like "scene_3.tscn" but I made a second duplicate (with the same procedure). I placed the two duplicates inside a node3d (renamed "cube_on_plantform_X2")... Then I duplicated cube_on_plantform_X2. I was forced to reapply the "editable children" option within that duplicate branch. Only then if I save, close and reopen, I don't lose the changes. 04

-scene_5.tscn: Like "scene_4.tscn" but I exported the duplicate of "cube_on_plantform_X2" as a scene, creating the scene "cube_on_platform_x_2_EXPORTED.tscn". When I do this immediately, that branch is replaced by a node that is an instance of that scene. In that scene the color change is lost (second level of nesting). 05

Of course, if you want you could edit "cube_on_platform_x_2_EXPORTED.tscn" to apply a color change to the cubes. But it is clear that there is a problem when doing the export, that even an already saved change is lost.

Minimal reproduction project (MRP)

bug_nestig.zip

L30n4rd0-4rg3nt1n0 avatar Mar 23 '24 20:03 L30n4rd0-4rg3nt1n0