[Bf-blender-cvs] [7905f3dbf77] refactor-mesh-uv-map-generic: Cleanup

Hans Goudey noreply at git.blender.org
Fri Aug 26 19:17:21 CEST 2022


Commit: 7905f3dbf77b7f1f1dfab90d72ac7d7730a5a80f
Author: Hans Goudey
Date:   Fri Aug 26 12:16:46 2022 -0500
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB7905f3dbf77b7f1f1dfab90d72ac7d7730a5a80f

Cleanup

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

M	source/blender/blenkernel/BKE_attribute.h
M	source/blender/blenkernel/BKE_customdata.h
M	source/blender/blenkernel/intern/attribute.cc
M	source/blender/blenkernel/intern/customdata.cc
M	source/blender/blenkernel/intern/mesh.cc
M	source/blender/blenkernel/intern/mesh_evaluate.cc
M	source/blender/blenkernel/intern/mesh_legacy_convert.cc
M	source/blender/blenkernel/intern/subdiv_mesh.cc
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/transform/transform_convert_mesh_uv.c
M	source/blender/editors/uvedit/uvedit_select.c
M	source/blender/io/alembic/intern/abc_customdata.cc
M	source/blender/io/collada/GeometryExporter.cpp
M	source/blender/io/collada/MeshImporter.cpp
M	source/blender/io/collada/MeshImporter.h
M	source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
M	source/blender/io/wavefront_obj/importer/obj_import_mesh.cc
M	source/blender/makesdna/DNA_meshdata_types.h
M	source/blender/makesrna/intern/rna_mesh.c
M	source/blender/python/bmesh/bmesh_py_types_customdata.c
M	source/blender/python/bmesh/bmesh_py_types_meshdata.c

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

diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h
index 3e2598a6c05..f8ff5f9b96e 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -100,11 +100,7 @@ CustomDataLayer *BKE_id_attribute_from_index(struct ID *id,
                                              eAttrDomainMask domain_mask,
                                              eCustomDataMask layer_mask);
 
-/**
- * Returns the index in the list of attributes of the same type on the same domain.
- * Note: this is *not* the CustomData layer index.
- * Layer is allowed to be nullptr; if so -1 (layer not found) will be returned.
- */
+/** Layer is allowed to be nullptr; if so -1 (layer not found) will be returned. */
 int BKE_id_attribute_to_index(const struct ID *id,
                               const CustomDataLayer *layer,
                               eAttrDomainMask domain_mask,
@@ -143,10 +139,6 @@ struct CustomDataLayer *BKE_id_attributes_color_find(const struct ID *id, const
 
 bool BKE_id_attribute_calc_unique_name(struct ID *id, const char *name, char *outname);
 
-UVMap_Data BKE_id_attributes_create_uvmap_layers(struct Mesh *mesh,
-                                                 char const *name,
-                                                 struct ReportList *reports,
-                                                 uint32_t needed_layer_flags);
 UVMap_Data BKE_id_attributes_ensure_uvmap_layers_index(struct Mesh *mesh,
                                                        int index_of_uvmap,
                                                        struct ReportList *reports,
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 6b77fa809b0..b4b485abfce 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -638,8 +638,9 @@ enum {
 
   /* Multiple types of mesh elements... */
   CD_FAKE_BWEIGHT = CD_FAKE | CD_BWEIGHT, /* *sigh*. */
-  CD_FAKE_UV = CD_FAKE |
-               CD_MLOOPUV, /* UV flag, because we handle both loop's UVs and poly's textures. */
+  CD_FAKE_UV =
+      CD_FAKE |
+      CD_PROP_FLOAT2, /* UV flag, because we handle both loop's UVs and poly's textures. */
 
   CD_FAKE_LNOR = CD_FAKE |
                  CD_CUSTOMLOOPNORMAL, /* Because we play with clnor and temp lnor layers here. */
diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc
index 94f34617822..be6fa051dd8 100644
--- a/source/blender/blenkernel/intern/attribute.cc
+++ b/source/blender/blenkernel/intern/attribute.cc
@@ -867,61 +867,6 @@ void BKE_id_attribute_copy_domains_temp(short id_type,
   *((short *)r_id->name) = id_type;
 }
 
-UVMap_Data BKE_id_attributes_create_uvmap_layers(Mesh *mesh,
-                                                 char const *name,
-                                                 ReportList *reports,
-                                                 uint32_t needed_layer_flags)
-{
-  using namespace blender::bke;
-  UVMap_Data data;
-
-  CustomDataLayer *uvlayer = BKE_id_attribute_new(
-      &mesh->id, name, CD_PROP_FLOAT2, ATTR_DOMAIN_CORNER, reports);
-
-  data.uv = (float(*)[2])uvlayer->data;
-
-  data.uv_index = attribute_to_layerindex(
-      &mesh->id, uvlayer, ATTR_DOMAIN_MASK_CORNER, CD_MASK_PROP_FLOAT2);
-
-  if (needed_layer_flags & MLOOPUV_VERTSEL) {
-    CustomDataLayer *layer = BKE_id_attribute_new(
-        &mesh->id,
-        uv_sublayer_name_vert_selection(uvlayer->name).c_str(),
-        CD_PROP_BOOL,
-        ATTR_DOMAIN_CORNER,
-        reports);
-    data.vertsel = static_cast<bool *>(layer->data);
-  }
-  else {
-    data.vertsel = nullptr;
-  }
-  if (needed_layer_flags & MLOOPUV_EDGESEL) {
-    CustomDataLayer *layer = BKE_id_attribute_new(
-        &mesh->id,
-        uv_sublayer_name_edge_selection(uvlayer->name).c_str(),
-        CD_PROP_BOOL,
-        ATTR_DOMAIN_CORNER,
-        reports);
-    data.edgesel = static_cast<bool *>(layer->data);
-  }
-  else {
-    data.edgesel = nullptr;
-  }
-  if (needed_layer_flags & MLOOPUV_PINNED) {
-    CustomDataLayer *layer = BKE_id_attribute_new(&mesh->id,
-                                                  uv_sublayer_name_pin(uvlayer->name).c_str(),
-                                                  CD_PROP_BOOL,
-                                                  ATTR_DOMAIN_CORNER,
-                                                  reports);
-    data.pinned = static_cast<bool *>(layer->data);
-  }
-  else {
-    data.pinned = nullptr;
-  }
-
-  return data;
-}
-
 UVMap_Data BKE_id_attributes_ensure_uvmap_layers_index(Mesh *mesh,
                                                        const int index_of_uvmap,
                                                        struct ReportList *reports,
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc
index b40c6dfc8bb..e81ab0e1562 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -2037,8 +2037,8 @@ const CustomData_MeshMasks CD_MASK_MESH = {
     (CD_MASK_MPOLY | CD_MASK_FACEMAP | CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL |
      CD_MASK_SCULPT_FACE_SETS),
     /* lmask */
-    (CD_MASK_MLOOP | CD_MASK_MDISPS | CD_MASK_MLOOPUV | CD_MASK_CUSTOMLOOPNORMAL |
-     CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
+    (CD_MASK_MLOOP | CD_MASK_MDISPS | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_GRID_PAINT_MASK |
+     CD_MASK_PROP_ALL),
 };
 const CustomData_MeshMasks CD_MASK_DERIVEDMESH = {
     /* vmask */ (CD_MASK_ORIGINDEX | CD_MASK_MDEFORMVERT | CD_MASK_SHAPEKEY | CD_MASK_MVERT_SKIN |
@@ -2050,8 +2050,8 @@ const CustomData_MeshMasks CD_MASK_DERIVEDMESH = {
     (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL |
      CD_MASK_SCULPT_FACE_SETS),
     /* lmask */
-    (CD_MASK_MLOOPUV | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_PREVIEW_MLOOPCOL |
-     CD_MASK_ORIGSPACE_MLOOP | CD_MASK_PROP_ALL), /* XXX MISSING CD_MASK_MLOOPTANGENT ? */
+    (CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_PREVIEW_MLOOPCOL | CD_MASK_ORIGSPACE_MLOOP |
+     CD_MASK_PROP_ALL), /* XXX MISSING CD_MASK_MLOOPTANGENT ? */
 };
 const CustomData_MeshMasks CD_MASK_BMESH = {
     /* vmask */ (CD_MASK_MDEFORMVERT | CD_MASK_BWEIGHT | CD_MASK_MVERT_SKIN | CD_MASK_SHAPEKEY |
@@ -2061,8 +2061,7 @@ const CustomData_MeshMasks CD_MASK_BMESH = {
     /* pmask */
     (CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL | CD_MASK_SCULPT_FACE_SETS),
     /* lmask */
-    (CD_MASK_MDISPS | CD_MASK_MLOOPUV | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_GRID_PAINT_MASK |
-     CD_MASK_PROP_ALL),
+    (CD_MASK_MDISPS | CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
 };
 const CustomData_MeshMasks CD_MASK_EVERYTHING = {
     /* vmask */ (CD_MASK_MVERT | CD_MASK_BM_ELEM_PYPTR | CD_MASK_ORIGINDEX | CD_MASK_MDEFORMVERT |
@@ -2080,7 +2079,7 @@ const CustomData_MeshMasks CD_MASK_EVERYTHING = {
     (CD_MASK_MPOLY | CD_MASK_BM_ELEM_PYPTR | CD_MASK_ORIGINDEX | CD_MASK_FACEMAP |
      CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL | CD_MASK_SCULPT_FACE_SETS),
     /* lmask */
-    (CD_MASK_MLOOP | CD_MASK_BM_ELEM_PYPTR | CD_MASK_MDISPS | CD_MASK_NORMAL | CD_MASK_MLOOPUV |
+    (CD_MASK_MLOOP | CD_MASK_BM_ELEM_PYPTR | CD_MASK_MDISPS | CD_MASK_NORMAL |
      CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_MLOOPTANGENT | CD_MASK_PREVIEW_MLOOPCOL |
      CD_MASK_ORIGSPACE_MLOOP | CD_MASK_GRID_PAINT_MASK | CD_MASK_PROP_ALL),
 };
diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc
index 66c21a90648..8df869584fc 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -464,8 +464,7 @@ static int customdata_compare(
   CustomDataLayer *l1, *l2;
   int layer_count1 = 0, layer_count2 = 0, j;
   const uint64_t cd_mask_non_generic = CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MPOLY |
-                                       CD_MASK_MLOOPUV | CD_MASK_PROP_BYTE_COLOR |
-                                       CD_MASK_MDEFORMVERT;
+                                       CD_MASK_PROP_BYTE_COLOR | CD_MASK_MDEFORMVERT;
   const uint64_t cd_mask_all_attr = CD_MASK_PROP_ALL | cd_mask_non_generic;
 
   for (int i = 0; i < c1->totlayer; i++) {
@@ -579,18 +578,6 @@ static int customdata_compare(
           }
           break;
         }
-        case CD_MLOOPUV: {
-          MLoopUV *lp1 = (MLoopUV *)l1->data;
-          MLoopUV *lp2 = (MLoopUV *)l2->data;
-          int ltot = m1->totloop;
-
-          for (j = 0; j < ltot; j++, lp1++, lp2++) {
-            if (len_squared_v2v2(lp1->uv, lp2->uv) > thresh_sq) {
-              return MESHCMP_LOOPUVMISMATCH;
-            }
-          }
-          break;
-        }
         case CD_PROP_BYTE_COLOR: {
           MLoopCol *lp1 = (MLoopCol *)l1->data;
           MLoopCol *lp2 = (MLoopCol *)l2->data;
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc
index fbd044766c9..324952cba99 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.cc
+++ b/source/blender/blenkernel/intern/mesh_evaluate.cc
@@ -20,7 +20,6 @@
 #include "BLI_edgehash.h"
 #include "BLI_index_range.hh"
 #include "BLI_math.h"
-#include "BLI_math_vec_types.hh"
 #include "BLI_span.hh"
 #include "BLI_utildefines.h"
 #include "BLI_virtual_array.hh"
diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc
index dd5f2eb60f3..0fb8a10c5d7 100644
--- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc
@@ -28,10 +28,6 @@
 #include "BKE_mesh_legacy_convert.h"
 #include "BKE_multires.h"
 
-using blender::Array;
-using blender::float2;
-using blender::Vector;
-
 /* -------------------------------------------------------------------- */
 /** \name NGon Tessellation (NGon to MFace Conversion)
  * \{ */
@@ -51,7 +47,8 @@ static void bm_corners_to_loops_ex(ID *id,
   for (int i = 0; i < numTex; i++) {
     const MTFace *texface = (const MTFace *)CustomData_get_n(fdata, 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list