Commit: 6b7313be94b15441426abd9af12d0a97f05217ba
Author: Campbell Barton
Date:   Fri Jul 31 11:52:21 2015 +1000
Branches: master
https://developer.blender.org/rB6b7313be94b15441426abd9af12d0a97f05217ba

Don't initialize CDDM with MFace from Meshes

Caused crash because MFace is no longer a layer which is added unless requested,
causing CDDM to have numTessFaceData nonzero, but mface set to NULL.

===================================================================

M       source/blender/blenkernel/intern/cdderivedmesh.c

===================================================================

diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c 
b/source/blender/blenkernel/intern/cdderivedmesh.c
index 9a3a741..dde0410 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -2034,7 +2034,7 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh)
 
        /* this does a referenced copy, with an exception for fluidsim */
 
-       DM_init(dm, DM_TYPE_CDDM, mesh->totvert, mesh->totedge, mesh->totface,
+       DM_init(dm, DM_TYPE_CDDM, mesh->totvert, mesh->totedge, 0 /* 
mesh->totface */,
                mesh->totloop, mesh->totpoly);
 
        dm->deformedOnly = 1;
@@ -2047,7 +2047,7 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh)
        CustomData_merge(&mesh->edata, &dm->edgeData, mask, alloctype,
                         mesh->totedge);
        CustomData_merge(&mesh->fdata, &dm->faceData, mask | CD_MASK_ORIGINDEX, 
alloctype,
-                        mesh->totface);
+                        0 /* mesh->totface */);
        CustomData_merge(&mesh->ldata, &dm->loopData, mask, alloctype,
                         mesh->totloop);
        CustomData_merge(&mesh->pdata, &dm->polyData, mask, alloctype,
@@ -2057,7 +2057,11 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh)
        cddm->medge = CustomData_get_layer(&dm->edgeData, CD_MEDGE);
        cddm->mloop = CustomData_get_layer(&dm->loopData, CD_MLOOP);
        cddm->mpoly = CustomData_get_layer(&dm->polyData, CD_MPOLY);
+#if 0
        cddm->mface = CustomData_get_layer(&dm->faceData, CD_MFACE);
+#else
+       cddm->mface = NULL;
+#endif
 
        /* commented since even when CD_ORIGINDEX was first added this line 
fails
         * on the default cube, (after editmode toggle too) - campbell */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to