Fix T103453: Don't allow call Attribute Convert operator in edit mode

Don't allow calling Attribute Convert operator in edit mode.
Right now BMesh does not support attribute operations.

Differential Revision: https://developer.blender.org/D16864
This commit is contained in:
Iliya Katueshenock
2022-12-26 14:49:20 -05:00
committed by Hans Goudey
parent 5206d72dca
commit 997eb77fd4

View File

@@ -599,15 +599,22 @@ static bool geometry_color_attribute_convert_poll(bContext *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 *id = static_cast<ID *>(ob->data);
if (GS(id->name) != ID_ME) {
return false;
}
CustomDataLayer *layer = BKE_id_attributes_active_color_get(id);
if (layer == nullptr) {
return false;
}
return true;
}