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-14 17:01:52 +0300
committerHans Goudey <h.goudey@me.com>2022-06-14 17:01:52 +0300
commitc7942c31b2a90b16c3029120f95ae1ebf0d8a2d8 (patch)
treec4bd2b6f1a79faa94e0bdd834f90e852269ee7e8 /source/blender/editors/geometry/geometry_attributes.cc
parentca9d65cc97ba8e872a0ef456e51dacadd06e237e (diff)
Fix: Don't allow duplicate color attribute operator in edit mode
The internal function relies on `CustomData_copy_data_layer` currently, which doesn't work for BMesh. Support could be added as a special case for BMesh, but in the meantime avoid bugs by just changing the poll.
Diffstat (limited to 'source/blender/editors/geometry/geometry_attributes.cc')
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc
index 37ec7a61bcb..1a3bf6a2958 100644
--- a/source/blender/editors/geometry/geometry_attributes.cc
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -539,6 +539,10 @@ static bool geometry_color_attributes_duplicate_poll(bContext *C)
if (!geometry_attributes_poll(C)) {
return false;
}
+ if (CTX_data_edit_object(C) != nullptr) {
+ CTX_wm_operator_poll_msg_set(C, "Operation is not allowed in edit mode");
+ return false;
+ }
Object *ob = ED_object_context(C);
ID *data = ob ? static_cast<ID *>(ob->data) : nullptr;