[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43560] branches/bmesh/blender/source/ blender/blenkernel/intern: - disable re-tesselating derived meshes in BMEdit_RecalcTesselation() have modifier stack do this.

Campbell Barton ideasman42 at gmail.com
Fri Jan 20 14:53:58 CET 2012


Revision: 43560
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43560
Author:   campbellbarton
Date:     2012-01-20 13:53:47 +0000 (Fri, 20 Jan 2012)
Log Message:
-----------
- disable re-tesselating derived meshes in BMEdit_RecalcTesselation() have modifier stack do this.
- 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.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
    branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-20 13:27:54 UTC (rev 43559)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-01-20 13:53:47 UTC (rev 43560)
@@ -1776,7 +1776,12 @@
 		(*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)

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-01-20 13:27:54 UTC (rev 43559)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-01-20 13:53:47 UTC (rev 43560)
@@ -223,6 +223,8 @@
 {
 	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 @@
 		if (em->derivedFinal->recalcTesselation)
 			em->derivedFinal->recalcTesselation(em->derivedFinal);
 	}
+#endif
 }
 
 void BMEdit_UpdateLinkedCustomData(BMEditMesh *em)



More information about the Bf-blender-cvs mailing list