[Bf-blender-cvs] [b255bb87cbf] refactor-mesh-uv-map-generic: Make generated objects use 'UVMap' as name for their uv maps.
Martijn Versteegh
noreply at git.blender.org
Tue Dec 13 21:10:41 CET 2022
Commit: b255bb87cbf978d866038f15750bcbbdd2c57519
Author: Martijn Versteegh
Date: Tue Dec 13 19:50:49 2022 +0100
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rBb255bb87cbf978d866038f15750bcbbdd2c57519
Make generated objects use 'UVMap' as name for their uv maps.
Now the UVMaps are stored in a float2 attribute layer, the default
layername is 'Float2'. Using 'UVMap' as name for a uv map is more
descriptive.
===================================================================
M source/blender/modifiers/intern/MOD_ocean.c
M source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_ico_sphere.cc
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index 6da94bd4f90..44ea944bc83 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -288,8 +288,8 @@ static Mesh *generate_ocean_geometry(OceanModifierData *omd, Mesh *mesh_orig, co
/* add uvs */
if (CustomData_number_of_layers(&result->ldata, CD_PROP_FLOAT2) < MAX_MTFACE) {
- gogd.mloopuvs = CustomData_add_layer(
- &result->ldata, CD_PROP_FLOAT2, CD_SET_DEFAULT, NULL, polys_num * 4);
+ gogd.mloopuvs = CustomData_add_layer_named(
+ &result->ldata, CD_PROP_FLOAT2, CD_SET_DEFAULT, NULL, polys_num * 4, "UVMap");
if (gogd.mloopuvs) { /* unlikely to fail */
gogd.ix = 1.0 / gogd.rx;
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 4d59d904405..623ff98fc0d 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
@@ -35,7 +35,7 @@ static Mesh *create_ico_sphere_mesh(const int subdivisions, const float radius)
bmesh_create_params.use_toolflags = true;
const BMAllocTemplate allocsize = {0, 0, 0, 0};
BMesh *bm = BM_mesh_create(&allocsize, &bmesh_create_params);
- BM_data_layer_add_named(bm, &bm->ldata, CD_PROP_FLOAT2, nullptr);
+ BM_data_layer_add_named(bm, &bm->ldata, CD_PROP_FLOAT2, "UVMap");
/* Make sure the associated bool layers exists as well.
* Normally this would be done when adding a UV layer via python
* or when copying from Mesh, but when we 'manually' create the UV layer
More information about the Bf-blender-cvs
mailing list