[Bf-blender-cvs] [881b75a0c2b] refactor-mesh-position-generic: Add more vert prefixes
Hans Goudey
noreply at git.blender.org
Mon Jan 9 18:14:49 CET 2023
Commit: 881b75a0c2b9bc12738de095ed7a8f9a4b3de116
Author: Hans Goudey
Date: Mon Jan 9 12:14:43 2023 -0500
Branches: refactor-mesh-position-generic
https://developer.blender.org/rB881b75a0c2b9bc12738de095ed7a8f9a4b3de116
Add more vert prefixes
===================================================================
M source/blender/blenkernel/BKE_mesh.h
M source/blender/blenkernel/BKE_mesh_sample.hh
M source/blender/blenkernel/intern/mesh_evaluate.cc
M source/blender/blenkernel/intern/mesh_legacy_convert.cc
M source/blender/blenkernel/intern/mesh_normals.cc
M source/blender/blenkernel/intern/mesh_sample.cc
M source/blender/blenkernel/intern/mesh_tessellate.cc
M source/blender/draw/intern/mesh_extractors/extract_mesh.hh
M source/blender/io/alembic/intern/abc_customdata.h
M source/blender/modifiers/intern/MOD_multires.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 045ff6d6a99..b2693f03685 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -325,7 +325,7 @@ void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3]
*/
void BKE_mesh_recalc_looptri(const struct MLoop *mloop,
const struct MPoly *mpoly,
- const float (*positions)[3],
+ const float (*vert_positions)[3],
int totloop,
int totpoly,
struct MLoopTri *mlooptri);
@@ -339,7 +339,7 @@ void BKE_mesh_recalc_looptri(const struct MLoop *mloop,
*/
void BKE_mesh_recalc_looptri_with_normals(const struct MLoop *mloop,
const struct MPoly *mpoly,
- const float (*positions)[3],
+ const float (*vert_positions)[3],
int totloop,
int totpoly,
struct MLoopTri *mlooptri,
@@ -421,7 +421,7 @@ 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 float (*positions)[3],
+ const float (*vert_positions)[3],
float r_no[3]);
/**
@@ -430,7 +430,7 @@ void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly,
* \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,
int mloop_len,
@@ -444,7 +444,7 @@ void BKE_mesh_calc_normals_poly(const float (*positions)[3],
* \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,
int mloop_len,
@@ -594,7 +594,7 @@ void BKE_lnor_space_custom_normal_to_data(const MLoopNorSpace *lnor_space,
*
* \param loop_to_poly_map: Optional pre-created map from loops to their polygon.
*/
-void BKE_mesh_normals_loop_split(const float (*positions)[3],
+void BKE_mesh_normals_loop_split(const float (*vert_positions)[3],
const float (*vert_normals)[3],
int numVerts,
const struct MEdge *medges,
@@ -611,7 +611,7 @@ void BKE_mesh_normals_loop_split(const float (*positions)[3],
MLoopNorSpaceArray *r_lnors_spacearr,
short (*clnors_data)[2]);
-void BKE_mesh_normals_loop_custom_set(const float (*positions)[3],
+void BKE_mesh_normals_loop_custom_set(const float (*vert_positions)[3],
const float (*vert_normals)[3],
int numVerts,
struct MEdge *medges,
@@ -623,7 +623,7 @@ void BKE_mesh_normals_loop_custom_set(const float (*positions)[3],
const float (*poly_normals)[3],
int numPolys,
short (*r_clnors_data)[2]);
-void BKE_mesh_normals_loop_custom_from_verts_set(const float (*positions)[3],
+void BKE_mesh_normals_loop_custom_from_verts_set(const float (*vert_positions)[3],
const float (*vert_normals)[3],
float (*r_custom_vert_normals)[3],
int numVerts,
@@ -686,17 +686,17 @@ void BKE_mesh_set_custom_normals_from_verts(struct Mesh *mesh, float (*r_custom_
void BKE_mesh_calc_poly_center(const struct MPoly *mpoly,
const struct MLoop *loopstart,
- 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 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 float (*positions)[3],
+ const float (*vert_positions)[3],
float angles[]);
void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash,
@@ -885,7 +885,7 @@ bool BKE_mesh_validate_material_indices(struct Mesh *me);
* by importers that load normals (for example).
*/
bool BKE_mesh_validate_arrays(struct Mesh *me,
- float (*positions)[3],
+ float (*vert_positions)[3],
unsigned int totvert,
struct MEdge *medges,
unsigned int totedge,
@@ -1047,7 +1047,7 @@ BLI_INLINE MDeformVert *BKE_mesh_deform_verts_for_write(Mesh *mesh)
#ifdef __cplusplus
-# include "BLI_math_vec_types.hh"
+# include "BLI_math_vector_types.hh"
# include "BLI_span.hh"
inline blender::Span<blender::float3> Mesh::vert_positions() const
diff --git a/source/blender/blenkernel/BKE_mesh_sample.hh b/source/blender/blenkernel/BKE_mesh_sample.hh
index 47d9c13ff04..191c5c57ee9 100644
--- a/source/blender/blenkernel/BKE_mesh_sample.hh
+++ b/source/blender/blenkernel/BKE_mesh_sample.hh
@@ -127,7 +127,7 @@ 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,
const MLoopTri &looptri,
const float3 &position);
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc
index bcdc88cbe0f..93daaa00577 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.cc
+++ b/source/blender/blenkernel/intern/mesh_evaluate.cc
@@ -55,32 +55,35 @@ static void mesh_calc_ngon_center(const MPoly *mpoly,
void BKE_mesh_calc_poly_center(const MPoly *mpoly,
const MLoop *loopstart,
- const float (*positions)[3],
+ const float (*vert_positions)[3],
float r_cent[3])
{
if (mpoly->totloop == 3) {
- mid_v3_v3v3v3(
- r_cent, positions[loopstart[0].v], positions[loopstart[1].v], positions[loopstart[2].v]);
+ mid_v3_v3v3v3(r_cent,
+ vert_positions[loopstart[0].v],
+ vert_positions[loopstart[1].v],
+ vert_positions[loopstart[2].v]);
}
else if (mpoly->totloop == 4) {
mid_v3_v3v3v3v3(r_cent,
- positions[loopstart[0].v],
- positions[loopstart[1].v],
- positions[loopstart[2].v],
- positions[loopstart[3].v]);
+ vert_positions[loopstart[0].v],
+ vert_positions[loopstart[1].v],
+ vert_positions[loopstart[2].v],
+ vert_positions[loopstart[3].v]);
}
else {
- mesh_calc_ngon_center(mpoly, loopstart, positions, r_cent);
+ mesh_calc_ngon_center(mpoly, loopstart, vert_positions, r_cent);
}
}
float BKE_mesh_calc_poly_area(const MPoly *mpoly,
const MLoop *loopstart,
- const float (*positions)[3])
+ const float (*vert_positions)[3])
{
if (mpoly->totloop == 3) {
- return area_tri_v3(
- positions[loopstart[0].v], positions[loopstart[1].v], positions[loopstart[2].v]);
+ return area_tri_v3(vert_positions[loopstart[0].v],
+ vert_positions[loopstart[1].v],
+ vert_positions[loopstart[2].v]);
}
const MLoop *l_iter = loopstart;
@@ -88,7 +91,7 @@ float BKE_mesh_calc_poly_area(const MPoly *mpoly,
/* pack vertex cos into an array for area_poly_v3 */
for (int i = 0; i < mpoly->totloop; i++, l_iter++) {
- copy_v3_v3(vertexcos[i], positions[l_iter->v]);
+ copy_v3_v3(vertexcos[i], vert_positions[l_iter->v]);
}
/* finally calculate the area */
@@ -234,7 +237,7 @@ static float mesh_calc_poly_area_centroid(const MPoly *mpoly,
void BKE_mesh_calc_poly_angles(const MPoly *mpoly,
const MLoop *loopstart,
- const float (*positions)[3],
+ const float (*vert_positions)[3],
float angles[])
{
float nor_prev[3];
@@ -243,11 +246,13 @@ void BKE_mesh_calc_poly_angles(const MPoly *mpoly,
int i_this = mpoly->totloop - 1;
int i_next = 0;
- sub_v3_v3v3(nor_prev, positions[loopstart[i_this - 1].v], posit
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list