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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-06-11 12:06:59 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-06-11 12:06:59 +0400
commit401eaa448b7437c55aeec46b26f8c0e751f421ac (patch)
tree9eacfe8d6d4472464d259a44e69b5abb5908afe5 /source/blender/bmesh
parentc730ae0921b6948e17a751e285536320e5ac0967 (diff)
Fix for distortion happens when flipping mesh normals
Issue was caused by missing X/Y displacement components flip when flipping the normals (flipping the normals changes the tangent space apparently and displacement vectors need to be modified to correspond to new space). Reported by Jonathan Williamson in IRC.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index 56ac6c379c2..b7eeceae494 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -791,7 +791,10 @@ static bool bm_loop_reverse_loop(BMesh *bm, BMFace *f
for (x = 0; x < sides; x++) {
for (y = 0; y < x; y++) {
swap_v3_v3(co[y * sides + x], co[sides * x + y]);
+ SWAP(float, co[y * sides + x][0], co[y * sides + x][1]);
+ SWAP(float, co[x * sides + y][0], co[x * sides + y][1]);
}
+ SWAP(float, co[x * sides + x][0], co[x * sides + x][1]);
}
}
}