[Bf-blender-cvs] [87a80e89c21] refactor-mesh-uv-map-generic: Merge branch 'master' into refactor-mesh-uv-map-generic

Martijn Versteegh noreply at git.blender.org
Thu Sep 29 20:04:26 CEST 2022


Commit: 87a80e89c215db6587d26a06dfa14b13d354314b
Author: Martijn Versteegh
Date:   Thu Sep 29 19:56:37 2022 +0200
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB87a80e89c215db6587d26a06dfa14b13d354314b

Merge branch 'master' into refactor-mesh-uv-map-generic

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



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

diff --cc source/blender/blenkernel/BKE_customdata.h
index 21855e5957a,61f3a0e1d5e..f83144c6a60
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@@ -649,14 -615,11 +630,13 @@@ enum 
                       CD_SHAPEKEY, /* Not available as real CD layer in non-bmesh context. */
  
    /* Edges. */
-   CD_FAKE_SEAM = CD_FAKE | 100,         /* UV seam flag for edges. */
-   CD_FAKE_CREASE = CD_FAKE | CD_CREASE, /* *sigh*. */
+   CD_FAKE_SEAM = CD_FAKE | 100, /* UV seam flag for edges. */
  
    /* Multiple types of mesh elements... */
 -  CD_FAKE_UV = CD_FAKE |
 -               CD_MLOOPUV, /* UV flag, because we handle both loop's UVs and poly's textures. */
 +  CD_FAKE_BWEIGHT = CD_FAKE | CD_BWEIGHT, /* *sigh*. */
 +  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 --cc source/blender/blenkernel/BKE_mesh_legacy_convert.h
index a51eb06042e,92182f8045b..1cd15e66567
--- a/source/blender/blenkernel/BKE_mesh_legacy_convert.h
+++ b/source/blender/blenkernel/BKE_mesh_legacy_convert.h
@@@ -10,9 -10,7 +10,10 @@@
  #include "BLI_utildefines.h"
  
  #ifdef __cplusplus
 +#  include "BLI_array.hh"
 +#  include "BLI_resource_scope.hh"
 +#  include "BLI_vector.hh"
+ #  include "BLI_span.hh"
  #  include "DNA_customdata_types.h"
  #endif
  
@@@ -24,17 -22,27 +25,32 @@@ struct CustomData
  struct Mesh;
  struct MFace;
  
- #ifdef __cplusplus
- }
- #endif
- 
  #ifdef __cplusplus
  
 +void BKE_mesh_legacy_convert_uvs_to_struct(Mesh *mesh,
 +                                           blender::ResourceScope &temp_mloopuv_for_convert,
 +                                           blender::Vector<CustomDataLayer, 16> &layers_to_write);
 +void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh);
 +
+ /**
+  * Move face sets to the legacy type from a generic type.
+  */
+ void BKE_mesh_legacy_face_set_from_generic(
+     Mesh *mesh, blender::MutableSpan<CustomDataLayer> poly_layers_to_write);
+ /**
+  * Copy face sets to the generic data type from the legacy type.
+  */
+ void BKE_mesh_legacy_face_set_to_generic(struct Mesh *mesh);
+ 
+ /**
+  * Copy edge creases from a separate layer into edges.
+  */
+ void BKE_mesh_legacy_edge_crease_from_layers(struct Mesh *mesh);
+ /**
+  * Copy edge creases from edges to a separate layer.
+  */
+ void BKE_mesh_legacy_edge_crease_to_layers(struct Mesh *mesh);
+ 
  /**
   * Copy bevel weights from separate layers into vertices and edges.
   */
diff --cc source/blender/blenkernel/BKE_mesh_mapping.h
index 8d4613b2a1b,350c4c4bb36..39c16269503
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@@ -92,8 -97,9 +96,9 @@@ typedef struct MeshElemMap 
  /* mapping */
  UvVertMap *BKE_mesh_uv_vert_map_create(const struct MPoly *mpoly,
                                         const bool *hide_poly,
+                                        const bool *select_poly,
                                         const struct MLoop *mloop,
 -                                       const struct MLoopUV *mloopuv,
 +                                       const float (*mloopuv)[2],
                                         unsigned int totpoly,
                                         unsigned int totvert,
                                         const float limit[2],
diff --cc source/blender/blenkernel/intern/attribute_access.cc
index 45f4299ac3c,b86353bdb74..0b53774d449
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@@ -58,25 -58,8 +58,26 @@@ const char *no_procedural_access_messag
  
  bool allow_procedural_attribute_access(StringRef attribute_name)
  {
-   if (attribute_name.startswith(".selection")) {
 -  return !attribute_name.startswith(".sculpt") && !attribute_name.startswith(".select") &&
 -         !attribute_name.startswith(".hide");
++  if (attribute_name.startswith(".select")) {
 +    return false;
 +  }
 +  if (attribute_name.startswith(".sculpt")) {
 +    return false;
 +  }
 +  if (attribute_name.startswith(".hide")) {
 +    return false;
 +  }
 +  if (attribute_name.startswith("." UV_VERTSEL_NAME ".")) {
 +    return false;
 +  }
 +  if (attribute_name.startswith("." UV_EDGESEL_NAME ".")) {
 +    return false;
 +  }
 +  if (attribute_name.startswith("." UV_PINNED_NAME ".")) {
 +    return false;
 +  }
++
 +  return true;
  }
  
  static int attribute_data_type_complexity(const eCustomDataType data_type)
diff --cc source/blender/blenkernel/intern/customdata.cc
index 58b675627ac,4bbb9b62549..24c4d634f84
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@@ -2047,27 -2122,28 +2045,28 @@@ const CustomData_MeshMasks CD_MASK_BARE
  const CustomData_MeshMasks CD_MASK_MESH = {
      /* vmask */ (CD_MASK_MVERT | CD_MASK_MDEFORMVERT | CD_MASK_MVERT_SKIN | CD_MASK_PAINT_MASK |
                   CD_MASK_PROP_ALL | CD_MASK_CREASE | CD_MASK_BWEIGHT),
-     /* emask */ (CD_MASK_MEDGE | CD_MASK_FREESTYLE_EDGE | CD_MASK_PROP_ALL | CD_MASK_BWEIGHT),
+     /* emask */
+     (CD_MASK_MEDGE | CD_MASK_FREESTYLE_EDGE | CD_MASK_PROP_ALL | CD_MASK_BWEIGHT | CD_MASK_CREASE),
      /* fmask */ 0,
      /* pmask */
-     (CD_MASK_MPOLY | CD_MASK_FACEMAP | CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL |
-      CD_MASK_SCULPT_FACE_SETS),
+     (CD_MASK_MPOLY | CD_MASK_FACEMAP | CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL),
      /* 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 |
                   CD_MASK_PAINT_MASK | CD_MASK_ORCO | CD_MASK_CLOTH_ORCO | CD_MASK_PROP_ALL |
                   CD_MASK_CREASE | CD_MASK_BWEIGHT),
-     /* emask */ (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_EDGE | CD_MASK_BWEIGHT | CD_MASK_PROP_ALL),
+     /* emask */
+     (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_EDGE | CD_MASK_BWEIGHT | CD_MASK_PROP_ALL |
+      CD_MASK_CREASE),
      /* fmask */ (CD_MASK_ORIGINDEX | CD_MASK_ORIGSPACE | CD_MASK_PREVIEW_MCOL | CD_MASK_TANGENT),
      /* pmask */
-     (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL |
-      CD_MASK_SCULPT_FACE_SETS),
+     (CD_MASK_ORIGINDEX | CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL),
      /* 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 |
@@@ -2075,9 -2151,10 +2074,9 @@@
      /* emask */ (CD_MASK_BWEIGHT | CD_MASK_CREASE | CD_MASK_FREESTYLE_EDGE | CD_MASK_PROP_ALL),
      /* fmask */ 0,
      /* pmask */
-     (CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL | CD_MASK_SCULPT_FACE_SETS),
+     (CD_MASK_FREESTYLE_FACE | CD_MASK_FACEMAP | CD_MASK_PROP_ALL),
      /* 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 |
@@@ -2093,9 -2170,9 +2092,9 @@@
       CD_MASK_PROP_ALL),
      /* pmask */
      (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),
+      CD_MASK_FREESTYLE_FACE | CD_MASK_PROP_ALL),
      /* 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 --cc source/blender/blenkernel/intern/dynamicpaint.c
index 468fbcd9846,03358f50d40..96a9732fc5d
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@@ -1496,11 -1496,11 +1496,11 @@@ static void dynamic_paint_set_init_colo
  
    for (int j = 3; j--;) {
      TexResult texres = {0};
-     const unsigned int vert = mloop[mlooptri[i].tri[j]].v;
+     const uint vert = mloop[mlooptri[i].tri[j]].v;
  
      /* remap to [-1.0, 1.0] */
 -    uv[0] = mloopuv[mlooptri[i].tri[j]].uv[0] * 2.0f - 1.0f;
 -    uv[1] = mloopuv[mlooptri[i].tri[j]].uv[1] * 2.0f - 1.0f;
 +    uv[0] = mloopuv[mlooptri[i].tri[j]][0] * 2.0f - 1.0f;
 +    uv[1] = mloopuv[mlooptri[i].tri[j]][1] * 2.0f - 1.0f;
  
      multitex_ext_safe(tex, uv, &texres, pool, scene_color_manage, false);
  
@@@ -2511,9 -2510,9 +2511,9 @@@ static void dynamic_paint_find_island_b
  {
    const MLoop *mloop = data->mloop;
    const MLoopTri *mlooptri = data->mlooptri;
 -  const MLoopUV *mloopuv = data->mloopuv;
 +  const float(*mloopuv)[2] = data->mloopuv;
  
-   const unsigned int *loop_idx = mlooptri[tri_index].tri;
+   const uint *loop_idx = mlooptri[tri_index].tri;
  
    /* Enumerate all edges of the triangle, rotating the vertex list accordingly. */
    for (int edge_idx = 0; edge_idx < 3; edge_idx++) {
diff --cc source/blender/blenkernel/intern/geometry_component_mesh.cc
index 471c6a210d9,bf1dc1453c2..72dfd8f47f6
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@@ -894,14 -8

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list