[Bf-blender-cvs] [067fe443d83] master: Cleanup: consistent naming for normals

Campbell Barton noreply at git.blender.org
Sat Dec 17 03:16:00 CET 2022


Commit: 067fe443d8358d62dc570fde3327ca1d557a824c
Author: Campbell Barton
Date:   Sat Dec 17 12:47:43 2022 +1100
Branches: master
https://developer.blender.org/rB067fe443d8358d62dc570fde3327ca1d557a824c

Cleanup: consistent naming for normals

Use consistent naming for {vert/poly/loop/face}_normals.

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

M	source/blender/blenkernel/BKE_key.h
M	source/blender/blenkernel/BKE_mesh.h
M	source/blender/blenkernel/BKE_mesh_tangent.h
M	source/blender/blenkernel/BKE_shrinkwrap.h
M	source/blender/blenkernel/intern/key.cc
M	source/blender/blenkernel/intern/mesh.cc
M	source/blender/blenkernel/intern/mesh_iterators.cc
M	source/blender/blenkernel/intern/mesh_legacy_convert.cc
M	source/blender/blenkernel/intern/mesh_normals.cc
M	source/blender/blenkernel/intern/mesh_tangent.cc
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/shrinkwrap.cc
M	source/blender/draw/engines/overlay/overlay_edit_mesh.cc
M	source/blender/draw/intern/draw_cache_impl.h
M	source/blender/draw/intern/draw_cache_impl_mesh.cc
M	source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_pos_nor.cc
M	source/blender/editors/armature/meshlaplacian.c
M	source/blender/editors/mesh/editmesh_tools.c
M	source/blender/io/alembic/intern/abc_reader_mesh.cc
M	source/blender/makesrna/intern/rna_mesh_api.c
M	source/blender/modifiers/intern/MOD_normal_edit.cc
M	source/blender/modifiers/intern/MOD_weighted_normal.cc

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

diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index 6cae56b775f..813dc9aba34 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -139,15 +139,15 @@ void BKE_keyblock_convert_to_mesh(const struct KeyBlock *kb, struct MVert *mvert
  *
  * \param kb: the KeyBlock to use to compute normals.
  * \param mesh: the Mesh to apply key-block to.
- * \param r_vertnors: if non-NULL, an array of vectors, same length as number of vertices.
- * \param r_polynors: if non-NULL, an array of vectors, same length as number of polygons.
- * \param r_loopnors: if non-NULL, an array of vectors, same length as number of loops.
+ * \param r_vert_normals: if non-NULL, an array of vectors, same length as number of vertices.
+ * \param r_poly_normals: if non-NULL, an array of vectors, same length as number of polygons.
+ * \param r_loop_normals: if non-NULL, an array of vectors, same length as number of loops.
  */
 void BKE_keyblock_mesh_calc_normals(const struct KeyBlock *kb,
                                     const struct Mesh *mesh,
-                                    float (*r_vertnors)[3],
-                                    float (*r_polynors)[3],
-                                    float (*r_loopnors)[3]);
+                                    float (*r_vert_normals)[3],
+                                    float (*r_poly_normals)[3],
+                                    float (*r_loop_normals)[3]);
 
 void BKE_keyblock_update_from_vertcos(const struct Object *ob,
                                       struct KeyBlock *kb,
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 472c82c3a81..066d302fdd1 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -481,7 +481,7 @@ void BKE_edges_sharp_from_angle_set(struct MEdge *medges,
                                     const struct MLoop *mloops,
                                     int numLoops,
                                     const struct MPoly *mpolys,
-                                    const float (*polynors)[3],
+                                    const float (*poly_normals)[3],
                                     int numPolys,
                                     float split_angle);
 
@@ -603,10 +603,10 @@ void BKE_mesh_normals_loop_split(const struct MVert *mverts,
                                  const struct MEdge *medges,
                                  int numEdges,
                                  const struct MLoop *mloops,
-                                 float (*r_loopnors)[3],
+                                 float (*r_loop_normals)[3],
                                  int numLoops,
                                  const struct MPoly *mpolys,
-                                 const float (*polynors)[3],
+                                 const float (*poly_normals)[3],
                                  int numPolys,
                                  bool use_split_normals,
                                  float split_angle,
@@ -620,22 +620,22 @@ void BKE_mesh_normals_loop_custom_set(const struct MVert *mverts,
                                       struct MEdge *medges,
                                       int numEdges,
                                       const struct MLoop *mloops,
-                                      float (*r_custom_loopnors)[3],
+                                      float (*r_custom_loop_normals)[3],
                                       int numLoops,
                                       const struct MPoly *mpolys,
-                                      const float (*polynors)[3],
+                                      const float (*poly_normals)[3],
                                       int numPolys,
                                       short (*r_clnors_data)[2]);
 void BKE_mesh_normals_loop_custom_from_verts_set(const struct MVert *mverts,
                                                  const float (*vert_normals)[3],
-                                                 float (*r_custom_vertnors)[3],
+                                                 float (*r_custom_vert_normals)[3],
                                                  int numVerts,
                                                  struct MEdge *medges,
                                                  int numEdges,
                                                  const struct MLoop *mloops,
                                                  int numLoops,
                                                  const struct MPoly *mpolys,
-                                                 const float (*polynors)[3],
+                                                 const float (*poly_normals)[3],
                                                  int numPolys,
                                                  short (*r_clnors_data)[2]);
 
@@ -672,18 +672,18 @@ void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh,
  * Higher level functions hiding most of the code needed around call to
  * #BKE_mesh_normals_loop_custom_set().
  *
- * \param r_custom_loopnors: is not const, since code will replace zero_v3 normals there
+ * \param r_custom_loop_normals: is not const, since code will replace zero_v3 normals there
  * with automatically computed vectors.
  */
-void BKE_mesh_set_custom_normals(struct Mesh *mesh, float (*r_custom_loopnors)[3]);
+void BKE_mesh_set_custom_normals(struct Mesh *mesh, float (*r_custom_loop_normals)[3]);
 /**
  * Higher level functions hiding most of the code needed around call to
  * #BKE_mesh_normals_loop_custom_from_verts_set().
  *
- * \param r_custom_vertnors: is not const, since code will replace zero_v3 normals there
+ * \param r_custom_vert_normals: is not const, since code will replace zero_v3 normals there
  * with automatically computed vectors.
  */
-void BKE_mesh_set_custom_normals_from_verts(struct Mesh *mesh, float (*r_custom_vertnors)[3]);
+void BKE_mesh_set_custom_normals_from_verts(struct Mesh *mesh, float (*r_custom_vert_normals)[3]);
 
 /* *** mesh_evaluate.cc *** */
 
diff --git a/source/blender/blenkernel/BKE_mesh_tangent.h b/source/blender/blenkernel/BKE_mesh_tangent.h
index 58142653a90..b018ab978b2 100644
--- a/source/blender/blenkernel/BKE_mesh_tangent.h
+++ b/source/blender/blenkernel/BKE_mesh_tangent.h
@@ -21,7 +21,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const struct MVert *mverts,
                                           int numVerts,
                                           const struct MLoop *mloops,
                                           float (*r_looptangent)[4],
-                                          const float (*loopnors)[3],
+                                          const float (*loop_normals)[3],
                                           const struct MLoopUV *loopuv,
                                           int numLoops,
                                           const struct MPoly *mpolys,
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index 70065ab5961..b13a1cbd034 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -75,7 +75,7 @@ typedef struct ShrinkwrapTreeData {
 
   const struct MPoly *polys;
   const float (*vert_normals)[3];
-  const float (*pnors)[3];
+  const float (*poly_normals)[3];
   const float (*clnors)[3];
   ShrinkwrapBoundaryData *boundary;
 } ShrinkwrapTreeData;
diff --git a/source/blender/blenkernel/intern/key.cc b/source/blender/blenkernel/intern/key.cc
index 7db815e7f9d..c283ea828e8 100644
--- a/source/blender/blenkernel/intern/key.cc
+++ b/source/blender/blenkernel/intern/key.cc
@@ -2240,11 +2240,11 @@ void BKE_keyblock_convert_to_mesh(const KeyBlock *kb, MVert *mvert, const int to
 
 void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb,
                                     const Mesh *mesh,
-                                    float (*r_vertnors)[3],
-                                    float (*r_polynors)[3],
-                                    float (*r_loopnors)[3])
+                                    float (*r_vert_normals)[3],
+                                    float (*r_poly_normals)[3],
+                                    float (*r_loop_normals)[3])
 {
-  if (r_vertnors == nullptr && r_polynors == nullptr && r_loopnors == nullptr) {
+  if (r_vert_normals == nullptr && r_poly_normals == nullptr && r_loop_normals == nullptr) {
     return;
   }
 
@@ -2254,21 +2254,21 @@ void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb,
   const MPoly *polys = BKE_mesh_polys(mesh);
   const MLoop *loops = BKE_mesh_loops(mesh);
 
-  const bool loop_normals_needed = r_loopnors != nullptr;
-  const bool vert_normals_needed = r_vertnors != nullptr || loop_normals_needed;
-  const bool poly_normals_needed = r_polynors != nullptr || vert_normals_needed ||
+  const bool loop_normals_needed = r_loop_normals != nullptr;
+  const bool vert_normals_needed = r_vert_normals != nullptr || loop_normals_needed;
+  const bool poly_normals_needed = r_poly_normals != nullptr || vert_normals_needed ||
                                    loop_normals_needed;
 
-  float(*vert_normals)[3] = r_vertnors;
-  float(*poly_normals)[3] = r_polynors;
+  float(*vert_normals)[3] = r_vert_normals;
+  float(*poly_normals)[3] = r_poly_normals;
   bool free_vert_normals = false;
   bool free_poly_normals = false;
-  if (vert_normals_needed && r_vertnors == nullptr) {
+  if (vert_normals_needed && r_vert_normals == nullptr) {
     vert_normals = static_cast<float(*)[3]>(
         MEM_malloc_arrayN(mesh->totvert, sizeof(float[3]), __func__));
     free_vert_normals = true;
   }
-  if (poly_normals_needed && r_polynors == nullptr) {
+  if (poly_normals_needed && r_poly_normals == nullptr) {
     poly_normals = static_cast<float(*)[3]>(
         MEM_malloc_arrayN(mesh->totpoly, sizeof(float[3]), __func__));
     free_poly_normals = true;
@@ -2297,7 +2297,7 @@ void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb,
                                 edges,
                                 mesh->totedge,
                                 loops,
-                 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list