svn merge ^/trunk/blender -r42564:42586
[blender-staging.git] / source / blender / editors / util / undo.c
index 3ec99ca7508679afce6a8765ea4ce159bb7ddea6..be596a9a4a92f1c075263a511e3afff7866e85fd 100644 (file)
@@ -48,6 +48,8 @@
 #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"
@@ -86,6 +88,19 @@ 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_RecalcTesselation(me->edit_btmesh);
+                       }
+               }
+
+#endif /* BMESH_EM_UNDO_RECALC_TESSFACE_WORKAROUND */
+
                if (U.undosteps == 0) return;
                
                if(obedit->type==OB_MESH)