diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-16 08:16:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-16 08:16:52 +0400 |
commit | d46712cd298f59405646fc44acef52fbb11d2f82 (patch) | |
tree | a16d27ff771ee76f0f8832502252ae2269dd00a6 /source/blender/editors/mesh/meshtools.c | |
parent | 862dc635ed98c6d1ffc7c755058c682021da4c6b (diff) | |
parent | 724868b400882c93c83e42f17884426b23a09104 (diff) |
svn merge ^/trunk/blender -r42655:42660
Diffstat (limited to 'source/blender/editors/mesh/meshtools.c')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 5e9762d16e7..1cfa369e5c1 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -926,7 +926,8 @@ static int MirrTopo_item_sort(const void *v1, const void *v2) } static long *mesh_topo_lookup = NULL; -static int mesh_topo_lookup_tot = -1; +static int mesh_topo_lookup_vert_tot = -1; +static int mesh_topo_lookup_edge_tot = -1; static int mesh_topo_lookup_mode = -1; /* mode is 's' start, or 'e' end, or 'u' use */ @@ -937,8 +938,10 @@ long mesh_mirrtopo_table(Object *ob, char mode) 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_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'); } @@ -951,7 +954,8 @@ long mesh_mirrtopo_table(Object *ob, char mode) 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; mesh_topo_lookup_mode= ob->mode; @@ -975,12 +979,15 @@ long mesh_mirrtopo_table(Object *ob, char mode) /* Initialize the vert-edge-user counts used to detect unique topology */ if(em) { + 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]++; } @@ -1078,14 +1085,16 @@ long mesh_mirrtopo_table(Object *ob, char mode) MEM_freeN( MirrTopoHash ); MEM_freeN( MirrTopoHash_Prev ); - mesh_topo_lookup_tot = totvert; + mesh_topo_lookup_vert_tot = totvert; + mesh_topo_lookup_edge_tot = totedge; } else if(mode=='e') { /* end table */ if (mesh_topo_lookup) { MEM_freeN(mesh_topo_lookup); } mesh_topo_lookup = NULL; - mesh_topo_lookup_tot= -1; + mesh_topo_lookup_vert_tot= -1; + mesh_topo_lookup_edge_tot= -1; } return 0; } |