[Bf-blender-cvs] [a542f50b51a] master: Fix T67523: Incorrect UV's for grid primitive

matc noreply at git.blender.org
Mon Jul 29 06:29:03 CEST 2019


Commit: a542f50b51af0167acc55d4cf2b06490a704ce93
Author: matc
Date:   Mon Jul 29 14:26:39 2019 +1000
Branches: master
https://developer.blender.org/rBa542f50b51af0167acc55d4cf2b06490a704ce93

Fix T67523: Incorrect UV's for grid primitive

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

M	source/blender/bmesh/operators/bmo_primitive.c

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

diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index cf3d6b8bf56..2eedefe7980 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -807,6 +807,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm,
 
   const float dx = 1.0f / (float)(x_segments - 1);
   const float dy = 1.0f / (float)(y_segments - 1);
+  const float dx_wrap = 1.0 - (dx / 2.0f);
   float x = 0.0f;
   float y = dy;
 
@@ -844,7 +845,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm,
     }
 
     x += dx;
-    if (x >= 1.0f) {
+    if (x >= dx_wrap) {
       x = 0.0f;
       y += dy;
     }



More information about the Bf-blender-cvs mailing list