[Bf-blender-cvs] [6725eb9c40e] refactor-mesh-uv-map-generic: Cleanup and fix error in Cycles test

Hans Goudey noreply at git.blender.org
Sat Aug 27 01:28:07 CEST 2022


Commit: 6725eb9c40e50d21f053e02a6172f35016680563
Author: Hans Goudey
Date:   Fri Aug 26 18:27:59 2022 -0500
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB6725eb9c40e50d21f053e02a6172f35016680563

Cleanup and fix error in Cycles test

===================================================================

M	source/blender/blenkernel/intern/mesh_legacy_convert.cc
M	source/blender/blenkernel/intern/mesh_tangent.c
M	source/blender/makesrna/intern/rna_mesh.c

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc
index 4a1247401e3..5e0468075dc 100644
--- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc
@@ -1133,7 +1133,7 @@ void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh)
   CustomData_set_layer_render_index(
       &mesh->ldata,
       CD_PROP_FLOAT2,
-      CustomData_get_named_layer_index(&mesh->ldata, CD_PROP_FLOAT2, active_uv.c_str()));
+      CustomData_get_named_layer_index(&mesh->ldata, CD_PROP_FLOAT2, default_uv.c_str()));
 
   BKE_mesh_update_customdata_pointers(mesh, false);
 }
diff --git a/source/blender/blenkernel/intern/mesh_tangent.c b/source/blender/blenkernel/intern/mesh_tangent.c
index 11eedec8ee9..71713ccac31 100644
--- a/source/blender/blenkernel/intern/mesh_tangent.c
+++ b/source/blender/blenkernel/intern/mesh_tangent.c
@@ -316,8 +316,7 @@ static void dm_ts_GetTextureCoordinate(const SMikkTSpaceContext *pContext,
 
 finally:
   if (pMesh->mloopuv != NULL) {
-    const float *uv = pMesh->mloopuv[loop_index];
-    copy_v2_v2(r_uv, uv);
+    copy_v2_v2(r_uv, pMesh->mloopuv[loop_index]);
   }
   else {
     const float *orco = pMesh->orco[pMesh->mloop[loop_index].v];
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index b6118618ecb..f029f975967 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1454,10 +1454,12 @@ static char *rna_MeshUVLoop_path(const PointerRNA *ptr)
   return rna_LoopCustomData_data_path(ptr, "uv_layers", CD_PROP_FLOAT2);
 }
 
-static void get_uv_index_and_layer(PointerRNA *ptr, int *r_uv_map_index, int *r_index_in_attribute)
+static void get_uv_index_and_layer(const PointerRNA *ptr,
+                                   int *r_uv_map_index,
+                                   int *r_index_in_attribute)
 {
   const Mesh *mesh = rna_mesh(ptr);
-  const float(*uv_coord)[2] = (float(*)[2])ptr->data;
+  const float(*uv_coord)[2] = (const float(*)[2])ptr->data;
 
   /* We don't know from which attribute the RNA pointer is from, so we need to scan them all. */
   const int uv_layers_num = CustomData_number_of_layers(&mesh->ldata, CD_PROP_FLOAT2);



More information about the Bf-blender-cvs mailing list