Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-06-08 11:38:08 +0300
committerHans Goudey <h.goudey@me.com>2022-06-08 11:48:19 +0300
commit1af652d42eb917e257d0f4f2773258f4f6ad2a45 (patch)
tree1a484db8732bb221c6b6f2707f6cbaabb25c5e43 /source/blender/editors/geometry/geometry_attributes.cc
parent83fd3767d353213b5b20bf9d386f603dbda249f0 (diff)
Fix: Improve poll for convert attribute operator
Converting an attribute does not work from edit mode because there is no attribute API implemented for BMesh, so disable the operation in that mode and add a poll message.
Diffstat (limited to 'source/blender/editors/geometry/geometry_attributes.cc')
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc
index ed5787c8277..ae588e49565 100644
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -261,8 +261,11 @@ static bool geometry_attribute_convert_poll(bContext *C)
if (GS(data->name) != ID_ME) {
return false;
}
- CustomDataLayer *layer = BKE_id_attributes_active_get(data);
- if (layer == nullptr) {
+ if (CTX_data_edit_object(C) != nullptr) {
+ CTX_wm_operator_poll_msg_set(C, "Operation is not allowed in edit mode");
+ return false;
+ }
+ if (BKE_id_attributes_active_get(data) == nullptr) {
return false;
}
return true;