Fix Cube generated UV's rotated incorrectly

This commit is contained in:
Campbell Barton 2016-05-14 22:55:55 +10:00
parent b1e2f8be23
commit b9996a3cc3
Notes: blender-bot 2023-02-14 08:38:14 +01:00
Referenced by issue #48434, Missing meta support in new depsgraph
1 changed files with 9 additions and 7 deletions

View File

@ -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.