Skip to content

Scene is invalid/corrupt according to the Godot editor, but works normally ingame #79545

@MewPurPur

Description

@MewPurPur

Godot version

4.1

System information

Ubuntu 22.04.2 LTS 22.04 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 4400 (HSW GT2) () - Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz (4 Threads)

Issue description

This is the tscn file:

[gd_scene load_steps=2 format=3 uid="uid://bgrpmpmsi1ae2"]

[ext_resource type="Script" path="res://src/UI/LevelEditor/UserLevelsMenu.gd" id="1_0uvtn"]

[node name="UserLevels" type="Control" node_paths=PackedStringArray("initial_focus")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_0uvtn")
initial_focus = NodePath("MainContainer/Create")

[node name="MainContainer" type="VBoxContainer" parent="."]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -40.0
offset_top = -20.0
offset_right = 40.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2

[node name="Create" type="Button" parent="MainContainer"]
unique_name_in_owner = true
layout_mode = 2
button_mask = 0
text = "#create_new"

[node name="LevelContainer" type="VBoxContainer" parent="MainContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 9

[connection signal="pressed" from="MainContainer/Create" to="." method="_on_Create_pressed"]

It results in this:
image

And the following error: "scene/resources/packed_scene.cpp:92 - Condition "nc == 0" is true. Returning: nullptr"

It also creates adds an empty scene in the scenes tabbar, and when I click on it, it automatically closes, throwing the following two errors:

  • editor/editor_data.cpp:683 - Index p_idx = 2 is out of bounds (edited_scene.size() = 2).
  • editor/editor_data.cpp:745 - Index p_idx = 2 is out of bounds (edited_scene.size() = 2).

Steps to reproduce

Unknown, only happened to one of my scenes :(

However, I can give some details surrounding the scene. I made it at some point during 4.0's alphas. I probably never touched it since. In my git, it says it's been unchanged for 5 months. However, I opened it yesterday. Not doing any changes to it, just opening it. It has a simple script, which opens normally.

Minimal reproduction project

Couldn't, this happened on my major project (far too big to post)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions