[Bf-blender-cvs] [d426c335c59] master: Fix T51135: Cylinder primitive generated bad UVs

Germano Cavalcante noreply at git.blender.org
Thu Apr 6 17:20:50 CEST 2017


Commit: d426c335c597071beafc8313f58ecea3a2432bfe
Author: Germano Cavalcante
Date:   Thu Apr 6 12:20:22 2017 -0300
Branches: master
https://developer.blender.org/rBd426c335c597071beafc8313f58ecea3a2432bfe

Fix T51135: Cylinder primitive generated bad UVs

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

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 723e0b168e0..e5c3ff7a088 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -1566,7 +1566,7 @@ void BM_mesh_calc_uvs_cone(
 
 	BLI_assert(cd_loop_uv_offset != -1); /* caller is responsible for ensuring the mesh has UVs */
 
-	x = 0.0f;
+	x = 1.0f;
 	y = 1.0f - uv_height;
 
 	BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) {
@@ -1580,7 +1580,7 @@ void BM_mesh_calc_uvs_cone(
 
 				switch (loop_index) {
 					case 0:
-						x += uv_width;
+						/* Continue in the last position */
 						break;
 					case 1:
 						y += uv_height;
@@ -1598,8 +1598,6 @@ void BM_mesh_calc_uvs_cone(
 				luv->uv[0] = x;
 				luv->uv[1] = y;
 			}
-
-			x += uv_width;
 		}
 		else {
 			/* top or bottom face - so unwrap it by transforming back to a circle and using the X/Y coords */




More information about the Bf-blender-cvs mailing list