From ca05219f3ec3574d2e1cb9c8eaa2790f685f26bb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Mar 2012 00:01:35 +0000 Subject: fix [#30651] bpy.ops.object.mode_set(...) editmode removes faces. problem was that BMesh had tessellation call when undo pushes were called. if python called an operator with no undo push, tessfaces would not be created. fix this by making it the responsibility of each editmesh operator to re-tessellate, as it is with notifiers and depsgraph. added EDBM_update_generic() function to add notifier, tag for depsgraph update and optionally re-tessellate. --- source/blender/editors/util/undo.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 40a95fc08ba..69dc1d1f1fb 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -48,8 +48,6 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_screen.h" -#include "BKE_tessmesh.h" /* BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND */ - #include "ED_armature.h" #include "ED_particle.h" @@ -88,19 +86,6 @@ void ED_undo_push(bContext *C, const char *str) printf("undo push %s\n", str); if (obedit) { - -#ifdef BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND - /* undo is causing tessface recalc, so without we need to do explicitly */ - - if (U.undosteps == 0) { - if (obedit->type == OB_MESH) { - Mesh *me= obedit->data; - BMEdit_RecalcTessellation(me->edit_btmesh); - } - } - -#endif /* BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND */ - if (U.undosteps == 0) return; if (obedit->type==OB_MESH) -- cgit v1.2.3