summaryrefslogtreecommitdiffstats
path: root/editor/debugger/editor_debugger_inspector.cpp
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2020-05-22 21:50:16 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2020-05-22 21:50:16 +0200
commit01802074a01c41d8672664751f80b80069796f12 (patch)
treec059108dcc4d1a80b58707a15404659798a04fca /editor/debugger/editor_debugger_inspector.cpp
parent07ada02cb44af22905991b558af6a4a531de44a7 (diff)
downloadredot-engine-01802074a01c41d8672664751f80b80069796f12.tar.gz
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.
Diffstat (limited to 'editor/debugger/editor_debugger_inspector.cpp')
-rw-r--r--editor/debugger/editor_debugger_inspector.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp
index 125439d09b..dcd7220ed0 100644
--- a/editor/debugger/editor_debugger_inspector.cpp
+++ b/editor/debugger/editor_debugger_inspector.cpp
@@ -153,12 +153,9 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
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);
@@ -211,6 +208,7 @@ void EditorDebuggerInspector::clear_cache() {
memdelete(E->value());
}
remote_objects.clear();
+ remote_dependencies.clear();
}
Object *EditorDebuggerInspector::get_object(ObjectID p_id) {