diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-28 08:18:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-28 08:18:01 +0400 |
commit | 1810913f81dde315d1aba207c4d88ab1c8186194 (patch) | |
tree | cc983672bec7ad3f5e1eeb79fef3844ca8a6f9b4 /source/blender/blenkernel/intern | |
parent | d17c13d145fa68faf41f1c6e93cdbce914feef37 (diff) |
fix for bmesh regression similar to last revision r54920. only effected loading old blend files without edge data.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index c9c86e6739f..f6f60d03cf7 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -887,12 +887,11 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll int old, MEdge **alledge, int *_totedge) { MPoly *mpoly; - MLoop *mloop; MFace *mface; MEdge *medge; EdgeHash *hash = BLI_edgehash_new(); struct edgesort *edsort, *ed; - int a, b, totedge = 0, final = 0; + int a, totedge = 0, final = 0; /* we put all edges in array, sort them, and detect doubles that way */ @@ -973,13 +972,16 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll mpoly = allpoly; for (a = 0; a < totpoly; a++, mpoly++) { - mloop = allloop + mpoly->loopstart; - for (b = 0; b < mpoly->totloop; b++) { - int v1, v2; - - v1 = mloop[b].v; - v2 = ME_POLY_LOOP_NEXT(mloop, mpoly, b)->v; - mloop[b].e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(hash, v1, v2)); + MLoop *ml, *ml_next; + int i = mpoly->totloop; + + ml_next = allloop + mpoly->loopstart; /* first loop */ + ml = &ml_next[i - 1]; /* last loop */ + + while (i-- != 0) { + ml->e = GET_INT_FROM_POINTER(BLI_edgehash_lookup(hash, ml->v, ml_next->v)); + ml = ml_next; + ml_next++; } } |