Cleanup: use more descriptive variable name for the data-mask
authorCampbell Barton <ideasman42@gmail.com>
Tue, 17 Mar 2020 00:04:50 +0000 (11:04 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 17 Mar 2020 00:04:50 +0000 (11:04 +1100)
Make it explicit this data mask is added to the default mask.

source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/crazyspace.c
source/blender/blenkernel/intern/mesh.c
source/blender/modifiers/intern/MOD_triangulate.c

index ae2f5231e25d0382549ad7a81cf901bbbf112144..f14b9a30d9950ac71d5970efe29975e4cedf0994 100644 (file)
@@ -87,7 +87,7 @@ struct Mesh *BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm,
 
 struct Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(
     struct BMEditMesh *em,
-    const struct CustomData_MeshMasks *data_mask,
+    const struct CustomData_MeshMasks *cd_mask_extra,
     float (*vertexCos)[3],
     const struct Mesh *me_settings);
 
index bdca888efcc6293e77accd099480e697432732b6..ac62bd52011e8248eed14fd90fa1fdc801a12ee3 100644 (file)
@@ -287,13 +287,13 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
     if (mti->type == eModifierTypeType_OnlyDeform && mti->deformMatricesEM) {
       if (!defmats) {
         const int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
-        CustomData_MeshMasks data_mask = CD_MASK_BAREMESH;
+        CustomData_MeshMasks cd_mask_extra = CD_MASK_BAREMESH;
         CDMaskLink *datamasks = modifiers_calcDataMasks(
-            scene, ob, md, &data_mask, required_mode, NULL, NULL);
-        data_mask = datamasks->mask;
+            scene, ob, md, &cd_mask_extra, required_mode, NULL, NULL);
+        cd_mask_extra = datamasks->mask;
         BLI_linklist_free((LinkNode *)datamasks, NULL);
 
-        me = BKE_mesh_from_editmesh_with_coords_thin_wrap(em, &data_mask, NULL, me_input);
+        me = BKE_mesh_from_editmesh_with_coords_thin_wrap(em, &cd_mask_extra, NULL, me_input);
         deformedVerts = editbmesh_vert_coords_alloc(em, &numVerts);
         defmats = MEM_mallocN(sizeof(*defmats) * numVerts, "defmats");
 
index 127acf0e46404aba8824e1ee21b1e8c04155b5f9..3a9a38288a7e60762a5ce30afe259c7cafacfd7e 100644 (file)
@@ -857,11 +857,11 @@ Mesh *BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm,
  * TODO(campbell): support mesh with only an edit-mesh which is lazy initialized.
  */
 Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(BMEditMesh *em,
-                                                   const CustomData_MeshMasks *data_mask,
+                                                   const CustomData_MeshMasks *cd_mask_extra,
                                                    float (*vertexCos)[3],
                                                    const Mesh *me_settings)
 {
-  Mesh *me = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, data_mask, me_settings);
+  Mesh *me = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, cd_mask_extra, me_settings);
   /* Use editmesh directly where possible. */
   me->runtime.is_original = true;
   if (vertexCos) {
index 7fba7e864ae16eb2bf2ef724c21a76996eb0f31f..94613353373780291b85954cddd5448c5a27e8b9 100644 (file)
@@ -44,7 +44,7 @@ static Mesh *triangulate_mesh(Mesh *mesh,
   BMesh *bm;
   int total_edges, i;
   MEdge *me;
-  CustomData_MeshMasks cddata_masks = {
+  CustomData_MeshMasks cd_mask_extra = {
       .vmask = CD_MASK_ORIGINDEX, .emask = CD_MASK_ORIGINDEX, .pmask = CD_MASK_ORIGINDEX};
 
   bool keep_clnors = (flag & MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS) != 0;
@@ -53,19 +53,19 @@ static Mesh *triangulate_mesh(Mesh *mesh,
     BKE_mesh_calc_normals_split(mesh);
     /* We need that one to 'survive' to/from BMesh conversions. */
     CustomData_clear_layer_flag(&mesh->ldata, CD_NORMAL, CD_FLAG_TEMPORARY);
-    cddata_masks.lmask |= CD_MASK_NORMAL;
+    cd_mask_extra.lmask |= CD_MASK_NORMAL;
   }
 
   bm = BKE_mesh_to_bmesh_ex(mesh,
                             &((struct BMeshCreateParams){0}),
                             &((struct BMeshFromMeshParams){
                                 .calc_face_normal = true,
-                                .cd_mask_extra = cddata_masks,
+                                .cd_mask_extra = cd_mask_extra,
                             }));
 
   BM_mesh_triangulate(bm, quad_method, ngon_method, min_vertices, false, NULL, NULL, NULL);
 
-  result = BKE_mesh_from_bmesh_for_eval_nomain(bm, &cddata_masks, mesh);
+  result = BKE_mesh_from_bmesh_for_eval_nomain(bm, &cd_mask_extra, mesh);
   BM_mesh_free(bm);
 
   if (keep_clnors) {