fix for error in recent commit. passing totface rather then totpoly, also add asserts...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 5 Feb 2012 07:09:30 +0000 (07:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 5 Feb 2012 07:09:30 +0000 (07:09 +0000)
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/subsurf_ccg.c

index 35d578b9d5eec9a54079c7fd911c25610ddedbba..15740076dc0b2cf8f4b3073727cbef03f1cc1d89 100644 (file)
@@ -218,7 +218,7 @@ static ListBase *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
 
                create_vert_poly_map(&cddm->pmap, &cddm->pmap_mem,
                                     me->mpoly, me->mloop,
-                                    me->totvert, me->totface, me->totloop);
+                                    me->totvert, me->totpoly, me->totloop);
        }
 
        return cddm->pmap;
@@ -284,6 +284,7 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
                Mesh *me= ob->data;
                cddm->pbvh = BLI_pbvh_new();
                cddm->pbvh_draw = can_pbvh_draw(ob, dm);
+               BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */
                BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
                                    me->totface, me->totvert);
 
index a32d19addf9504025e43374f2402205c2ed30bbd..361784814191b817e7c622eb05fd90472e78bf53 100644 (file)
@@ -2747,7 +2747,7 @@ static ListBase *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
 
                create_vert_poly_map(&ccgdm->pmap, &ccgdm->pmap_mem,
                                     me->mpoly, me->mloop,
-                                    me->totvert, me->totface, me->totloop);
+                                    me->totvert, me->totpoly, me->totloop);
        }
 
        return ccgdm->pmap;
@@ -2825,6 +2825,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm)
        } else if(ob->type == OB_MESH) {
                Mesh *me= ob->data;
                ob->sculpt->pbvh= ccgdm->pbvh = BLI_pbvh_new();
+               BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */
                BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert,
                                   me->totface, me->totvert);
        }