- disable re-tesselating derived meshes in BMEdit_RecalcTesselation() have modifier...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 20 Jan 2012 13:53:47 +0000 (13:53 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 20 Jan 2012 13:53:47 +0000 (13:53 +0000)
- made editbmesh_calc_modifiers() ensure tessfaces, this has the advantage that if the tessfaces are already created they wont get re-made as was happening before.

source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/editderivedmesh.c

index 05ef6c83ab679f8a05943c836919b6d4ed3dc6c7..282696e2ccd35b85144c38be26b60c6a0b9978fc 100644 (file)
@@ -1776,7 +1776,12 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
                (*final_r)->calcNormals(*final_r); /* BMESH_ONLY - BMESH_TODO. check if this is needed */
        }
 
-       DM_ensure_tessface(*final_r); /* BMESH_ONLY */
+       /* --- */
+       /* BMESH_ONLY, ensure tessface's used for drawing,
+        * but dont recalculate if the last modifier in the stack gives us tessfaces  */
+       DM_ensure_tessface(*final_r);
+       if (cage_r && (*cage_r != *final_r)) DM_ensure_tessface(*cage_r);
+       /* --- */
 
        /* add an orco layer if needed */
        if(dataMask & CD_MASK_ORCO)
index 601c040c2026ed3cb2045f27b7f74fbe3ec89924..89339b2df060c181ccedc54360d6e7c6d4616a2c 100644 (file)
@@ -223,6 +223,8 @@ void BMEdit_RecalcTesselation(BMEditMesh *em)
 {
        BMEdit_RecalcTesselation_intern(em);
 
+       /* commented because editbmesh_build_data() ensures we get tessfaces */
+#if 0
        if (em->derivedFinal && em->derivedFinal == em->derivedCage) {
                if (em->derivedFinal->recalcTesselation)
                        em->derivedFinal->recalcTesselation(em->derivedFinal);
@@ -233,6 +235,7 @@ void BMEdit_RecalcTesselation(BMEditMesh *em)
                if (em->derivedFinal->recalcTesselation)
                        em->derivedFinal->recalcTesselation(em->derivedFinal);
        }
+#endif
 }
 
 void BMEdit_UpdateLinkedCustomData(BMEditMesh *em)