fix mirror when have dup faces; prevent eekadoodle on tess recalculation
authorHoward Trickey <howard.trickey@gmail.com>
Mon, 8 Aug 2011 17:30:19 +0000 (17:30 +0000)
committerHoward Trickey <howard.trickey@gmail.com>
Mon, 8 Aug 2011 17:30:19 +0000 (17:30 +0000)
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/mesh.c

index f04eeed585b9b748c5ab3a9d4122721d5f75b33a..fef186fee9ae9cc9aeec21eab87e15e5fe57e459 100644 (file)
@@ -2236,15 +2236,8 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, int *vtargetmap)
                if (ml->v == -1)
                        continue;
                
-               if (vtargetmap[ml->v] != -1) {
-                       me = &cddm->medge[ml->e];
-                       if (me->v1 == ml->v)
-                               me->v1 = vtargetmap[ml->v];
-                       else
-                               me->v2 = vtargetmap[ml->v];
-                       
+               if (vtargetmap[ml->v] != -1)
                        ml->v = vtargetmap[ml->v];
-               }
        }
        
        /*now go through and fix edges and faces*/
index 5e05c1090d960f9621ebf1eeacb44bfc84c7b4f9..624b3ee9e8b53209b3a850c7604d9297443a76f9 100644 (file)
@@ -2364,6 +2364,14 @@ int mesh_recalcTesselation(CustomData *fdata,
                mf->v2 = mloop[mf->v2].v;
                mf->v3 = mloop[mf->v3].v;
 
+               if(mf->v3==0) {
+                       /*prevent eekadoodle*/
+                       SWAP(int, mf->v1, mf->v2);
+                       SWAP(int, mf->v2, mf->v3);
+                       SWAP(int, lindex[0], lindex[1]);
+                       SWAP(int, lindex[1], lindex[2]);
+               }
+
                mesh_loops_to_tri_corners(fdata, ldata, pdata,
                        lindex, i, mf->v4);