fix for remesh (infact any modifier that uses tessface's) not displaying geometry...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Feb 2012 03:03:09 +0000 (03:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Feb 2012 03:03:09 +0000 (03:03 +0000)
the bug was in CDDM_from_BMEditMesh which would create tessfaces even when use_tessface==FALSE.

source/blender/blenkernel/intern/cdderivedmesh.c

index 4f0c9e113098689336e581fdfd9510e5e413c597..63a2a8b335b84d14c6d35258e2f9cc655c0eae23 100644 (file)
@@ -1992,10 +1992,15 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
 
 DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdisps, int use_tessface)
 {
-       DerivedMesh *dm = CDDM_new(em->bm->totvert, em->bm->totedge, 
-                              em->tottri, em->bm->totloop, em->bm->totface);
-       CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
        BMesh *bm = em->bm;
+
+       DerivedMesh *dm = CDDM_new(bm->totvert,
+                                  bm->totedge,
+                                  use_tessface ? em->tottri : 0,
+                                  bm->totloop,
+                                  bm->totface);
+
+       CDDerivedMesh *cddm = (CDDerivedMesh*)dm;
        BMIter iter, liter;
        BMVert *eve;
        BMEdge *eed;