Fix T52852: Assert in looptri calculation after recent changes.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 20 Sep 2017 18:45:51 +0000 (20:45 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 20 Sep 2017 18:46:51 +0000 (20:46 +0200)
Wrong condition in asserts...

source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/subsurf_ccg.c

index 47e1f0beb31b9c193f846d55fff97ecc0481b7ff..42ca4359a585d0da21756c2ba59a308e1348c024 100644 (file)
@@ -1919,7 +1919,7 @@ void CDDM_recalc_looptri(DerivedMesh *dm)
        const unsigned int totloop = dm->numLoopData;
 
        DM_ensure_looptri_data(dm);
-       BLI_assert(cddm->dm.looptris.array_wip != NULL);
+       BLI_assert(totpoly == 0 || cddm->dm.looptris.array_wip != NULL);
 
        BKE_mesh_recalc_looptri(
                cddm->mloop, cddm->mpoly,
index ae4d567edf44c72ef54cfd1c3fb0fafe08d47b7a..9f6884329885b1886bc2538e476d469e176f4c95 100644 (file)
@@ -643,7 +643,7 @@ static void emDM_recalcLoopTri(DerivedMesh *dm)
        DM_ensure_looptri_data(dm);
        mlooptri = dm->looptris.array_wip;
 
-       BLI_assert(mlooptri != NULL);
+       BLI_assert(tottri == 0 || mlooptri != NULL);
        BLI_assert(poly_to_tri_count(dm->numPolyData, dm->numLoopData) == dm->looptris.num);
        BLI_assert(tottri == dm->looptris.num);
 
index ee1f5dc66961a44a6fb678a1605b12396b311b4c..27bbdf228d440412863c5e53984a541dace8dbf9 100644 (file)
@@ -4484,7 +4484,7 @@ static void ccgDM_recalcLoopTri(DerivedMesh *dm)
        DM_ensure_looptri_data(dm);
        mlooptri = dm->looptris.array_wip;
 
-       BLI_assert(mlooptri != NULL);
+       BLI_assert(tottri == 0 || mlooptri != NULL);
        BLI_assert(poly_to_tri_count(dm->numPolyData, dm->numLoopData) == dm->looptris.num);
        BLI_assert(tottri == dm->looptris.num);