Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-07-31 04:52:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-31 04:57:50 +0300
commit6b7313be94b15441426abd9af12d0a97f05217ba (patch)
tree1d2fb4fdc5901064d736e3d79e352fadf2ae3ae7
parent4d4c3b36a78775b1b71255b5de186ebe533cfba5 (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 9a3a74103f8..dde04104654 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 */