diff options
author | Francisco De La Cruz <dlcs.frank@gmail.com> | 2012-04-06 15:24:42 +0400 |
---|---|---|
committer | Francisco De La Cruz <dlcs.frank@gmail.com> | 2012-04-06 15:24:42 +0400 |
commit | 6408813f6fbb30db62567c1b1b5a9206904106c1 (patch) | |
tree | cd4ed1491c8928f1c49ff4a7415b2fa56c86a4ee /source/blender/blenkernel | |
parent | 3d893a926ec9db9b985e794cbf47fd39a26e1a1a (diff) |
Fix [#30832] Weight on Bevel modifier has no effect for edges with weight.
Added missing CD_BWEIGHT layer for the modifier's DerivedMesh.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/modifiers_bmesh.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c index 52b76eabc6c..573b8a725b3 100644 --- a/source/blender/blenkernel/intern/modifiers_bmesh.c +++ b/source/blender/blenkernel/intern/modifiers_bmesh.c @@ -68,6 +68,9 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm) /* add crease layer */ BM_data_layer_add(bm, &bm->edata, CD_CREASE); + /* add bevel weight layers */ + BM_data_layer_add(bm, &bm->edata, CD_BWEIGHT); + BM_data_layer_add(bm, &bm->vdata, CD_BWEIGHT); vtable = MEM_callocN(sizeof(void**) * totvert, "vert table in BMDM_Copy"); etable = MEM_callocN(sizeof(void**) * totedge, "edge table in BMDM_Copy"); @@ -80,6 +83,9 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm) v->head.hflag = BM_vert_flag_from_mflag(mv->flag); CustomData_to_bmesh_block(&dm->vertData, &bm->vdata, i, &v->head.data); + + /* add bevel weight */ + BM_elem_float_data_set(&bm->vdata, v, CD_BWEIGHT, (float)mv->bweight / 255.0f); vtable[i] = v; } MEM_freeN(mvert); @@ -96,6 +102,8 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm) /* add crease */ BM_elem_float_data_set(&bm->edata, e, CD_CREASE, (float)me->crease / 255.0f); + /* add bevel weight */ + BM_elem_float_data_set(&bm->edata, e, CD_BWEIGHT, (float)me->bweight / 255.0f); } MEM_freeN(medge); |