[Bf-blender-cvs] [b8ea2e7] master: Smart UV Project: don't rotate islands which are almost square

Campbell Barton noreply at git.blender.org
Thu Apr 24 19:24:04 CEST 2014


Commit: b8ea2e73d2b10b6c1db46dcc14471c1291ef1bd2
Author: Campbell Barton
Date:   Fri Apr 25 00:43:15 2014 +1000
https://developer.blender.org/rBb8ea2e73d2b10b6c1db46dcc14471c1291ef1bd2

Smart UV Project: don't rotate islands which are almost square

===================================================================

M	release/scripts/startup/bl_operators/uvcalc_smart_project.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index 1a8bd44..bf8b10a 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -250,7 +250,8 @@ def optiRotateUvIsland(faces):
     # orient them vertically (could be an option)
     minx, miny, maxx, maxy = boundsIsland(faces)
     w, h = maxx - minx, maxy - miny
-    if h < w:
+    # use epsilon so we dont randomly rotate (almost) perfect squares.
+    if h + 0.00001 < w:
         from math import pi
         angle = pi / 2.0
         rotate_uvs(uv_points, angle)




More information about the Bf-blender-cvs mailing list