Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 20:17:04 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 20:17:04 +0400
commitade7f59d0a7163c14afaa0a5418698149d141d4b (patch)
tree2ad399d51e6c22b36b0adcaca0ed589d8de2d843 /source/blender/modifiers/intern/MOD_mirror.c
parenta0642a259759ebd76a956433a2949b94b00374bb (diff)
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.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mirror.c')
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c11
1 files changed, 6 insertions, 5 deletions
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;