From c8bcabaf40c287515e69d95afa9f13ad2178af4b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Nov 2010 15:16:49 +0000 Subject: [PATCH] bugfix [#24685] Changing mode bypasses undo suppression Editmode undo operator was using the operator OPTYPE_UNDO flag as well as its own EM_DO_UNDO option. This gave 2 problems. - python suppressed undos would fail (as in the report). - Undo push was called twice on exiting editmode for no reason. Use the operator undo in this case. --- source/blender/editors/object/object_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 118c649adde..d9e0140c699 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -511,7 +511,7 @@ static int editmode_toggle_exec(bContext *C, wmOperator *UNUSED(op)) if(!CTX_data_edit_object(C)) ED_object_enter_editmode(C, EM_WAITCURSOR); else - ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO); + ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* had EM_DO_UNDO but op flag calls undo too [#24685] */ return OPERATOR_FINISHED; }