[Bf-blender-cvs] [9b469a9c809] refactor-mesh-uv-map-generic: Merge branch 'master' into refactor-mesh-uv-map-generic
Hans Goudey
noreply at git.blender.org
Tue Jan 10 06:40:17 CET 2023
Commit: 9b469a9c809d71fcb04721f5f6058f2648cbeef5
Author: Hans Goudey
Date: Tue Jan 10 00:20:26 2023 -0500
Branches: refactor-mesh-uv-map-generic
https://developer.blender.org/rB9b469a9c809d71fcb04721f5f6058f2648cbeef5
Merge branch 'master' into refactor-mesh-uv-map-generic
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/properties_data_mesh.py
index b07792310c5,b7f7d925c2b..61027f68f19
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@@ -605,8 -605,9 +605,8 @@@ class DATA_PT_mesh_attributes(MeshButto
colliding_names = []
for collection in (
# Built-in names.
- {"position": None, "shade_smooth": None, "normal": None, "crease": None},
+ {"shade_smooth": None, "normal": None, "crease": None},
mesh.attributes,
- mesh.uv_layers,
None if ob is None else ob.vertex_groups,
):
if collection is None:
diff --cc source/blender/blenkernel/BKE_mesh.h
index a67905fb70e,cd291d4a42d..ffca4cff347
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@@ -36,8 -36,8 +36,7 @@@ struct MEdge
struct MFace;
struct MLoop;
struct MLoopTri;
-struct MLoopUV;
struct MPoly;
- struct MVert;
struct Main;
struct MemArena;
struct Mesh;
@@@ -693,11 -691,12 +690,11 @@@ void BKE_mesh_calc_poly_center(const st
/* NOTE: passing poly-normal is only a speedup so we can skip calculating it. */
float BKE_mesh_calc_poly_area(const struct MPoly *mpoly,
const struct MLoop *loopstart,
- const struct MVert *mvarray);
+ const float (*vert_positions)[3]);
float BKE_mesh_calc_area(const struct Mesh *me);
-float BKE_mesh_calc_poly_uv_area(const struct MPoly *mpoly, const struct MLoopUV *uv_array);
void BKE_mesh_calc_poly_angles(const struct MPoly *mpoly,
const struct MLoop *loopstart,
- const struct MVert *mvarray,
+ const float (*vert_positions)[3],
float angles[]);
void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash,
diff --cc source/blender/blenkernel/BKE_mesh_mapping.h
index 3e31c2f912f,b70e05ed14f..36ac0708629
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@@ -17,8 -17,8 +17,7 @@@ extern "C"
struct MEdge;
struct MLoop;
struct MLoopTri;
-struct MLoopUV;
struct MPoly;
- struct MVert;
/* UvVertMap */
#define STD_UV_CONNECT_LIMIT 0.0001f
diff --cc source/blender/blenkernel/intern/customdata.cc
index 4e34f835c4e,68b7fba63c7..1db7142a972
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@@ -2075,10 -2153,11 +2075,10 @@@ const CustomData_MeshMasks CD_MASK_BMES
/* pmask */
(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 |
+ /* vmask */ (CD_MASK_BM_ELEM_PYPTR | CD_MASK_ORIGINDEX | CD_MASK_MDEFORMVERT |
CD_MASK_BWEIGHT | CD_MASK_MVERT_SKIN | CD_MASK_ORCO | CD_MASK_CLOTH_ORCO |
CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_PAINT_MASK |
CD_MASK_PROP_ALL | CD_MASK_CREASE),
diff --cc source/blender/blenkernel/intern/mesh.cc
index bce8bb4f8ad,b35f5d6aa83..d2e61d37e44
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@@ -509,10 -483,11 +514,10 @@@ static bool is_uv_bool_sublayer(CustomD
static int customdata_compare(
CustomData *c1, CustomData *c2, const int total_length, Mesh *m1, Mesh *m2, const float thresh)
{
- const float thresh_sq = thresh * thresh;
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 |
- const uint64_t cd_mask_non_generic = CD_MASK_MEDGE | CD_MASK_MPOLY | CD_MASK_MLOOPUV |
-- CD_MASK_PROP_BYTE_COLOR | CD_MASK_MDEFORMVERT;
++ const uint64_t cd_mask_non_generic = CD_MASK_MEDGE | CD_MASK_MPOLY | CD_MASK_PROP_BYTE_COLOR |
++ CD_MASK_MDEFORMVERT;
const uint64_t cd_mask_all_attr = CD_MASK_PROP_ALL | cd_mask_non_generic;
const Span<MLoop> loops_1 = m1->loops();
const Span<MLoop> loops_2 = m2->loops();
diff --cc source/blender/blenkernel/intern/mesh_evaluate.cc
index f92eb5f5b72,c0b461e524e..629d9e89ed6
--- a/source/blender/blenkernel/intern/mesh_evaluate.cc
+++ b/source/blender/blenkernel/intern/mesh_evaluate.cc
@@@ -109,9 -114,27 +114,9 @@@ float BKE_mesh_calc_area(const Mesh *me
return total_area;
}
-float BKE_mesh_calc_poly_uv_area(const MPoly *mpoly, const MLoopUV *uv_array)
-{
-
- int i, l_iter = mpoly->loopstart;
- float area;
- float(*vertexcos)[2] = (float(*)[2])BLI_array_alloca(vertexcos, size_t(mpoly->totloop));
-
- /* pack vertex cos into an array for area_poly_v2 */
- for (i = 0; i < mpoly->totloop; i++, l_iter++) {
- copy_v2_v2(vertexcos[i], uv_array[l_iter].uv);
- }
-
- /* finally calculate the area */
- area = area_poly_v2(vertexcos, uint(mpoly->totloop));
-
- return area;
-}
-
static float UNUSED_FUNCTION(mesh_calc_poly_volume_centroid)(const MPoly *mpoly,
const MLoop *loopstart,
- const MVert *mvarray,
+ const float (*positions)[3],
float r_cent[3])
{
const float *v_pivot, *v_step1;
diff --cc source/blender/blenkernel/intern/mesh_mapping.cc
index c8963e524ea,0503e51da06..9028f6d51b3
--- a/source/blender/blenkernel/intern/mesh_mapping.cc
+++ b/source/blender/blenkernel/intern/mesh_mapping.cc
@@@ -1225,12 -1223,13 +1223,13 @@@ bool BKE_mesh_calc_islands_loop_poly_uv
const int totpoly,
MLoop *loops,
const int totloop,
- const MLoopUV *luvs,
+ const float (*luvs)[2],
MeshIslandStore *r_island_store)
{
+ UNUSED_VARS(vert_positions, totvert);
BLI_assert(luvs != nullptr);
return mesh_calc_islands_loop_poly_uv(
- verts, totvert, edges, totedge, polys, totpoly, loops, totloop, luvs, r_island_store);
+ edges, totedge, polys, totpoly, loops, totloop, luvs, r_island_store);
}
/** \} */
diff --cc source/blender/blenkernel/intern/mesh_tangent.cc
index 7c20ae8545e,4a9155914a3..35c7c1f40bc
--- a/source/blender/blenkernel/intern/mesh_tangent.cc
+++ b/source/blender/blenkernel/intern/mesh_tangent.cc
@@@ -72,8 -69,8 +72,8 @@@ struct BKEMeshToTangent
const MPoly *mpolys; /* faces */
const MLoop *mloops; /* faces vertices */
- const MVert *mverts; /* vertices */
+ const float (*positions)[3]; /* vertices */
- const MLoopUV *luvs; /* texture coordinates */
+ const float (*luvs)[2]; /* texture coordinates */
const float (*loop_normals)[3]; /* loops' normals */
float (*tangents)[4]; /* output tangents */
int num_polys; /* number of polygons */
@@@ -94,8 -91,8 +94,8 @@@ void BKE_mesh_calc_loop_tangent_single_
BKEMeshToTangent mesh_to_tangent;
mesh_to_tangent.mpolys = mpolys;
mesh_to_tangent.mloops = mloops;
- mesh_to_tangent.mverts = mverts;
+ mesh_to_tangent.positions = vert_positions;
- mesh_to_tangent.luvs = loopuvs;
+ mesh_to_tangent.luvs = loop_uvs;
mesh_to_tangent.loop_normals = loop_normals;
mesh_to_tangent.tangents = r_looptangent;
mesh_to_tangent.num_polys = numPolys;
@@@ -278,10 -275,10 +278,10 @@@ struct SGLSLMeshToTangent
const float (*precomputedFaceNormals)[3];
const float (*precomputedLoopNormals)[3];
const MLoopTri *looptri;
- const float2 *mloopuv; /* texture coordinates */
- const MPoly *mpoly; /* indices */
- const MLoop *mloop; /* indices */
- const MVert *mvert; /* vertex coordinates */
- const MLoopUV *mloopuv; /* texture coordinates */
++ const float2 *mloopuv; /* texture coordinates */
+ const MPoly *mpoly; /* indices */
+ const MLoop *mloop; /* indices */
+ const float (*positions)[3]; /* vertex coordinates */
const float (*vert_normals)[3];
const float (*orco)[3];
float (*tangent)[4]; /* destination */
diff --cc source/blender/blenkernel/intern/object_dupli.cc
index 0f3dc21e461,2db9c2c31c1..1660ffbd140
--- a/source/blender/blenkernel/intern/object_dupli.cc
+++ b/source/blender/blenkernel/intern/object_dupli.cc
@@@ -1057,9 -1060,9 +1061,9 @@@ struct FaceDupliData_Mesh
int totface;
const MPoly *mpoly;
const MLoop *mloop;
- const MVert *mvert;
+ Span<float3> positions;
const float (*orco)[3];
- const MLoopUV *mloopuv;
+ const float2 *mloopuv;
};
struct FaceDupliData_EditMesh {
@@@ -1207,9 -1210,8 +1211,8 @@@ static void make_child_duplis_faces_fro
FaceDupliData_Mesh *fdd = (FaceDupliData_Mesh *)userdata;
const MPoly *mpoly = fdd->mpoly, *mp;
const MLoop *mloop = fdd->mloop;
- const MVert *mvert = fdd->mvert;
const float(*orco)[3] = fdd->orco;
- const MLoopUV *mloopuv = fdd->mloopuv;
+ const float2 *mloopuv = fdd->mloopuv;
const int totface = fdd->totface;
const bool use_scale = fdd->params.use_scale;
int a;
@@@ -1313,9 -1322,9 +1323,9 @@@ static void make_duplis_faces(const Dup
fdd.totface = me_eval->totpoly;
fdd.mpoly = me_eval->polys().data();
fdd.mloop = me_eval->loops().data();
- fdd.mvert = me_eval->verts().data();
+ fdd.positions = me_eval->vert_positions();
- fdd.mloopuv = (uv_idx != -1) ? (const
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list