Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-05-14 15:55:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-14 16:01:59 +0300
commitb9996a3cc375fa4c60c62ee1c54cee94b289a43f (patch)
treeb51838a2c91b9d4fc3a999b182d97f7fafb61493
parentb1e2f8be2371eeeed3300d42e796f6cf7901e8d9 (diff)
Fix Cube generated UV's rotated incorrectly
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index e3be4db804b..b120b48447f 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.