diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 18:52:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-18 18:52:47 +0400 |
commit | 939c4171c4bdaef02ea247a8eafc042bfb1e04d1 (patch) | |
tree | f4be2edd7a6e076d100b3790da4a67e6ec84dbf5 /source/blender/blenkernel | |
parent | fb07ed7cfe1dd2a7cbdb003383629c9807712ac4 (diff) |
fix for editmode bmesh bug - found by testing script.
incorrect flag handling in CDDM_from_BMEditMesh() broke editmode deform verts (they would never be copied), issue was exposed when re-aligning layer values with trunk.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 823436afb1e..40a552278a6 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1978,34 +1978,34 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis MFace *mface = cddm->mface; MLoop *mloop = cddm->mloop; MPoly *mpoly = cddm->mpoly; - int numCol = CustomData_number_of_layers(&em->bm->ldata, CD_MLOOPCOL); - int numTex = CustomData_number_of_layers(&em->bm->pdata, CD_MTEXPOLY); + int numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL); + int numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); int *index, *polyindex, add_orig; int has_crease, has_edge_bweight, has_vert_bweight; - int flag; + CustomDataMask mask; unsigned int i, j; - has_edge_bweight = CustomData_has_layer(&em->bm->edata, CD_BWEIGHT); - has_vert_bweight = CustomData_has_layer(&em->bm->vdata, CD_BWEIGHT); - has_crease = CustomData_has_layer(&em->bm->edata, CD_CREASE); + has_edge_bweight = CustomData_has_layer(&bm->edata, CD_BWEIGHT); + has_vert_bweight = CustomData_has_layer(&bm->vdata, CD_BWEIGHT); + has_crease = CustomData_has_layer(&bm->edata, CD_CREASE); dm->deformedOnly = 1; /*don't add origindex layer if one already exists*/ - add_orig = !CustomData_has_layer(&em->bm->pdata, CD_ORIGINDEX); + add_orig = !CustomData_has_layer(&bm->pdata, CD_ORIGINDEX); - flag = use_mdisps ? CD_MASK_DERIVEDMESH|CD_MASK_MDISPS : CD_MASK_DERIVEDMESH; + mask = use_mdisps ? CD_MASK_DERIVEDMESH|CD_MASK_MDISPS : CD_MASK_DERIVEDMESH; /*don't process shapekeys, we only feed them through the modifier stack as needed, e.g. for applying modifiers or the like*/ - flag &= ~CD_SHAPEKEY; - CustomData_merge(&em->bm->vdata, &dm->vertData, flag, + mask &= ~CD_MASK_SHAPEKEY; + CustomData_merge(&bm->vdata, &dm->vertData, mask, CD_CALLOC, dm->numVertData); - CustomData_merge(&em->bm->edata, &dm->edgeData, flag, + CustomData_merge(&bm->edata, &dm->edgeData, mask, CD_CALLOC, dm->numEdgeData); - CustomData_merge(&em->bm->ldata, &dm->loopData, flag, + CustomData_merge(&bm->ldata, &dm->loopData, mask, CD_CALLOC, dm->numLoopData); - CustomData_merge(&em->bm->pdata, &dm->polyData, flag, + CustomData_merge(&bm->pdata, &dm->polyData, mask, CD_CALLOC, dm->numPolyData); /*add tesselation mface layers*/ @@ -2056,7 +2056,7 @@ DerivedMesh *CDDM_from_BMEditMesh(BMEditMesh *em, Mesh *UNUSED(me), int use_mdis } bm->elem_index_dirty &= ~BM_EDGE; - BM_ElemIndex_Ensure(em->bm, BM_FACE); + BM_ElemIndex_Ensure(bm, BM_FACE); polyindex = dm->getTessFaceDataArray(dm, CD_POLYINDEX); index = dm->getTessFaceDataArray(dm, CD_ORIGINDEX); |