Merge pull request #38967 from nekomatata/remote-inspector-builtin-res

Fix dialog spam when inspecting MeshInstance from model file
This commit is contained in:
Rémi Verschelde 2020-06-06 16:11:11 +02:00 committed by GitHub
commit 17af010478
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -153,12 +153,9 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
if (path.find("::") != -1) { if (path.find("::") != -1) {
// built-in resource // built-in resource
String base_path = path.get_slice("::", 0); String base_path = path.get_slice("::", 0);
if (ResourceLoader::get_resource_type(base_path) == "PackedScene") { RES dependency = ResourceLoader::load(base_path);
if (!EditorNode::get_singleton()->is_scene_open(base_path)) { if (dependency.is_valid()) {
EditorNode::get_singleton()->load_scene(base_path); remote_dependencies.insert(dependency);
}
} else {
EditorNode::get_singleton()->load_resource(base_path);
} }
} }
var = ResourceLoader::load(path); var = ResourceLoader::load(path);
@ -211,6 +208,7 @@ void EditorDebuggerInspector::clear_cache() {
memdelete(E->value()); memdelete(E->value());
} }
remote_objects.clear(); remote_objects.clear();
remote_dependencies.clear();
} }
Object *EditorDebuggerInspector::get_object(ObjectID p_id) { Object *EditorDebuggerInspector::get_object(ObjectID p_id) {

View file

@ -69,6 +69,7 @@ class EditorDebuggerInspector : public EditorInspector {
private: private:
ObjectID inspected_object_id; ObjectID inspected_object_id;
Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects; Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects;
Set<RES> remote_dependencies;
EditorDebuggerRemoteObject *variables; EditorDebuggerRemoteObject *variables;
void _object_selected(ObjectID p_object); void _object_selected(ObjectID p_object);