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

Hans Goudey noreply at git.blender.org
Tue Jan 10 19:39:42 CET 2023


Commit: 3a81f0a978bf517ba56dd32f9a9c7f1413f05ce4
Author: Hans Goudey
Date:   Tue Jan 10 13:30:48 2023 -0500
Branches: refactor-mesh-corners-generic
https://developer.blender.org/rB3a81f0a978bf517ba56dd32f9a9c7f1413f05ce4

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

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



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

diff --cc source/blender/blenkernel/BKE_bvhutils.h
index a22c9fd976a,67b282ff2ad..d74af8effb3
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@@ -180,8 -180,8 +180,8 @@@ BVHTree *bvhtree_from_editmesh_looptri_
   * Builds a BVH-tree where nodes are the looptri faces of the given mesh.
   */
  BVHTree *bvhtree_from_mesh_looptri_ex(struct BVHTreeFromMesh *data,
-                                       const float (*positions)[3],
+                                       const float (*vert_positions)[3],
 -                                      const struct MLoop *mloop,
 +                                      const int *corner_verts,
                                        const struct MLoopTri *looptri,
                                        int looptri_num,
                                        const blender::BitVector<> &mask,
diff --cc source/blender/blenkernel/BKE_mesh_remap.h
index c62fa959893,7508821860c..f8768b19d57
--- a/source/blender/blenkernel/BKE_mesh_remap.h
+++ b/source/blender/blenkernel/BKE_mesh_remap.h
@@@ -221,8 -220,8 +221,8 @@@ void BKE_mesh_remap_calc_polys_from_mes
                                           float max_dist,
                                           float ray_radius,
                                           const struct Mesh *mesh_dst,
-                                          const float (*positions_dst)[3],
+                                          const float (*vert_positions_dst)[3],
 -                                         const struct MLoop *loops_dst,
 +                                         const int *corner_verts,
                                           const struct MPoly *polys_dst,
                                           int numpolys_dst,
                                           struct Mesh *me_src,
diff --cc source/blender/blenkernel/BKE_volume_to_mesh.hh
index 29a38d1934f,15e405a103d..33ff97b0fe9
--- a/source/blender/blenkernel/BKE_volume_to_mesh.hh
+++ b/source/blender/blenkernel/BKE_volume_to_mesh.hh
@@@ -62,9 -62,9 +62,9 @@@ void fill_mesh_from_openvdb_data(const 
                                   int vert_offset,
                                   int poly_offset,
                                   int loop_offset,
-                                  MutableSpan<float3> positions,
+                                  MutableSpan<float3> vert_positions,
                                   MutableSpan<MPoly> polys,
 -                                 MutableSpan<MLoop> loops);
 +                                 MutableSpan<int> corner_verts);
  
  #endif
  
diff --cc source/blender/blenkernel/intern/bvhutils.cc
index 15378b2aca3,fc1072d4cb8..e06dfa3b57c
--- a/source/blender/blenkernel/intern/bvhutils.cc
+++ b/source/blender/blenkernel/intern/bvhutils.cc
@@@ -1105,8 -1105,8 +1105,8 @@@ BVHTree *bvhtree_from_editmesh_looptri
  }
  
  BVHTree *bvhtree_from_mesh_looptri_ex(BVHTreeFromMesh *data,
-                                       const float (*positions)[3],
+                                       const float (*vert_positions)[3],
 -                                      const struct MLoop *mloop,
 +                                      const int *corner_verts,
                                        const struct MLoopTri *looptri,
                                        const int looptri_num,
                                        const BitVector<> &looptri_mask,
@@@ -1118,8 -1118,8 +1118,8 @@@
    BVHTree *tree = bvhtree_from_mesh_looptri_create_tree(epsilon,
                                                          tree_type,
                                                          axis,
-                                                         positions,
+                                                         vert_positions,
 -                                                        mloop,
 +                                                        corner_verts,
                                                          looptri,
                                                          looptri_num,
                                                          looptri_mask,
@@@ -1130,7 -1130,7 +1130,7 @@@
    if (data) {
      /* Setup BVHTreeFromMesh */
      bvhtree_from_mesh_setup_data(
-         tree, BVHTREE_FROM_LOOPTRI, positions, nullptr, nullptr, corner_verts, looptri, data);
 -        tree, BVHTREE_FROM_LOOPTRI, vert_positions, nullptr, nullptr, mloop, looptri, data);
++        tree, BVHTREE_FROM_LOOPTRI, vert_positions, nullptr, nullptr, corner_verts, looptri, data);
    }
  
    return tree;
diff --cc source/blender/blenkernel/intern/cdderivedmesh.c
index 6790f9ca956,7370ee6970a..2cdc840594f
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@@ -128,9 -121,9 +128,9 @@@ static void cdDM_recalc_looptri(Derived
    DM_ensure_looptri_data(dm);
    BLI_assert(totpoly == 0 || cddm->dm.looptris.array_wip != NULL);
  
 -  BKE_mesh_recalc_looptri(cddm->mloop,
 +  BKE_mesh_recalc_looptri(cddm->corner_verts,
                            cddm->mpoly,
-                           cddm->positions,
+                           cddm->vert_positions,
                            totloop,
                            totpoly,
                            cddm->dm.looptris.array_wip);
diff --cc source/blender/blenkernel/intern/dynamicpaint.c
index 31d1834b04b,9fbc95712c2..7857c78c295
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@@ -1774,9 -1774,9 +1774,9 @@@ typedef struct DynamicPaintModifierAppl
    const DynamicPaintSurface *surface;
    Object *ob;
  
-   float (*positions)[3];
+   float (*vert_positions)[3];
    const float (*vert_normals)[3];
 -  const MLoop *mloop;
 +  const int *corner_verts;
    const MPoly *mpoly;
  
    float (*fcolor)[4];
diff --cc source/blender/blenkernel/intern/fluid.c
index 3daa8327ee0,bd8acfe626f..091b73bde9f
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@@ -840,8 -840,8 +840,8 @@@ BLI_INLINE void apply_effector_fields(F
  }
  
  static void update_velocities(FluidEffectorSettings *fes,
-                               const float (*positions)[3],
+                               const float (*vert_positions)[3],
 -                              const MLoop *mloop,
 +                              const int *corner_verts,
                                const MLoopTri *mlooptri,
                                float *velocity_map,
                                int index,
@@@ -867,10 -867,11 +867,11 @@@
      int v1, v2, v3, f_index = nearest.index;
  
      /* Calculate barycentric weights for nearest point. */
 -    v1 = mloop[mlooptri[f_index].tri[0]].v;
 -    v2 = mloop[mlooptri[f_index].tri[1]].v;
 -    v3 = mloop[mlooptri[f_index].tri[2]].v;
 +    v1 = corner_verts[mlooptri[f_index].tri[0]];
 +    v2 = corner_verts[mlooptri[f_index].tri[1]];
 +    v3 = corner_verts[mlooptri[f_index].tri[2]];
-     interp_weights_tri_v3(weights, positions[v1], positions[v2], positions[v3], nearest.co);
+     interp_weights_tri_v3(
+         weights, vert_positions[v1], vert_positions[v2], vert_positions[v3], nearest.co);
  
      /* Apply object velocity. */
      float hit_vel[3];
@@@ -937,8 -938,8 +938,8 @@@
  typedef struct ObstaclesFromDMData {
    FluidEffectorSettings *fes;
  
-   const float (*positions)[3];
+   const float (*vert_positions)[3];
 -  const MLoop *mloop;
 +  const int *corner_verts;
    const MLoopTri *mlooptri;
  
    BVHTreeFromMesh *tree;
@@@ -972,8 -973,8 +973,8 @@@ static void obstacles_from_mesh_task_cb
  
        /* Calculate object velocities. Result in bb->velocity. */
        update_velocities(data->fes,
-                         data->positions,
+                         data->vert_positions,
 -                        data->mloop,
 +                        data->corner_verts,
                          data->mlooptri,
                          bb->velocity,
                          index,
@@@ -1070,8 -1071,8 +1071,8 @@@ static void obstacles_from_mesh(Object 
  
        ObstaclesFromDMData data = {
            .fes = fes,
-           .positions = positions,
+           .vert_positions = positions,
 -          .mloop = mloop,
 +          .corner_verts = corner_verts,
            .mlooptri = looptri,
            .tree = &tree_data,
            .bb = bb,
@@@ -1784,9 -1785,9 +1785,9 @@@ static void update_distances(int index
  }
  
  static void sample_mesh(FluidFlowSettings *ffs,
-                         const float (*positions)[3],
+                         const float (*vert_positions)[3],
                          const float (*vert_normals)[3],
 -                        const MLoop *mloop,
 +                        const int *corner_verts,
                          const MLoopTri *mlooptri,
                          const MLoopUV *mloopuv,
                          float *influence_map,
@@@ -1869,10 -1870,11 +1870,11 @@@
      float hit_normal[3];
  
      /* Calculate barycentric weights for nearest point. */
 -    v1 = mloop[mlooptri[f_index].tri[0]].v;
 -    v2 = mloop[mlooptri[f_index].tri[1]].v;
 -    v3 = mloop[mlooptri[f_index].tri[2]].v;
 +    v1 = corner_verts[mlooptri[f_index].tri[0]];
 +    v2 = corner_verts[mlooptri[f_index].tri[1]];
 +    v3 = corner_verts[mlooptri[f_index].tri[2]];
-     interp_weights_tri_v3(weights, positions[v1], positions[v2], positions[v3], nearest.co);
+     interp_weights_tri_v3(
+         weights, vert_positions[v1], vert_positions[v2], vert_positions[v3], nearest.co);
  
      /* Compute emission strength for smoke flow. */
      if (is_gas_flow) {
@@@ -1978,9 -1980,9 +1980,9 @@@ typedef struct EmitFromDMData 
    FluidDomainSettings *fds;
    FluidFlowSettings *ffs;
  
-   const float (*positions)[3];
+   const float (*vert_positions)[3];
    const float (*vert_normals)[3];
 -  const MLoop *mloop;
 +  const int *corner_verts;
    const MLoopTri *mlooptri;
    const MLoopUV *mloopuv;
    const MDeformVert *dvert;
@@@ -2012,9 -2014,9 +2014,9 @@@ static void emit_from_mesh_task_cb(voi
         * Result in bb->influence. Also computes initial velocities. Result in bb->velocity. */
        i

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list