remove unneeded mesh->bmesh conversion code that copied BMLoop data in a separate...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2012 16:36:16 +0000 (16:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2012 16:36:16 +0000 (16:36 +0000)
source/blender/bmesh/intern/bmesh_mesh_conv.c

index 6617cc806c782b3900ad2a6888b81fae435564a9..c23fd85458cf8ffc5b563fc52e463744270318c9 100644 (file)
@@ -338,7 +338,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
                j = 0;
                BM_ITER_ELEM_INDEX (l, &iter, f, BM_LOOPS_OF_FACE, j) {
                        /* Save index of correspsonding MLoop */
-                       BM_elem_index_set(l, mpoly->loopstart + j); /* set_loop */
+                       CustomData_to_bmesh_block(&me->ldata, &bm->ldata, mpoly->loopstart + j, &l->head.data);
                }
 
                /* Copy Custom Data */
@@ -347,23 +347,6 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
        bm->elem_index_dirty &= ~BM_FACE; /* added in order, clear dirty flag */
 
-       {
-               BMIter fiter;
-               BMIter liter;
-
-               /* Copy over loop CustomData. Doing this in a separate loop isn't necessary
-                * but is an optimization, to avoid copying a bunch of interpolated customdata
-                * for each BMLoop (from previous BMLoops using the same edge), always followed
-                * by freeing the interpolated data and overwriting it with data from the Mesh. */
-               BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
-                       BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-                               int li = BM_elem_index_get(l);
-                               CustomData_to_bmesh_block(&me->ldata, &bm->ldata, li, &l->head.data);
-                               BM_elem_index_set(l, 0); /* set_loop */
-                       }
-               }
-       }
-
        if (me->mselect && me->totselect != 0) {
 
                BMVert **vert_array = MEM_callocN(sizeof(BMVert *) * bm->totvert,