From f55adabb3e5d3a75ecdb30f90487e314f0afb753 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Apr 2018 20:13:31 +0200 Subject: Cleanup: remove unused flag --- source/blender/editors/animation/anim_channels_edit.c | 2 +- source/blender/editors/include/ED_object.h | 11 ++++++----- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/space_outliner/outliner_select.c | 4 ++-- source/blender/editors/space_outliner/outliner_tools.c | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) (limited to 'source') diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index e9ab949dc95..8b922082fe8 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2721,7 +2721,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, /* ensure we exit editmode on whatever object was active before to avoid getting stuck there - T48747 */ if (ob != sce->obedit) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); notifierFlags |= (ND_ANIMCHAN | NA_SELECTED); } diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 7faf975ea91..11dde2f5913 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -112,11 +112,12 @@ struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, st void ED_object_parent(struct Object *ob, struct Object *parent, const int type, const char *substr); /* bitflags for enter/exit editmode */ -#define EM_FREEDATA 1 -#define EM_FREEUNDO 2 -#define EM_WAITCURSOR 4 -#define EM_DO_UNDO 8 -#define EM_IGNORE_LAYER 16 +enum { + EM_FREEDATA = (1 << 0), + EM_WAITCURSOR = (1 << 1), + EM_DO_UNDO = (1 << 2), + EM_IGNORE_LAYER = (1 << 3), +}; void ED_object_editmode_exit_ex(struct bContext *C, struct Scene *scene, struct Object *obedit, int flag); void ED_object_editmode_exit(struct bContext *C, int flag); void ED_object_editmode_enter(struct bContext *C, int flag); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 6715879361a..c6820c83f95 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -413,7 +413,7 @@ Object *ED_object_add_type( /* for as long scene has editmode... */ if (CTX_data_edit_object(C)) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); /* freedata, and undo */ + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); /* freedata, and undo */ /* deselects all, sets scene->basact */ ob = BKE_object_add(bmain, scene, type, name); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c83e25fa9c2..803b183fea1 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -658,7 +658,7 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op) if (!is_mode_set) ED_object_editmode_enter(C, EM_WAITCURSOR); else - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR); /* had EM_DO_UNDO but op flag calls undo too [#24685] */ + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR); /* had EM_DO_UNDO but op flag calls undo too [#24685] */ ED_space_image_uv_sculpt_update(CTX_wm_manager(C), scene); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 7166e870f6e..305afc206c4 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -241,7 +241,7 @@ static eOLDrawState tree_element_set_active_object( } if (ob != scene->obedit) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); return OL_DRAWSEL_NORMAL; } @@ -715,7 +715,7 @@ static eOLDrawState tree_element_active_pose( if (set != OL_SETSEL_NONE) { if (scene->obedit) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); if (ob->mode & OB_MODE_POSE) ED_armature_exit_posemode(C, base); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 84711bf7c3c..e8275d597a6 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -418,7 +418,7 @@ static void object_delete_cb( // check also library later if (scene->obedit == base->object) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); ED_base_object_free_and_unlink(CTX_data_main(C), scene, base); /* leave for ED_outliner_id_unref to handle */ @@ -873,7 +873,7 @@ static void object_delete_hierarchy_cb( /* Check also library later. */ for (; obedit && (obedit != base->object); obedit = obedit->parent); if (obedit == base->object) { - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + ED_object_editmode_exit(C, EM_FREEDATA | EM_WAITCURSOR | EM_DO_UNDO); } outline_delete_hierarchy(C, reports, scene, base); -- cgit v1.2.3