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:
authorCampbell Barton <ideasman42@gmail.com>2021-05-07 04:16:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-05-07 04:23:09 +0300
commit5a3307230e07018407c6e8157fb04fe81a8d711e (patch)
tree83c7d62266c24df3e85e6279dd58ecd7e50543de /source/blender/editors/object/object_edit.c
parentff1b35af39ec05e248377480e911cf3f6a9e0149 (diff)
Cleanup: de-duplicate checks in object-mode item callback
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r--source/blender/editors/object/object_edit.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index d3b4b91881c..5be572baec5 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1592,25 +1592,8 @@ static const EnumPropertyItem *object_mode_set_itemsf(bContext *C,
const Object *ob = CTX_data_active_object(C);
if (ob) {
- const bool use_mode_particle_edit = ED_object_particle_edit_mode_supported(ob);
while (input->identifier) {
- if ((input->value == OB_MODE_EDIT && OB_TYPE_SUPPORT_EDITMODE(ob->type)) ||
- (input->value == OB_MODE_POSE && (ob->type == OB_ARMATURE)) ||
- (input->value == OB_MODE_PARTICLE_EDIT && use_mode_particle_edit) ||
- (ELEM(input->value,
- OB_MODE_SCULPT,
- OB_MODE_VERTEX_PAINT,
- OB_MODE_WEIGHT_PAINT,
- OB_MODE_TEXTURE_PAINT) &&
- (ob->type == OB_MESH)) ||
- (ELEM(input->value,
- OB_MODE_EDIT_GPENCIL,
- OB_MODE_PAINT_GPENCIL,
- OB_MODE_SCULPT_GPENCIL,
- OB_MODE_WEIGHT_GPENCIL,
- OB_MODE_VERTEX_GPENCIL) &&
- (ob->type == OB_GPENCIL)) ||
- (input->value == OB_MODE_OBJECT)) {
+ if (ED_object_mode_compat_test(ob, input->value)) {
RNA_enum_item_add(&item, &totitem, input);
}
input++;