From 8d6a40c0162fba7d64b349bb5e7370c860acbb35 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 Jan 2010 15:54:42 +0000 Subject: Fix #19802: tweaking the values of e.g. the add tube operator when entering editmode on a second mesh would create a duplicate tube. Cleaning the undo stack from the previous mesh would mess up the redo. Also, OBJECT_OT_mode_set was causing enter/exit editmode undo push to be done twice, now it leaves undo push to the operator it calls. --- source/blender/editors/util/editmode_undo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 5fb93b0f8ec..a21ff088f2e 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -203,7 +203,6 @@ static void undo_clean_stack(bContext *C) { UndoElem *uel, *next; Object *obedit= CTX_data_edit_object(C); - int mixed= 0; /* global undo changes pointers, so we also allow identical names */ /* side effect: when deleting/renaming object and start editing new one with same name */ @@ -226,7 +225,9 @@ static void undo_clean_stack(bContext *C) if(isvalid) uel->ob= obedit; else { - mixed= 1; + if(uel == curundo) + curundo= NULL; + uel->freedata(uel->undodata); BLI_freelinkN(&undobase, uel); } @@ -234,7 +235,7 @@ static void undo_clean_stack(bContext *C) uel= next; } - if(mixed) curundo= undobase.last; + if(curundo == NULL) curundo= undobase.last; } /* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */ -- cgit v1.2.3 From 29377db3f1c427d50031a479b2c082a47c6ac163 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Jan 2010 16:09:56 +0000 Subject: [#19872] Mesh edit missing undo push for mode changing copy the editmesh select mode back to the scene on undo. --- source/blender/editors/util/editmode_undo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index a21ff088f2e..f58cd148dec 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -269,6 +269,11 @@ void undo_editmode_step(bContext *C, int step) } } + /* special case for editmesh, mode must be copied back to the scene */ + if(obedit->type == OB_MESH) { + EM_selectmode_to_scene(CTX_data_scene(C), obedit); + } + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); /* XXX notifiers */ -- cgit v1.2.3 From 104f46afdd4f2b3f66a73ddc14582bcb2854ef36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 2 Feb 2010 18:24:10 +0000 Subject: linking in mesh data with animation crashed blender. also fixed some warnings. --- source/blender/editors/util/editmode_undo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index f58cd148dec..8d674c1adbe 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -52,6 +52,7 @@ #include "BKE_utildefines.h" #include "ED_util.h" +#include "ED_mesh.h" #include "UI_interface.h" #include "UI_resources.h" -- cgit v1.2.3 From 081c1205a31cb12ef632565b8d0c3fce024aa339 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Feb 2010 13:34:04 +0000 Subject: correct fsf address --- source/blender/editors/util/editmode_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 8d674c1adbe..a61fc5232d0 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2004 Blender Foundation * All rights reserved. -- cgit v1.2.3