diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:01:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-14 17:01:52 +0300 |
commit | c7942c31b2a90b16c3029120f95ae1ebf0d8a2d8 (patch) | |
tree | c4bd2b6f1a79faa94e0bdd834f90e852269ee7e8 /source/blender | |
parent | ca9d65cc97ba8e872a0ef456e51dacadd06e237e (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')
-rw-r--r-- | source/blender/editors/geometry/geometry_attributes.cc | 4 |
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; |