Fix T89327: Cube and ico sphere nodes do not create UVs
It turns out you have to add the UV custom data layer manually before calling the BMesh primitive operators, even if you pass `calc_uvs=true`.
This commit is contained in:
parent
c317f111c1
commit
ee8b284d11
Notes:
blender-bot
2023-03-24 17:05:22 +01:00
Referenced by issue #89327, Geometry nodes: Cube and Ico Sphere mesh primitives lack UVs
|
@ -43,6 +43,7 @@ Mesh *create_cube_mesh(const float size)
|
|||
const BMeshCreateParams bmcp = {true};
|
||||
const BMAllocTemplate allocsize = {8, 12, 24, 6};
|
||||
BMesh *bm = BM_mesh_create(&allocsize, &bmcp);
|
||||
BM_data_layer_add_named(bm, &bm->ldata, CD_MLOOPUV, nullptr);
|
||||
|
||||
BMO_op_callf(bm,
|
||||
BMO_FLAG_DEFAULTS,
|
||||
|
|
|
@ -44,6 +44,7 @@ static Mesh *create_ico_sphere_mesh(const int subdivisions, const float radius)
|
|||
const BMeshCreateParams bmcp = {true};
|
||||
const BMAllocTemplate allocsize = {0, 0, 0, 0};
|
||||
BMesh *bm = BM_mesh_create(&allocsize, &bmcp);
|
||||
BM_data_layer_add_named(bm, &bm->ldata, CD_MLOOPUV, nullptr);
|
||||
|
||||
BMO_op_callf(bm,
|
||||
BMO_FLAG_DEFAULTS,
|
||||
|
|
Loading…
Reference in New Issue