Commit: 9437e2a9d65ab337494ed2eba040643d9ce78231
Author: Campbell Barton
Date:   Sat May 14 22:55:55 2016 +1000
Branches: compositor-2016
https://developer.blender.org/rB9437e2a9d65ab337494ed2eba040643d9ce78231

Fix Cube generated UV's rotated incorrectly

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

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 e3be4db..b120b48 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -1042,13 +1042,14 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
        float off = BMO_slot_float_get(op->slots_in, "size") / 2.0f;
        const bool calc_uvs = BMO_slot_bool_get(op->slots_in, "calc_uvs");
        int i, x, y, z;
+       /* rotation order set to match 'BM_mesh_calc_uvs_cube' */
        const char faces[6][4] = {
-               {1, 3, 2, 0},
-               {3, 7, 6, 2},
-               {7, 5, 4, 6},
-               {5, 1, 0, 4},
-               {0, 2, 6, 4},
-               {5, 7, 3, 1},
+               {0, 1, 3, 2},
+               {2, 3, 7, 6},
+               {6, 7, 5, 4},
+               {4, 5, 1, 0},
+               {2, 6, 4, 0},
+               {7, 3, 1, 5},
        };
 
        BMO_slot_mat4_get(op->slots_in, "matrix", mat);
@@ -1093,7 +1094,8 @@ void bmo_create_cube_exec(BMesh *bm, BMOperator *op)
 /**
  * Fills first available UVmap with cube-like UVs for all faces OpFlag-ged by 
given flag.
  *
- * \note Expects tagged faces to be six quads...
+ * \note Expects tagged faces to be six quads.
+ * \note Caller must order faces for correct alignment.
  *
  * \param bm The BMesh to operate on.
  * \param oflag The flag to check faces with.

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to