From ade7f59d0a7163c14afaa0a5418698149d141d4b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 2 May 2012 16:17:04 +0000 Subject: Fix #31190: mirror modifier caused non-planar quads to be split differently on the other side, now keep the first vertex of the polygon the same to avoid this. --- source/blender/modifiers/intern/MOD_mirror.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_mirror.c') diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 1284d5a6769..09924b5b0a4 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -113,7 +113,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, float mtx[4][4]; int i, j; int a, totshape; - int *vtargetmap, *vtmap_a = NULL, *vtmap_b = NULL; + int *vtargetmap = NULL, *vtmap_a = NULL, *vtmap_b = NULL; /* mtx is the mirror transformation */ unit_m4(mtx); @@ -223,10 +223,11 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, MLoop *ml2; int e; - /* reverse the loop */ - for (j = 0; j < mp->totloop; j++) { - DM_copy_loop_data(result, result, mp->loopstart + j, mp->loopstart + maxLoops + mp->totloop - j - 1, 1); - } + /* reverse the loop, but we keep the first vertex in the face the same, + * to ensure that quads are split the same way as on the other side */ + DM_copy_loop_data(result, result, mp->loopstart, mp->loopstart + maxLoops, 1); + for (j = 1; j < mp->totloop; j++) + DM_copy_loop_data(result, result, mp->loopstart + j, mp->loopstart + maxLoops + mp->totloop - j, 1); ml2 = ml + mp->loopstart + maxLoops; e = ml2[0].e; -- cgit v1.2.3