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:
Diffstat (limited to 'source/blender/editors/util/undo.c')
-rw-r--r--source/blender/editors/util/undo.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index a43d549cba1..cd88614f8fe 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -155,7 +155,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
ED_text_undo_step(C, step);
}
else if (obedit) {
- if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) {
+ if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) {
if (undoname)
undo_editmode_name(C, undoname);
else
@@ -247,7 +247,7 @@ int ED_undo_valid(const bContext *C, const char *undoname)
return 1;
}
else if (obedit) {
- if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)) {
+ if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) {
return undo_editmode_valid(undoname);
}
}
@@ -413,9 +413,11 @@ void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int UNUSED(arg_ev
/* ************************** */
-#define UNDOSYSTEM_GLOBAL 1
-#define UNDOSYSTEM_EDITMODE 2
-#define UNDOSYSTEM_PARTICLE 3
+enum {
+ UNDOSYSTEM_GLOBAL = 1,
+ UNDOSYSTEM_EDITMODE = 2,
+ UNDOSYSTEM_PARTICLE = 3
+};
static int get_undo_system(bContext *C)
{
@@ -423,8 +425,9 @@ static int get_undo_system(bContext *C)
/* find out which undo system */
if (obedit) {
- if (ELEM7(obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE))
+ if (OB_TYPE_SUPPORT_EDITMODE(obedit->type)) {
return UNDOSYSTEM_EDITMODE;
+ }
}
else {
Object *obact = CTX_data_active_object(C);