attempt to fix scene preload hell (#70)

every now and then, opening the project in Godot would throw an error saying that `res://graph_node_renderer/graph_node_renderer.tscn` scene was corrupted and could not be opened. the scene would refuse to open in the editor, throwing the same error. however, the app ran, instantiating the scene like nothing was wrong. the error would sometimes go away after a few restarts.

after many hours of searching up about it, i think i identified the problem. that specific scene file has nothing actually corrupted about it, and deleting and re-adding it solved the problem until some other random next time it popped up. see the relevant issues on godot's github:

https://github.com/godotengine/godot/issues/85907
https://github.com/godotengine/godot/issues/79545
https://github.com/godotengine/godot/issues/70985

for the time being, i've replaced most relevant scene preloads with exports. hopefully it doesn't happen now.

Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/70
Co-authored-by: Lera Elvoé <yagich@poto.cafe>
Co-committed-by: Lera Elvoé <yagich@poto.cafe>
This commit is contained in:
Lera Elvoé 2024-02-21 01:11:26 +00:00 committed by yagich
parent 34220c4ad1
commit 759f6eff73
5 changed files with 16 additions and 8 deletions

View file

@ -8,9 +8,9 @@ class_name DeckHolderRenderer
## ##
## Entry point for the [GraphEdit] based Renderer ## Entry point for the [GraphEdit] based Renderer
## Reference to the base scene for [DeckRessssssndererGraphEdit] ## Reference to the base scene for [DeckRendererGraphEdit]
const DECK_SCENE := preload("res://graph_node_renderer/deck_renderer_graph_edit.tscn") @export var DECK_SCENE: PackedScene
const DEBUG_DECKS_LIST := preload("res://graph_node_renderer/debug_decks_list.tscn") @export var DEBUG_DECKS_LIST: PackedScene
const PERSISTENCE_NAMESPACE := "default" const PERSISTENCE_NAMESPACE := "default"

View file

@ -1,10 +1,12 @@
[gd_scene load_steps=22 format=3 uid="uid://duaah5x0jhkn6"] [gd_scene load_steps=24 format=3 uid="uid://duaah5x0jhkn6"]
[ext_resource type="Script" path="res://graph_node_renderer/deck_holder_renderer.gd" id="1_67g2g"] [ext_resource type="Script" path="res://graph_node_renderer/deck_holder_renderer.gd" id="1_67g2g"]
[ext_resource type="PackedScene" uid="uid://b84f2ngtcm5b8" path="res://graph_node_renderer/tab_container_custom.tscn" id="1_s3ug2"] [ext_resource type="PackedScene" uid="uid://b84f2ngtcm5b8" path="res://graph_node_renderer/tab_container_custom.tscn" id="1_s3ug2"]
[ext_resource type="Theme" uid="uid://dqqdqscid2iem" path="res://graph_node_renderer/default_theme.tres" id="1_tgul2"] [ext_resource type="Theme" uid="uid://dqqdqscid2iem" path="res://graph_node_renderer/default_theme.tres" id="1_tgul2"]
[ext_resource type="PackedScene" uid="uid://b18qpb48df14l" path="res://graph_node_renderer/deck_renderer_graph_edit.tscn" id="3_uf16c"]
[ext_resource type="PackedScene" uid="uid://dayri1ejk20bc" path="res://graph_node_renderer/bottom_dock.tscn" id="4_gwnhy"] [ext_resource type="PackedScene" uid="uid://dayri1ejk20bc" path="res://graph_node_renderer/bottom_dock.tscn" id="4_gwnhy"]
[ext_resource type="Script" path="res://addons/no-obs-ws/NoOBSWS.gd" id="4_nu72u"] [ext_resource type="Script" path="res://addons/no-obs-ws/NoOBSWS.gd" id="4_nu72u"]
[ext_resource type="PackedScene" uid="uid://dm7sc6364j84i" path="res://graph_node_renderer/debug_decks_list.tscn" id="4_ux0jt"]
[ext_resource type="Script" path="res://addons/no_twitch/twitch_connection.gd" id="5_3n36q"] [ext_resource type="Script" path="res://addons/no_twitch/twitch_connection.gd" id="5_3n36q"]
[ext_resource type="PackedScene" uid="uid://eioso6jb42jy" path="res://graph_node_renderer/obs_websocket_setup_dialog.tscn" id="5_uo2gj"] [ext_resource type="PackedScene" uid="uid://eioso6jb42jy" path="res://graph_node_renderer/obs_websocket_setup_dialog.tscn" id="5_uo2gj"]
[ext_resource type="PackedScene" uid="uid://bq2lxmbnic4lc" path="res://graph_node_renderer/twitch_setup_dialog.tscn" id="7_7rhap"] [ext_resource type="PackedScene" uid="uid://bq2lxmbnic4lc" path="res://graph_node_renderer/twitch_setup_dialog.tscn" id="7_7rhap"]
@ -67,6 +69,8 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme = ExtResource("1_tgul2") theme = ExtResource("1_tgul2")
script = ExtResource("1_67g2g") script = ExtResource("1_67g2g")
DECK_SCENE = ExtResource("3_uf16c")
DEBUG_DECKS_LIST = ExtResource("4_ux0jt")
new_deck_shortcut = SubResource("Shortcut_30rq6") new_deck_shortcut = SubResource("Shortcut_30rq6")
open_deck_shortcut = SubResource("Shortcut_m48tj") open_deck_shortcut = SubResource("Shortcut_m48tj")
save_deck_shortcut = SubResource("Shortcut_xr6s4") save_deck_shortcut = SubResource("Shortcut_xr6s4")

View file

@ -3,9 +3,9 @@
[ext_resource type="Script" path="res://graph_node_renderer/deck_node_renderer_graph_node.gd" id="1_pos0w"] [ext_resource type="Script" path="res://graph_node_renderer/deck_node_renderer_graph_node.gd" id="1_pos0w"]
[node name="DeckNodeRendererGraphNode" type="GraphNode"] [node name="DeckNodeRendererGraphNode" type="GraphNode"]
script = ExtResource("1_pos0w")
custom_minimum_size = Vector2(200, 0) custom_minimum_size = Vector2(200, 0)
offset_right = 200.0 offset_right = 200.0
offset_bottom = 55.0 offset_bottom = 55.0
resizable = true resizable = true
title = "Deck Node" title = "Deck Node"
script = ExtResource("1_pos0w")

View file

@ -5,9 +5,9 @@ extends GraphEdit
class_name DeckRendererGraphEdit class_name DeckRendererGraphEdit
## Reference to the [DeckNodeRendererGraphNode] used for later instantiation ## Reference to the [DeckNodeRendererGraphNode] used for later instantiation
const NODE_SCENE := preload("res://graph_node_renderer/deck_node_renderer_graph_node.tscn") @export var NODE_SCENE: PackedScene
## Reference to the [AddNodeMenu] used for later instantiation ## Reference to the [AddNodeMenu] used for later instantiation
const ADD_NODE_MENU_SCENE := preload("res://graph_node_renderer/add_node_menu.tscn") @export var ADD_NODE_MENU_SCENE: PackedScene
## The [PopupPanel] that holds the [AddNodeMenu] scene. ## The [PopupPanel] that holds the [AddNodeMenu] scene.
var search_popup_panel: PopupPanel var search_popup_panel: PopupPanel

View file

@ -1,6 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://b18qpb48df14l"] [gd_scene load_steps=4 format=3 uid="uid://b18qpb48df14l"]
[ext_resource type="Script" path="res://graph_node_renderer/deck_renderer_graph_edit.gd" id="1_pojfs"] [ext_resource type="Script" path="res://graph_node_renderer/deck_renderer_graph_edit.gd" id="1_pojfs"]
[ext_resource type="PackedScene" uid="uid://timc6qnw46h" path="res://graph_node_renderer/deck_node_renderer_graph_node.tscn" id="2_67ymi"]
[ext_resource type="PackedScene" uid="uid://dqp08ahaho0q2" path="res://graph_node_renderer/add_node_menu.tscn" id="3_thbt5"]
[node name="DeckRendererGraphEdit" type="GraphEdit"] [node name="DeckRendererGraphEdit" type="GraphEdit"]
anchors_preset = 15 anchors_preset = 15
@ -11,6 +13,8 @@ grow_vertical = 2
right_disconnects = true right_disconnects = true
show_arrange_button = false show_arrange_button = false
script = ExtResource("1_pojfs") script = ExtResource("1_pojfs")
NODE_SCENE = ExtResource("2_67ymi")
ADD_NODE_MENU_SCENE = ExtResource("3_thbt5")
[connection signal="copy_nodes_request" from="." to="." method="_on_copy_nodes_request"] [connection signal="copy_nodes_request" from="." to="." method="_on_copy_nodes_request"]
[connection signal="delete_nodes_request" from="." to="." method="_on_delete_nodes_request"] [connection signal="delete_nodes_request" from="." to="." method="_on_delete_nodes_request"]