[Bf-blender-cvs] [466f4b7b44f] refactor-mesh-uv-map-generic: Add clarifying comment

Martijn Versteegh noreply at git.blender.org
Thu Jan 5 20:15:48 CET 2023


Commit: 466f4b7b44f5c6ddb912e8200edb84dc1988f042
Author: Martijn Versteegh
Date:   Thu Jan 5 20:15:40 2023 +0100
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB466f4b7b44f5c6ddb912e8200edb84dc1988f042

Add clarifying comment

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

M	source/blender/makesrna/intern/rna_mesh.c

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

diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 4a9518aad98..45c9f583060 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -1798,7 +1798,14 @@ static char *rna_MeshUVLoop_path(const PointerRNA *ptr)
 {
   return rna_LoopCustomData_data_path(ptr, "uv_layers", CD_PROP_FLOAT2);
 }
-
+/* The rna_MeshUVLoop_*_get/set() functions get passed a pointer to
+ * the (float2) uv attribute. This is for historical reasons because
+ * the api used to wrap MLoopUV, which contained the uv and all the selection
+ * pin states in a single struct. But since that struct no longer exists and
+ * we still can use only a single pointer to access these, we need to look up
+ * the original attribute layer and the index of the uv in it to be able to
+ * find the associated bool layers. So we scan the available foat2 layers
+ * to find into which layer the pointer we got passed points. */
 static bool get_uv_index_and_layer(const PointerRNA *ptr,
                                    int *r_uv_layer_index,
                                    int *r_index_in_attribute)



More information about the Bf-blender-cvs mailing list