diff options
author | Hans Goudey <h.goudey@me.com> | 2021-06-22 21:22:40 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-06-22 21:22:40 +0300 |
commit | ee8b284d117385168739ee9f6f459e077af2ec8c (patch) | |
tree | 06e6262c692c8bc2de6c76d66374cded9dd3e133 | |
parent | c317f111c16b014a02f6d8368aa6c8815a147d06 (diff) |
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`.
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc | 1 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc index 9651301cb34..3a93bc22b7e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cube.cc @@ -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, diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc index f43a4bc6490..22195b9e8db 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc @@ -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, |