[Bf-blender-cvs] [6f305577b34] master: Cleanup: use "num" as a suffix in: source/blender/modifiers

Campbell Barton noreply at git.blender.org
Mon Mar 28 05:42:13 CEST 2022


Commit: 6f305577b346030249bdb762f887136ff02624e3
Author: Campbell Barton
Date:   Mon Mar 28 12:29:47 2022 +1100
Branches: master
https://developer.blender.org/rB6f305577b346030249bdb762f887136ff02624e3

Cleanup: use "num" as a suffix in: source/blender/modifiers

Also rename DNA struct members.

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

M	source/blender/blenkernel/BKE_mesh.h
M	source/blender/blenkernel/intern/crazyspace.c
M	source/blender/blenkernel/intern/mesh_normals.cc
M	source/blender/blenkernel/intern/object.cc
M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/bmesh/intern/bmesh_mesh_convert.cc
M	source/blender/editors/armature/meshlaplacian.c
M	source/blender/editors/curve/editcurve.c
M	source/blender/editors/object/object_hook.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/makesdna/DNA_modifier_defaults.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/intern/dna_rename_defs.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_armature.c
M	source/blender/modifiers/intern/MOD_array.c
M	source/blender/modifiers/intern/MOD_build.c
M	source/blender/modifiers/intern/MOD_cast.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_correctivesmooth.c
M	source/blender/modifiers/intern/MOD_curve.c
M	source/blender/modifiers/intern/MOD_displace.c
M	source/blender/modifiers/intern/MOD_explode.c
M	source/blender/modifiers/intern/MOD_hook.c
M	source/blender/modifiers/intern/MOD_laplaciandeform.c
M	source/blender/modifiers/intern/MOD_laplaciansmooth.c
M	source/blender/modifiers/intern/MOD_lattice.c
M	source/blender/modifiers/intern/MOD_mask.cc
M	source/blender/modifiers/intern/MOD_meshcache.c
M	source/blender/modifiers/intern/MOD_meshcache_mdd.c
M	source/blender/modifiers/intern/MOD_meshcache_pc2.c
M	source/blender/modifiers/intern/MOD_meshdeform.c
M	source/blender/modifiers/intern/MOD_multires.c
M	source/blender/modifiers/intern/MOD_normal_edit.c
M	source/blender/modifiers/intern/MOD_ocean.c
M	source/blender/modifiers/intern/MOD_particlesystem.c
M	source/blender/modifiers/intern/MOD_shapekey.c
M	source/blender/modifiers/intern/MOD_shrinkwrap.c
M	source/blender/modifiers/intern/MOD_simpledeform.c
M	source/blender/modifiers/intern/MOD_skin.c
M	source/blender/modifiers/intern/MOD_smooth.c
M	source/blender/modifiers/intern/MOD_softbody.c
M	source/blender/modifiers/intern/MOD_solidify_extrude.c
M	source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
M	source/blender/modifiers/intern/MOD_subsurf.c
M	source/blender/modifiers/intern/MOD_surface.c
M	source/blender/modifiers/intern/MOD_surfacedeform.c
M	source/blender/modifiers/intern/MOD_triangulate.c
M	source/blender/modifiers/intern/MOD_util.c
M	source/blender/modifiers/intern/MOD_util.h
M	source/blender/modifiers/intern/MOD_uvproject.c
M	source/blender/modifiers/intern/MOD_uvwarp.c
M	source/blender/modifiers/intern/MOD_warp.c
M	source/blender/modifiers/intern/MOD_wave.c
M	source/blender/modifiers/intern/MOD_weighted_normal.c
M	source/blender/modifiers/intern/MOD_weightvg_util.c
M	source/blender/modifiers/intern/MOD_weightvgedit.c
M	source/blender/modifiers/intern/MOD_weightvgmix.c
M	source/blender/modifiers/intern/MOD_weightvgproximity.c

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

diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 0ba9713b96d..1ad20c52a4b 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -571,7 +571,7 @@ typedef struct MLoopNorSpaceArray {
   struct LinkNode
       *loops_pool; /* Allocated once, avoids to call BLI_linklist_prepend_arena() for each loop! */
   char data_type;  /* Whether we store loop indices, or pointers to BMLoop. */
-  int num_spaces;  /* Number of clnors spaces defined in this array. */
+  int spaces_num;  /* Number of clnors spaces defined in this array. */
   struct MemArena *mem;
 } MLoopNorSpaceArray;
 /**
diff --git a/source/blender/blenkernel/intern/crazyspace.c b/source/blender/blenkernel/intern/crazyspace.c
index 9d13bf3ac11..96389c44839 100644
--- a/source/blender/blenkernel/intern/crazyspace.c
+++ b/source/blender/blenkernel/intern/crazyspace.c
@@ -236,7 +236,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
   ModifierData *md;
   Mesh *me_input = ob->data;
   Mesh *me = NULL;
-  int i, a, numleft = 0, numVerts = 0;
+  int i, a, modifiers_left_num = 0, verts_num = 0;
   int cageIndex = BKE_modifiers_get_cage_index(scene, ob, NULL, 1);
   float(*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL;
   VirtualModifierData virtualModifierData;
@@ -266,14 +266,14 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
         BLI_linklist_free((LinkNode *)datamasks, NULL);
 
         me = BKE_mesh_wrapper_from_editmesh_with_coords(em, &cd_mask_extra, NULL, me_input);
-        deformedVerts = editbmesh_vert_coords_alloc(em, &numVerts);
-        defmats = MEM_mallocN(sizeof(*defmats) * numVerts, "defmats");
+        deformedVerts = editbmesh_vert_coords_alloc(em, &verts_num);
+        defmats = MEM_mallocN(sizeof(*defmats) * verts_num, "defmats");
 
-        for (a = 0; a < numVerts; a++) {
+        for (a = 0; a < verts_num; a++) {
           unit_m3(defmats[a]);
         }
       }
-      mti->deformMatricesEM(md, &mectx, em, me, deformedVerts, defmats, numVerts);
+      mti->deformMatricesEM(md, &mectx, em, me, deformedVerts, defmats, verts_num);
     }
     else {
       break;
@@ -283,7 +283,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
   for (; md && i <= cageIndex; md = md->next, i++) {
     if (editbmesh_modifier_is_enabled(scene, ob, md, me != NULL) &&
         BKE_modifier_is_correctable_deformed(md)) {
-      numleft++;
+      modifiers_left_num++;
     }
   }
 
@@ -294,7 +294,7 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
   *deformmats = defmats;
   *deformcos = deformedVerts;
 
-  return numleft;
+  return modifiers_left_num;
 }
 
 /**
@@ -319,13 +319,13 @@ static void crazyspace_init_verts_and_matrices(const Mesh *mesh,
                                                float (**deformmats)[3][3],
                                                float (**deformcos)[3])
 {
-  int num_verts;
-  *deformcos = BKE_mesh_vert_coords_alloc(mesh, &num_verts);
-  *deformmats = MEM_callocN(sizeof(**deformmats) * num_verts, "defmats");
-  for (int a = 0; a < num_verts; a++) {
+  int verts_num;
+  *deformcos = BKE_mesh_vert_coords_alloc(mesh, &verts_num);
+  *deformmats = MEM_callocN(sizeof(**deformmats) * verts_num, "defmats");
+  for (int a = 0; a < verts_num; a++) {
     unit_m3((*deformmats)[a]);
   }
-  BLI_assert(num_verts == mesh->totvert);
+  BLI_assert(verts_num == mesh->totvert);
 }
 
 static bool crazyspace_modifier_supports_deform_matrices(ModifierData *md)
@@ -352,7 +352,7 @@ int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
   ModifierData *md;
   Mesh *me_eval = NULL;
   float(*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL;
-  int numleft = 0;
+  int modifiers_left_num = 0;
   VirtualModifierData virtualModifierData;
   Object object_eval;
   crazyspace_init_object_for_eval(depsgraph, object, &object_eval);
@@ -364,7 +364,7 @@ int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
   if (is_sculpt_mode && has_multires) {
     *deformmats = NULL;
     *deformcos = NULL;
-    return numleft;
+    return modifiers_left_num;
   }
 
   md = BKE_modifiers_get_virtual_modifierlist(&object_eval, &virtualModifierData);
@@ -401,7 +401,7 @@ int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
     }
 
     if (crazyspace_modifier_supports_deform(md)) {
-      numleft++;
+      modifiers_left_num++;
     }
   }
 
@@ -412,7 +412,7 @@ int BKE_sculpt_get_first_deform_matrices(struct Depsgraph *depsgraph,
   *deformmats = defmats;
   *deformcos = deformedVerts;
 
-  return numleft;
+  return modifiers_left_num;
 }
 
 void BKE_crazyspace_build_sculpt(struct Depsgraph *depsgraph,
@@ -489,13 +489,13 @@ void BKE_crazyspace_build_sculpt(struct Depsgraph *depsgraph,
   }
 
   if (*deformmats == NULL) {
-    int a, numVerts;
+    int a, verts_num;
     Mesh *mesh = (Mesh *)object->data;
 
-    *deformcos = BKE_mesh_vert_coords_alloc(mesh, &numVerts);
-    *deformmats = MEM_callocN(sizeof(*(*deformmats)) * numVerts, "defmats");
+    *deformcos = BKE_mesh_vert_coords_alloc(mesh, &verts_num);
+    *deformmats = MEM_callocN(sizeof(*(*deformmats)) * verts_num, "defmats");
 
-    for (a = 0; a < numVerts; a++) {
+    for (a = 0; a < verts_num; a++) {
       unit_m3((*deformmats)[a]);
     }
   }
@@ -523,7 +523,7 @@ void BKE_crazyspace_api_eval(Depsgraph *depsgraph,
   }
 
   const Mesh *mesh = (const Mesh *)object->data;
-  object->runtime.crazyspace_num_verts = mesh->totvert;
+  object->runtime.crazyspace_verts_num = mesh->totvert;
   BKE_crazyspace_build_sculpt(depsgraph,
                               scene,
                               object,
@@ -537,12 +537,12 @@ void BKE_crazyspace_api_displacement_to_deformed(struct Object *object,
                                                  float displacement[3],
                                                  float r_displacement_deformed[3])
 {
-  if (vertex_index < 0 || vertex_index >= object->runtime.crazyspace_num_verts) {
+  if (vertex_index < 0 || vertex_index >= object->runtime.crazyspace_verts_num) {
     BKE_reportf(reports,
                 RPT_ERROR,
                 "Invalid vertex index %d (expected to be within 0 to %d range)",
                 vertex_index,
-                object->runtime.crazyspace_num_verts);
+                object->runtime.crazyspace_verts_num);
     return;
   }
 
@@ -557,12 +557,12 @@ void BKE_crazyspace_api_displacement_to_original(struct Object *object,
                                                  float displacement_deformed[3],
                                                  float r_displacement[3])
 {
-  if (vertex_index < 0 || vertex_index >= object->runtime.crazyspace_num_verts) {
+  if (vertex_index < 0 || vertex_index >= object->runtime.crazyspace_verts_num) {
     BKE_reportf(reports,
                 RPT_ERROR,
                 "Invalid vertex index %d (expected to be within 0 to %d range))",
                 vertex_index,
-                object->runtime.crazyspace_num_verts);
+                object->runtime.crazyspace_verts_num);
     return;
   }
 
diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc
index 4448bedb57a..ba1004e8371 100644
--- a/source/blender/blenkernel/intern/mesh_normals.cc
+++ b/source/blender/blenkernel/intern/mesh_normals.cc
@@ -532,7 +532,7 @@ void BKE_lnor_spacearr_init(MLoopNorSpaceArray *lnors_spacearr,
     lnors_spacearr->loops_pool = (LinkNode *)BLI_memarena_alloc(
         mem, sizeof(LinkNode) * (size_t)numLoops);
 
-    lnors_spacearr->num_spaces = 0;
+    lnors_spacearr->spaces_num = 0;
   }
   BLI_assert(ELEM(data_type, MLNOR_SPACEARR_BMLOOP_PTR, MLNOR_SPACEARR_LOOP_INDEX));
   lnors_spacearr->data_type = data_type;
@@ -550,7 +550,7 @@ void BKE_lnor_spacearr_tls_join(MLoopNorSpaceArray *lnors_spacearr,
 {
   BLI_assert(lnors_spacearr->data_type == lnors_spacearr_tls->data_type);
   BLI_assert(lnors_spacearr->mem != lnors_spacearr_tls->mem);
-  lnors_spacearr->num_spaces += lnors_spacearr_tls->num_spaces;
+  lnors_spacearr->spaces_num += lnors_spacearr_tls->spaces_num;
   BLI_memarena_merge(lnors_spacearr->mem, lnors_spacearr_tls->mem);
   BLI_memarena_free(lnors_spacearr_tls->mem);
   lnors_spacearr_tls->mem = nullptr;
@@ -559,7 +559,7 @@ void BKE_lnor_spacearr_tls_join(MLoopNorSpaceArray *lnors_spacearr,
 
 void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr)
 {
-  lnors_spacearr->num_spaces = 0;
+  lnors_spacearr->spaces_num = 0;
   lnors_spacearr->lspacearr = nullptr;
   lnors_spacearr->loops_pool = nullptr;
   if (lnors_spacearr->mem != nullptr) {
@@ -569,7 +569,7 @@ void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr)
 
 void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr)
 {
-  lnors_spacearr->num_spaces = 0;
+  lnors_spacearr->spaces_num = 0;
   lnors_spacearr->lspacearr = nullptr;
   lnors_spacearr->loops_pool = nullptr;
   BLI_memarena_free(lnors_spacearr->mem);
@@ -578,7 +578,7 @@ void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr)
 
 MLoopNorSpace *BKE_lnor_space_create(MLoopNorSpaceArray *lnors_spacearr)
 {
-  lnors_spacearr->num_spaces++;
+  lnors_spacearr->spaces_num++;
   return (MLoopNorSpace *)BLI_memarena_calloc(lnors_spacearr->mem, sizeof(MLoopNorSpace));
 }
 
diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc
index 098b7c52664..4714a79de58 100644
--- a/source/blender/blenkernel/intern/object.cc
+++ b/source/blender/blenkernel/intern/object.cc
@@ -766,7 +766,7 @@ static void object_blend_read_data(BlendDataReader *reader, ID *id)
     hmd->indexar = hook->indexar;
     hmd->object = hook->parent;
     memcpy(hmd->parentinv, hook->parentinv, sizeof(hmd->parentinv));
-    hmd->totindex = hook->totindex;
+    hmd->indexar_num = hook->totindex;
 
     BLI_addhead(&ob->modifiers, hmd);
     BLI_remlink(&ob->hooks, hook);
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index adc6b990869..37a6619876d 100644
--- a/source/blender/blenload

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list