From c63c902c74804b6f54684a52b482bc989ae54bd3 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Fri, 22 May 2020 21:50:16 +0200 Subject: [PATCH] Fix dialog spam when inspecting MeshInstance from model file Avoid load_scene for built-in resources to make sure we don't open a scene tab and prompt for model file editing. Load scene as regular resource instead and store the reference to keep the dependency until the remote inspector cache is cleared. (cherry picked from commit 01802074a01c41d8672664751f80b80069796f12) --- editor/script_editor_debugger.cpp | 10 ++++------ editor/script_editor_debugger.h | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 5995777558b..5ac7f05cef9 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -646,12 +646,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da if (path.find("::") != -1) { // built-in resource String base_path = path.get_slice("::", 0); - if (ResourceLoader::get_resource_type(base_path) == "PackedScene") { - if (!EditorNode::get_singleton()->is_scene_open(base_path)) { - EditorNode::get_singleton()->load_scene(base_path); - } - } else { - EditorNode::get_singleton()->load_resource(base_path); + RES dependency = ResourceLoader::load(base_path); + if (dependency.is_valid()) { + remote_dependencies.insert(dependency); } } var = ResourceLoader::load(path); @@ -2144,6 +2141,7 @@ void ScriptEditorDebugger::_clear_remote_objects() { memdelete(E->value()); } remote_objects.clear(); + remote_dependencies.clear(); } void ScriptEditorDebugger::_clear_errors_list() { diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h index 2de1db6919c..402e94892b8 100644 --- a/editor/script_editor_debugger.h +++ b/editor/script_editor_debugger.h @@ -100,6 +100,7 @@ private: ObjectID inspected_object_id; ScriptEditorDebuggerVariables *variables; Map remote_objects; + Set remote_dependencies; Set unfold_cache; VBoxContainer *errors_tab;