diff options
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_convert.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.c b/source/blender/bmesh/intern/bmesh_mesh_convert.c index 6b44fe2c9ff..a7dd5be5cbd 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.c +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.c @@ -122,6 +122,17 @@ void BM_mesh_cd_flag_apply(BMesh *bm, const char cd_flag) } } + if (cd_flag & ME_CDFLAG_VERT_CREASE) { + if (!CustomData_has_layer(&bm->vdata, CD_CREASE)) { + BM_data_layer_add(bm, &bm->vdata, CD_CREASE); + } + } + else { + if (CustomData_has_layer(&bm->vdata, CD_CREASE)) { + BM_data_layer_free(bm, &bm->vdata, CD_CREASE); + } + } + if (cd_flag & ME_CDFLAG_EDGE_BWEIGHT) { if (!CustomData_has_layer(&bm->edata, CD_BWEIGHT)) { BM_data_layer_add(bm, &bm->edata, CD_BWEIGHT); @@ -151,6 +162,9 @@ char BM_mesh_cd_flag_from_bmesh(BMesh *bm) if (CustomData_has_layer(&bm->vdata, CD_BWEIGHT)) { cd_flag |= ME_CDFLAG_VERT_BWEIGHT; } + if (CustomData_has_layer(&bm->vdata, CD_CREASE)) { + cd_flag |= ME_CDFLAG_VERT_CREASE; + } if (CustomData_has_layer(&bm->edata, CD_BWEIGHT)) { cd_flag |= ME_CDFLAG_EDGE_BWEIGHT; } |