Commit: c7942c31b2a90b16c3029120f95ae1ebf0d8a2d8
Author: Hans Goudey
Date:   Tue Jun 14 16:01:52 2022 +0200
Branches: master
https://developer.blender.org/rBc7942c31b2a90b16c3029120f95ae1ebf0d8a2d8

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.

===================================================================

M       source/blender/editors/geometry/geometry_attributes.cc

===================================================================

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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to