Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix `MeshLibrary` editor not properly handling read-only libs

Michael Alexsanderb9c1a90efae7
diff --git a/editor/scene/3d/mesh_library_editor_plugin.cpp b/editor/scene/3d/mesh_library_editor_plugin.cpp
index 853ca24e853..292cd67d70f 100644
--- a/editor/scene/3d/mesh_library_editor_plugin.cpp
+++ b/editor/scene/3d/mesh_library_editor_plugin.cpp
@@ -173,6 +173,12 @@ void MeshLibraryEditor::edit(const Ref<MeshLibrary> &p_mesh_library) {
// Avoid updating multiple times at once.
mesh_library->connect_changed(callable_mp(update_items_delay, &Timer::start).bind(UPDATE_ITEMS_DELAY_TIMEOUT));
_update_mesh_items();
+
+ bool read_only = EditorNode::get_singleton()->is_resource_read_only(mesh_library);
+ add_item->set_disabled(read_only);
+ remove_item->set_disabled(read_only);
+ import_scene->set_disabled(read_only);
+ inspector->set_read_only(read_only);
}
}