summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-12 11:57:07 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-12 11:57:07 +0200
commit2c5f259cf5ac0849e321cdafb17f1904c5c059f3 (patch)
tree4447f086be3f5c7fc99bd45a6fb5abe87ed9593f
parent8f575d2991cef755b226a5263e5f044bd285c928 (diff)
parent0a4d0506d1761d2a6a9deaed54147c8e848f6db9 (diff)
downloadredot-engine-2c5f259cf5ac0849e321cdafb17f1904c5c059f3.tar.gz
Merge pull request #78124 from KoBeWi/leave_MeshLibrary_alone
Fix problems reloading MeshLibrary
-rw-r--r--editor/editor_node.cpp3
-rw-r--r--editor/plugins/mesh_library_editor_plugin.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index cd74a13cb9..2ec05b0412 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 7bee4d01ee..4cc96126de 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<MeshLibrary>(p_node));
mesh_library_editor->show();
} else {
+ mesh_library_editor->edit(Ref<MeshLibrary>());
mesh_library_editor->hide();
}
}