Revision: 41320
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41320
Author:   ender79
Date:     2011-10-27 17:39:15 +0000 (Thu, 27 Oct 2011)
Log Message:
-----------
perf improvement for array modifiers

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c  
2011-10-27 15:50:51 UTC (rev 41319)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c  
2011-10-27 17:39:15 UTC (rev 41320)
@@ -392,6 +392,15 @@
        if(count < 1)
                count = 1;
 
+       /* BMESH_TODO: bumping up the stack level avoids computing the normals
+          after every top-level operator execution (and this modifier has the
+          potential to execute a *lot* of top-level BMOps. There should be a
+          cleaner way to do this. One possibility: a "mirror" BMOp would
+          certainly help by compressing it all into one top-level BMOp that
+          executes a lot of second-level BMOps. */
+       BMO_push(em->bm, NULL);
+       bmesh_begin_edit(em->bm, 0);
+
        BMO_Init_Op(&weldop, "weldverts");
        BMO_InitOpf(em->bm, &op, "dupe geom=%avef");
        oldop = op;
@@ -474,6 +483,10 @@
 
        BMO_Finish_Op(em->bm, &weldop);
 
+       /* Bump the stack level back down to match the adjustment up above */
+       bmesh_end_edit(em->bm, 0);
+       BMO_pop(em->bm);
+
        BMEdit_RecalcTesselation(em);
        cddm = CDDM_from_BMEditMesh(em, NULL, 0);
 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to