[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57373] trunk/blender/source/blender/bmesh /intern/bmesh_core.c: Fix for distortion happens when flipping mesh normals

Sergey Sharybin sergey.vfx at gmail.com
Tue Jun 11 10:07:00 CEST 2013


Revision: 57373
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57373
Author:   nazgul
Date:     2013-06-11 08:06:59 +0000 (Tue, 11 Jun 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_core.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_core.c
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_core.c	2013-06-11 05:56:02 UTC (rev 57372)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_core.c	2013-06-11 08:06:59 UTC (rev 57373)
@@ -791,7 +791,10 @@
 			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]);
 			}
 		}
 	}




More information about the Bf-blender-cvs mailing list