diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-08 04:22:30 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-08 04:34:02 +0300 |
commit | c2c369ebe693456b7048b3908f342f5667e0fd03 (patch) | |
tree | 1f6f8258e5c04de52e371c21a358d00719373aca /source/blender/modifiers/intern | |
parent | c36c403cdb7e8a9d9c0b7aa1765e42fc0e9818d0 (diff) |
Cleanup: prefer terms verts/polys over vertices/polygons
Follows existing naming for the most part, also use "num" as a suffix
in some instances (following our naming conventions).
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.cc | 76 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshsequencecache.cc | 8 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 16 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weighted_normal.c | 26 |
5 files changed, 66 insertions, 66 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 42fe0107217..bcf1bd36539 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -482,7 +482,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, } /* About 67 million vertices max seems a decent limit for now. */ - const size_t max_vertices_num = 1 << 26; + const size_t max_verts_num = 1 << 26; /* calculate the maximum number of copies which will fit within the * prescribed length */ @@ -500,7 +500,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, * vertices. */ if (((size_t)count * (size_t)chunk_nverts + (size_t)start_cap_nverts + - (size_t)end_cap_nverts) > max_vertices_num) { + (size_t)end_cap_nverts) > max_verts_num) { count = 1; offset_is_too_small = true; } @@ -522,7 +522,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, * vertices. */ else if (((size_t)count * (size_t)chunk_nverts + (size_t)start_cap_nverts + - (size_t)end_cap_nverts) > max_vertices_num) { + (size_t)end_cap_nverts) > max_verts_num) { count = 1; BKE_modifier_set_error(ctx->object, &amd->modifier, diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index e0428042caa..b3ee6a1f4ca 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -143,9 +143,9 @@ static void invert_boolean_array(MutableSpan<bool> array) } } -static void compute_masked_vertices(Span<bool> vertex_mask, - MutableSpan<int> r_vertex_map, - uint *r_verts_masked_num) +static void compute_masked_verts(Span<bool> vertex_mask, + MutableSpan<int> r_vertex_map, + uint *r_verts_masked_num) { BLI_assert(vertex_mask.size() == r_vertex_map.size()); @@ -223,12 +223,12 @@ static void computed_masked_edges_smooth(const Mesh *mesh, *r_verts_add_num = verts_add_num; } -static void computed_masked_polygons(const Mesh *mesh, - Span<bool> vertex_mask, - Vector<int> &r_masked_poly_indices, - Vector<int> &r_loop_starts, - uint *r_polys_masked_num, - uint *r_loops_masked_num) +static void computed_masked_polys(const Mesh *mesh, + Span<bool> vertex_mask, + Vector<int> &r_masked_poly_indices, + Vector<int> &r_loop_starts, + uint *r_polys_masked_num, + uint *r_loops_masked_num) { BLI_assert(mesh->totvert == vertex_mask.size()); const Span<MPoly> polys = mesh->polys(); @@ -261,15 +261,15 @@ static void computed_masked_polygons(const Mesh *mesh, *r_loops_masked_num = loops_masked_num; } -static void compute_interpolated_polygons(const Mesh *mesh, - Span<bool> vertex_mask, - uint verts_add_num, - uint loops_masked_num, - Vector<int> &r_masked_poly_indices, - Vector<int> &r_loop_starts, - uint *r_edges_add_num, - uint *r_polys_add_num, - uint *r_loops_add_num) +static void compute_interpolated_polys(const Mesh *mesh, + Span<bool> vertex_mask, + uint verts_add_num, + uint loops_masked_num, + Vector<int> &r_masked_poly_indices, + Vector<int> &r_loop_starts, + uint *r_edges_add_num, + uint *r_polys_add_num, + uint *r_loops_add_num) { BLI_assert(mesh->totvert == vertex_mask.size()); @@ -333,9 +333,9 @@ static void compute_interpolated_polygons(const Mesh *mesh, *r_loops_add_num = loops_add_num; } -static void copy_masked_vertices_to_new_mesh(const Mesh &src_mesh, - Mesh &dst_mesh, - Span<int> vertex_map) +static void copy_masked_verts_to_new_mesh(const Mesh &src_mesh, + Mesh &dst_mesh, + Span<int> vertex_map) { BLI_assert(src_mesh.totvert == vertex_map.size()); const Span<MVert> src_verts = src_mesh.verts(); @@ -692,7 +692,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx) Array<int> vertex_map(mesh->totvert); uint verts_masked_num; - compute_masked_vertices(vertex_mask, vertex_map, &verts_masked_num); + compute_masked_verts(vertex_mask, vertex_map, &verts_masked_num); Array<int> edge_map(mesh->totedge); uint edges_masked_num; @@ -709,26 +709,26 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx) Vector<int> new_loop_starts; uint polys_masked_num; uint loops_masked_num; - computed_masked_polygons(mesh, - vertex_mask, - masked_poly_indices, - new_loop_starts, - &polys_masked_num, - &loops_masked_num); + computed_masked_polys(mesh, + vertex_mask, + masked_poly_indices, + new_loop_starts, + &polys_masked_num, + &loops_masked_num); uint edges_add_num = 0; uint polys_add_num = 0; uint loops_add_num = 0; if (use_interpolation) { - compute_interpolated_polygons(mesh, - vertex_mask, - verts_add_num, - loops_masked_num, - masked_poly_indices, - new_loop_starts, - &edges_add_num, - &polys_add_num, - &loops_add_num); + compute_interpolated_polys(mesh, + vertex_mask, + verts_add_num, + loops_masked_num, + masked_poly_indices, + new_loop_starts, + &edges_add_num, + &polys_add_num, + &loops_add_num); } Mesh *result = BKE_mesh_new_nomain_from_template(mesh, @@ -738,7 +738,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx) loops_masked_num + loops_add_num, polys_masked_num + polys_add_num); - copy_masked_vertices_to_new_mesh(*mesh, *result, vertex_map); + copy_masked_verts_to_new_mesh(*mesh, *result, vertex_map); if (use_interpolation) { add_interp_verts_copy_edges_to_new_mesh(*mesh, *result, diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.cc b/source/blender/modifiers/intern/MOD_meshsequencecache.cc index 1a41fa4cd3b..f30e6a95787 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.cc +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.cc @@ -181,15 +181,15 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * const Span<MVert> mesh_verts = mesh->verts(); const Span<MEdge> mesh_edges = mesh->edges(); const Span<MPoly> mesh_polys = mesh->polys(); - const Span<MVert> me_vertices = me->verts(); + const Span<MVert> me_verts = me->verts(); const Span<MEdge> me_edges = me->edges(); - const Span<MPoly> me_polygons = me->polys(); + const Span<MPoly> me_polys = me->polys(); /* TODO(sybren+bastien): possibly check relevant custom data layers (UV/color depending on * flags) and duplicate those too. * XXX(Hans): This probably isn't true anymore with various CoW improvements, etc. */ - if ((me_vertices.data() == mesh_verts.data()) || (me_edges.data() == mesh_edges.data()) || - (me_polygons.data() == mesh_polys.data())) { + if ((me_verts.data() == mesh_verts.data()) || (me_edges.data() == mesh_edges.data()) || + (me_polys.data() == mesh_polys.data())) { /* We need to duplicate data here, otherwise we'll modify org mesh, see T51701. */ mesh = reinterpret_cast<Mesh *>( BKE_id_copy_ex(nullptr, diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 9c6f7ff4069..d3b02659380 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -169,9 +169,9 @@ typedef struct GenerateOceanGeometryData { float ix, iy; } GenerateOceanGeometryData; -static void generate_ocean_geometry_vertices(void *__restrict userdata, - const int y, - const TaskParallelTLS *__restrict UNUSED(tls)) +static void generate_ocean_geometry_verts(void *__restrict userdata, + const int y, + const TaskParallelTLS *__restrict UNUSED(tls)) { GenerateOceanGeometryData *gogd = userdata; int x; @@ -185,9 +185,9 @@ static void generate_ocean_geometry_vertices(void *__restrict userdata, } } -static void generate_ocean_geometry_polygons(void *__restrict userdata, - const int y, - const TaskParallelTLS *__restrict UNUSED(tls)) +static void generate_ocean_geometry_polys(void *__restrict userdata, + const int y, + const TaskParallelTLS *__restrict UNUSED(tls)) { GenerateOceanGeometryData *gogd = userdata; int x; @@ -282,10 +282,10 @@ static Mesh *generate_ocean_geometry(OceanModifierData *omd, Mesh *mesh_orig, co settings.use_threading = use_threading; /* create vertices */ - BLI_task_parallel_range(0, gogd.res_y + 1, &gogd, generate_ocean_geometry_vertices, &settings); + BLI_task_parallel_range(0, gogd.res_y + 1, &gogd, generate_ocean_geometry_verts, &settings); /* create faces */ - BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_polygons, &settings); + BLI_task_parallel_range(0, gogd.res_y, &gogd, generate_ocean_geometry_polys, &settings); BKE_mesh_calc_edges(result, false, false); diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 05c6eea9f8b..ba441581770 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -362,7 +362,7 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, clnors); } else { - /* TODO: Ideally, we could add an option to BKE_mesh_normals_loop_custom_[from_vertices_]set() + /* TODO: Ideally, we could add an option to `BKE_mesh_normals_loop_custom_[from_verts_]set()` * to keep current clnors instead of resetting them to default auto-computed ones, * when given new custom normal is zero-vec. * But this is not exactly trivial change, better to keep this optimization for later... @@ -379,18 +379,18 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, copy_v3_v3(vert_normals[mv_index], items_data[mv_index].normal); } - BKE_mesh_normals_loop_custom_from_vertices_set(mvert, - wn_data->vert_normals, - vert_normals, - verts_num, - medge, - edges_num, - mloop, - loops_num, - mpoly, - polynors, - polys_num, - clnors); + BKE_mesh_normals_loop_custom_from_verts_set(mvert, + wn_data->vert_normals, + vert_normals, + verts_num, + medge, + edges_num, + mloop, + loops_num, + mpoly, + polynors, + polys_num, + clnors); MEM_freeN(vert_normals); } |