diff options
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mesh_conv.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_conv.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index 59ce91a3e70..49f055e1827 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -98,42 +98,6 @@ #include "bmesh.h" #include "intern/bmesh_private.h" /* for element checking */ -/** - * Currently this is only used for Python scripts - * which may fail to keep matching UV/TexFace layers. - * - * \note This should only perform any changes in exceptional cases, - * if we need this to be faster we could inline #BM_data_layer_add and only - * call #update_data_blocks once at the end. - */ -void BM_mesh_cd_validate(BMesh *bm) -{ - int totlayer_mtex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); - int totlayer_uv = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV); - - if (LIKELY(totlayer_mtex == totlayer_uv)) { - /* pass */ - } - else if (totlayer_mtex < totlayer_uv) { - const int uv_index_first = CustomData_get_layer_index(&bm->ldata, CD_MLOOPUV); - do { - const char *from_name = bm->ldata.layers[uv_index_first + totlayer_mtex].name; - BM_data_layer_add_named(bm, &bm->pdata, CD_MTEXPOLY, from_name); - CustomData_set_layer_unique_name(&bm->pdata, totlayer_mtex); - } while (totlayer_uv != ++totlayer_mtex); - } - else if (totlayer_uv < totlayer_mtex) { - const int mtex_index_first = CustomData_get_layer_index(&bm->pdata, CD_MTEXPOLY); - do { - const char *from_name = bm->pdata.layers[mtex_index_first + totlayer_uv].name; - BM_data_layer_add_named(bm, &bm->ldata, CD_MLOOPUV, from_name); - CustomData_set_layer_unique_name(&bm->ldata, totlayer_uv); - } while (totlayer_mtex != ++totlayer_uv); - } - - BLI_assert(totlayer_mtex == totlayer_uv); -} - void BM_mesh_cd_flag_ensure(BMesh *bm, Mesh *mesh, const char cd_flag) { const char cd_flag_all = BM_mesh_cd_flag_from_bmesh(bm) | cd_flag; @@ -235,7 +199,7 @@ void BM_mesh_bm_from_me( BMEdge *e, **etable = NULL; BMFace *f; float (*keyco)[3] = NULL; - int totuv, totloops, i, j; + int totloops, i, j; /* free custom data */ /* this isnt needed in most cases but do just incase */ @@ -266,13 +230,6 @@ void BM_mesh_bm_from_me( CustomData_copy(&me->ldata, &bm->ldata, CD_MASK_BMESH, CD_CALLOC, 0); CustomData_copy(&me->pdata, &bm->pdata, CD_MASK_BMESH, CD_CALLOC, 0); - /* make sure uv layer names are consisten */ - totuv = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY); - for (i = 0; i < totuv; i++) { - int li = CustomData_get_layer_index_n(&bm->pdata, CD_MTEXPOLY, i); - CustomData_set_layer_name(&bm->ldata, CD_MLOOPUV, i, bm->pdata.layers[li].name); - } - if ((params->active_shapekey != 0) && (me->key != NULL)) { actkey = BLI_findlink(&me->key->block, params->active_shapekey - 1); } |