svn merge ^/trunk/blender -r42655:42660
authorCampbell Barton <ideasman42@gmail.com>
Fri, 16 Dec 2011 04:16:52 +0000 (04:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 16 Dec 2011 04:16:52 +0000 (04:16 +0000)
1  2 
source/blender/editors/mesh/meshtools.c

index 5e9762d16e70b239344966f2b11c2825ce2ce55d,3ea872a93de7bde32d514daa4a2157e520a829ca..1cfa369e5c12bd46dd086b02d08e16aca61bad7e
@@@ -937,23 -885,30 +938,26 @@@ long mesh_mirrtopo_table(Object *ob, ch
                Mesh *me= ob->data;
                if(     (mesh_topo_lookup==NULL) ||
                        (mesh_topo_lookup_mode != ob->mode) ||
-                       (me->edit_btmesh && me->edit_btmesh->bm->totvert != mesh_topo_lookup_tot) ||
-                       (me->edit_btmesh==NULL && me->totvert != mesh_topo_lookup_tot)
 -                      (me->edit_mesh && (me->edit_mesh->totvert != mesh_topo_lookup_vert_tot)) ||
 -                      (me->edit_mesh && (me->edit_mesh->totedge != mesh_topo_lookup_edge_tot)) ||
 -                      (me->edit_mesh==NULL && me->totvert != mesh_topo_lookup_vert_tot) ||
 -                      (me->edit_mesh==NULL && me->totedge != mesh_topo_lookup_edge_tot)
++                      (me->edit_btmesh && me->edit_btmesh->bm->totvert != mesh_topo_lookup_vert_tot) ||
++                      (me->edit_btmesh && me->edit_btmesh->bm->totedge != mesh_topo_lookup_edge_tot) ||
++                      (me->edit_btmesh==NULL && me->totvert != mesh_topo_lookup_vert_tot) ||
++                      (me->edit_btmesh==NULL && me->totedge != mesh_topo_lookup_edge_tot)
                ) {
                        mesh_mirrtopo_table(ob, 's');
                }
        } else if(mode=='s') { /* start table */
                Mesh *me= ob->data;
                MEdge *medge;
 -              EditMesh *em= me->edit_mesh;
 -              void **eve_tmp_back= NULL; /* some of the callers are using eve->tmp so restore after */
 -
 -
 -              /* editmode*/
 -              EditEdge *eed;
 -
 +              BMEditMesh *em= me->edit_btmesh;
 +              BMEdge *eed;
 +              BMIter iter;
 +              MIRRHASH_TYPE *MirrTopoHash = NULL;
 +              MIRRHASH_TYPE *MirrTopoHash_Prev = NULL;
 +              MirrTopoPair *MirrTopoPairs;
-               int a, last, totvert;
+               int a, last;
+               int totvert, totedge;
                int totUnique= -1, totUniqueOld= -1;
  
 -              MIRRHASH_TYPE *MirrTopoHash = NULL;
 -              MIRRHASH_TYPE *MirrTopoHash_Prev = NULL;
 -              MirrTopoPair *MirrTopoPairs;
                mesh_topo_lookup_mode= ob->mode;
  
                /* reallocate if needed */
  
                /* Initialize the vert-edge-user counts used to detect unique topology */
                if(em) {
 -                      totedge= 0;
 -
 -                      for(eed=em->edges.first; eed; eed= eed->next, totedge++) {
 -                              MirrTopoHash[eed->v1->tmp.l]++;
 -                              MirrTopoHash[eed->v2->tmp.l]++;
++                      totedge= me->edit_btmesh->bm->totedge;
 +                      BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
 +                              MirrTopoHash[BM_GetIndex(eed->v1)]++;
 +                              MirrTopoHash[BM_GetIndex(eed->v2)]++;
                        }
                } else {
-                       for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
+                       totedge= me->totedge;
+                       for(a=0, medge=me->medge; a < me->totedge; a++, medge++) {
                                MirrTopoHash[medge->v1]++;
                                MirrTopoHash[medge->v2]++;
                        }