[Bf-blender-cvs] [39f498f350e] refactor-mesh-corners-generic: Merge branch 'refactor-mesh-position-generic' into refactor-mesh-corners-generic

Hans Goudey noreply at git.blender.org
Mon Jan 9 20:43:10 CET 2023


Commit: 39f498f350e4642094969ef81c59420c4225cb2b
Author: Hans Goudey
Date:   Mon Jan 9 14:42:02 2023 -0500
Branches: refactor-mesh-corners-generic
https://developer.blender.org/rB39f498f350e4642094969ef81c59420c4225cb2b

Merge branch 'refactor-mesh-position-generic' into refactor-mesh-corners-generic

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



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

diff --cc source/blender/blenkernel/BKE_bvhutils.h
index 087f1cf1b10,76a4015cc0c..a22c9fd976a
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@@ -58,10 -58,10 +58,10 @@@ typedef struct BVHTreeFromMesh 
    BVHTree_RayCastCallback raycast_callback;
  
    /* Vertex array, so that callbacks have instant access to data. */
-   const float (*positions)[3];
+   const float (*vert_positions)[3];
    const struct MEdge *edge;
    const struct MFace *face;
 -  const struct MLoop *loop;
 +  const int *corner_verts;
    const struct MLoopTri *looptri;
  
    /* Private data */
diff --cc source/blender/blenkernel/BKE_mesh.h
index fe131fed3c2,b2693f03685..e8384677132
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@@ -323,9 -323,9 +323,9 @@@ void BKE_mesh_vert_coords_apply(struct 
  /**
   * Calculate tessellation into #MLoopTri which exist only for this purpose.
   */
 -void BKE_mesh_recalc_looptri(const struct MLoop *mloop,
 +void BKE_mesh_recalc_looptri(const int *corner_verts,
                               const struct MPoly *mpoly,
-                              const float (*positions)[3],
+                              const float (*vert_positions)[3],
                               int totloop,
                               int totpoly,
                               struct MLoopTri *mlooptri);
@@@ -337,9 -337,9 +337,9 @@@
   * to calculate normals just to use this function as it will cause the normals for triangles
   * to be calculated which aren't needed for tessellation.
   */
 -void BKE_mesh_recalc_looptri_with_normals(const struct MLoop *mloop,
 +void BKE_mesh_recalc_looptri_with_normals(const int *corner_verts,
                                            const struct MPoly *mpoly,
-                                           const float (*positions)[3],
+                                           const float (*vert_positions)[3],
                                            int totloop,
                                            int totpoly,
                                            struct MLoopTri *mlooptri,
@@@ -420,8 -420,8 +420,8 @@@ bool BKE_mesh_vertex_normals_are_dirty(
  bool BKE_mesh_poly_normals_are_dirty(const struct Mesh *mesh);
  
  void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly,
 -                               const struct MLoop *loopstart,
 +                               const int *poly_verts,
-                                const float (*positions)[3],
+                                const float (*vert_positions)[3],
                                 float r_no[3]);
  
  /**
@@@ -430,9 -430,9 +430,9 @@@
   * \note Usually #BKE_mesh_poly_normals_ensure is the preferred way to access face normals,
   * since they may already be calculated and cached on the mesh.
   */
- void BKE_mesh_calc_normals_poly(const float (*positions)[3],
+ void BKE_mesh_calc_normals_poly(const float (*vert_positions)[3],
                                  int mvert_len,
 -                                const struct MLoop *mloop,
 +                                const int *corner_verts,
                                  int mloop_len,
                                  const struct MPoly *mpoly,
                                  int mpoly_len,
@@@ -444,9 -444,9 +444,9 @@@
   * \note Usually #BKE_mesh_vertex_normals_ensure is the preferred way to access vertex normals,
   * since they may already be calculated and cached on the mesh.
   */
- void BKE_mesh_calc_normals_poly_and_vertex(const float (*positions)[3],
+ void BKE_mesh_calc_normals_poly_and_vertex(const float (*vert_positions)[3],
                                             int mvert_len,
 -                                           const struct MLoop *mloop,
 +                                           const int *corner_verts,
                                             int mloop_len,
                                             const struct MPoly *mpoly,
                                             int mpoly_len,
@@@ -600,8 -599,7 +600,8 @@@ void BKE_mesh_normals_loop_split(const 
                                   int numVerts,
                                   const struct MEdge *medges,
                                   int numEdges,
-                                       const int *corner_verts,
-                                       const int *corner_edges,
 -                                 const struct MLoop *mloops,
++                                 const int *corner_verts,
++                                 const int *corner_edges,
                                   float (*r_loop_normals)[3],
                                   int numLoops,
                                   const struct MPoly *mpolys,
@@@ -689,18 -685,18 +689,18 @@@ void BKE_mesh_set_custom_normals_from_v
  /* *** mesh_evaluate.cc *** */
  
  void BKE_mesh_calc_poly_center(const struct MPoly *mpoly,
 -                               const struct MLoop *loopstart,
 +                               const int *poly_verts,
-                                const float (*positions)[3],
+                                const float (*vert_positions)[3],
                                 float r_cent[3]);
  /* 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 int *poly_verts,
-                               const float (*positions)[3]);
+                               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 int *poly_verts,
-                                const float (*positions)[3],
+                                const float (*vert_positions)[3],
                                 float angles[]);
  
  void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash,
diff --cc source/blender/blenkernel/BKE_mesh_sample.hh
index 2318f701f0e,191c5c57ee9..3f181d0ae28
--- a/source/blender/blenkernel/BKE_mesh_sample.hh
+++ b/source/blender/blenkernel/BKE_mesh_sample.hh
@@@ -127,8 -127,8 +127,8 @@@ int sample_surface_points_projected
      Vector<int> &r_looptri_indices,
      Vector<float3> &r_positions);
  
- float3 compute_bary_coord_in_triangle(Span<float3> positions,
+ float3 compute_bary_coord_in_triangle(Span<float3> vert_positions,
 -                                      Span<MLoop> loops,
 +                                      Span<int> corner_verts,
                                        const MLoopTri &looptri,
                                        const float3 &position);
  
diff --cc source/blender/blenkernel/BKE_mesh_tangent.h
index 95ca3d0aed2,cec98da5ef6..49e22cd55b6
--- a/source/blender/blenkernel/BKE_mesh_tangent.h
+++ b/source/blender/blenkernel/BKE_mesh_tangent.h
@@@ -17,9 -17,9 +17,9 @@@ struct ReportList
   * split normals can be used to recreate the full tangent space.
   * NOTE: * The mesh should be made of only tris and quads!
   */
- void BKE_mesh_calc_loop_tangent_single_ex(const float (*positions)[3],
+ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
                                            int numVerts,
 -                                          const struct MLoop *mloops,
 +                                          const int *corner_verts,
                                            float (*r_looptangent)[4],
                                            const float (*loop_normals)[3],
                                            const struct MLoopUV *loopuv,
@@@ -41,10 -41,10 +41,10 @@@ void BKE_mesh_calc_loop_tangent_single(
  /**
   * See: #BKE_editmesh_loop_tangent_calc (matching logic).
   */
- void BKE_mesh_calc_loop_tangent_ex(const float (*positions)[3],
+ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
                                     const struct MPoly *mpoly,
                                     uint mpoly_len,
 -                                   const struct MLoop *mloop,
 +                                   const int *corner_verts,
                                     const struct MLoopTri *looptri,
                                     uint looptri_len,
  
diff --cc source/blender/blenkernel/BKE_paint.h
index 590864d6710,55c89e2d6b1..74bf6e1059b
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -575,9 -576,9 +575,9 @@@ typedef struct SculptSession 
    struct Depsgraph *depsgraph;
  
    /* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */
-   float (*positions)[3];
+   float (*vert_positions)[3];
    const struct MPoly *mpoly;
 -  const struct MLoop *mloop;
 +  const int *corner_verts;
  
    /* These contain the vertex and poly counts of the final mesh. */
    int totvert, totpoly;
diff --cc source/blender/blenkernel/BKE_pbvh.h
index 266413c3d7d,3a482c915f4..3a361e19036
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@@ -264,8 -265,8 +264,8 @@@ PBVH *BKE_pbvh_new(PBVHType type)
  void BKE_pbvh_build_mesh(PBVH *pbvh,
                           struct Mesh *mesh,
                           const struct MPoly *mpoly,
 -                         const struct MLoop *mloop,
 +                         const int *corner_verts,
-                          float (*positions)[3],
+                          float (*vert_positions)[3],
                           int totvert,
                           struct CustomData *vdata,
                           struct CustomData *ldata,
diff --cc source/blender/blenkernel/intern/bvhutils.cc
index cb49abdb76c,791e19c8764..15378b2aca3
--- a/source/blender/blenkernel/intern/bvhutils.cc
+++ b/source/blender/blenkernel/intern/bvhutils.cc
@@@ -272,12 -272,12 +272,12 @@@ static void mesh_looptri_nearest_point(
                                         BVHTreeNearest *nearest)
  {
    const BVHTreeFromMesh *data = (

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list