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 renaming a scene in specific conditions regarding inheritance, the scene is wrongly marked as corrupt or Godot just crashes.
The setup for the bug to happen involves having 3 scenes, one being within the other (forming a 1->2->3 order), having all 3 scenes opened in the editor, and then renaming the 3rd scene while scene 1 is open, causing the 2nd become corrupt or Godot to crash. This also occurs if the name of the folder where the 3rd scene is contained is changed, instead of the scene itself. I presume the path of the 3rd scene changing at all while the 1st scene is opened results in the bug.
Given that having multiple scenes with dependencies with each other seems to cause this bug, it is probable that his bug occurs beyond the aforementioned 3-scene setup, but it is a scenario where the bug can be consistently reproduced. It could be that the bug described in issue #80324 is related if not the same as the one described here.
Steps to reproduce
Empty Project:
Create an empty Godot project.
Create 3 scenes, each just being a Node. The contents of the scenes seem irrelevant beyond the dependencies explained in the following steps.
Make the 2nd scene a child of the 1st, and the 3rd a child of the 2nd.
Have all three of them opened, but have the 1st scene as the active one in the viewport.
Rename the 3rd scene in the File System.
Minimal Reproduction Project:
Open all 3 scenes in the project, but have the 1st scene as the active one in the viewport.
Rename the 3rd scene in the File System OR the folder containing it. Either works.
The 2nd scene should now be marked as corrupt, and the user will be unable to open it until Godot has been restarted. Alternatively, Godot will have crashed.
Console error displays nc == 0(nodes.size()) when instantiating the scene.
ERROR: Cannot open file 'res://3.tscn'.
at: (scene\resources\resource_format_text.cpp:1638)
ERROR: Failed loading resource: res://3.tscn. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:274)
ERROR: Method/function failed. Returning: err
at: SceneState::pack (scene\resources\packed_scene.cpp:1033)
ERROR: Condition "nc == 0" is true. Returning: nullptr
at: SceneState::instantiate (scene\resources\packed_scene.cpp:92)
The call stack displays the sdata returned when using ResourceLoader.load to load scene'2.tscn', the
The nodes size of the sdata.state is zero.
I can replicate it in 4.0.alpha1, restart the editor, or close Scene 1,Scene 3 which has been renamed, then Scene 2 can be reopened.
PS:If you right-click to rename a scene, it may sometimes crash due to another bug, but renaming with the shortcut F2 is not a problem.
Godot version
v4.1.stable.official [9704596]
System information
Godot v4.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (Advanced Micro Devices, Inc.; 31.0.21001.45002) - AMD Ryzen 7 7700X 8-Core Processor (16 Threads)
Issue description
When renaming a scene in specific conditions regarding inheritance, the scene is wrongly marked as corrupt or Godot just crashes.
The setup for the bug to happen involves having 3 scenes, one being within the other (forming a 1->2->3 order), having all 3 scenes opened in the editor, and then renaming the 3rd scene while scene 1 is open, causing the 2nd become corrupt or Godot to crash. This also occurs if the name of the folder where the 3rd scene is contained is changed, instead of the scene itself. I presume the path of the 3rd scene changing at all while the 1st scene is opened results in the bug.
Given that having multiple scenes with dependencies with each other seems to cause this bug, it is probable that his bug occurs beyond the aforementioned 3-scene setup, but it is a scenario where the bug can be consistently reproduced. It could be that the bug described in issue #80324 is related if not the same as the one described here.
Steps to reproduce
Empty Project:
Minimal Reproduction Project:
The 2nd scene should now be marked as corrupt, and the user will be unable to open it until Godot has been restarted. Alternatively, Godot will have crashed.
Minimal reproduction project
Rename_Scene_Bug.zip
The text was updated successfully, but these errors were encountered: