From 0a4d0506d1761d2a6a9deaed54147c8e848f6db9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 11 Jun 2023 18:52:49 +0200 Subject: [PATCH] Fix problems reloading MeshLibrary --- editor/editor_node.cpp | 3 +++ editor/plugins/mesh_library_editor_plugin.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index cd74a13cb97..2ec05b04125 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2027,6 +2027,9 @@ void EditorNode::_dialog_action(String p_file) { if (err) { show_accept(TTR("Error saving MeshLibrary!"), TTR("OK")); return; + } else if (ResourceCache::has(p_file)) { + // Make sure MeshLibrary is updated in the editor. + ResourceLoader::load(p_file)->reload_from_file(); } } break; diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 7bee4d01eef..4cc96126deb 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -301,6 +301,7 @@ void MeshLibraryEditorPlugin::edit(Object *p_node) { mesh_library_editor->edit(Object::cast_to(p_node)); mesh_library_editor->show(); } else { + mesh_library_editor->edit(Ref()); mesh_library_editor->hide(); } }