diff options
Diffstat (limited to 'source/blender')
52 files changed, 584 insertions, 596 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index a5b0e21f0ca..1048ca39958 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -665,18 +665,18 @@ void BKE_mesh_normals_loop_custom_set(const struct MVert *mverts, const float (*polynors)[3], int numPolys, short (*r_clnors_data)[2]); -void BKE_mesh_normals_loop_custom_from_vertices_set(const struct MVert *mverts, - const float (*vert_normals)[3], - float (*r_custom_vertnors)[3], - int numVerts, - struct MEdge *medges, - int numEdges, - const struct MLoop *mloops, - int numLoops, - const struct MPoly *mpolys, - const float (*polynors)[3], - int numPolys, - short (*r_clnors_data)[2]); +void BKE_mesh_normals_loop_custom_from_verts_set(const struct MVert *mverts, + const float (*vert_normals)[3], + float (*r_custom_vertnors)[3], + int numVerts, + struct MEdge *medges, + int numEdges, + const struct MLoop *mloops, + int numLoops, + const struct MPoly *mpolys, + const float (*polynors)[3], + int numPolys, + short (*r_clnors_data)[2]); /** * Computes average per-vertex normals from given custom loop normals. @@ -717,12 +717,12 @@ void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh, void BKE_mesh_set_custom_normals(struct Mesh *mesh, float (*r_custom_loopnors)[3]); /** * Higher level functions hiding most of the code needed around call to - * #BKE_mesh_normals_loop_custom_from_vertices_set(). + * #BKE_mesh_normals_loop_custom_from_verts_set(). * * \param r_custom_vertnors: is not const, since code will replace zero_v3 normals there * with automatically computed vectors. */ -void BKE_mesh_set_custom_normals_from_vertices(struct Mesh *mesh, float (*r_custom_vertnors)[3]); +void BKE_mesh_set_custom_normals_from_verts(struct Mesh *mesh, float (*r_custom_vertnors)[3]); /* *** mesh_evaluate.cc *** */ @@ -812,10 +812,10 @@ void BKE_mesh_polygon_flip(const struct MPoly *mpoly, * * \note Invalidates tessellation, caller must handle that. */ -void BKE_mesh_polygons_flip(const struct MPoly *mpoly, - struct MLoop *mloop, - struct CustomData *ldata, - int totpoly); +void BKE_mesh_polys_flip(const struct MPoly *mpoly, + struct MLoop *mloop, + struct CustomData *ldata, + int totpoly); /* Merge verts. */ /* Enum for merge_mode of #BKE_mesh_merge_verts. diff --git a/source/blender/blenkernel/BKE_mesh_fair.h b/source/blender/blenkernel/BKE_mesh_fair.h index 0dc44ecb247..9d94c692858 100644 --- a/source/blender/blenkernel/BKE_mesh_fair.h +++ b/source/blender/blenkernel/BKE_mesh_fair.h @@ -25,16 +25,16 @@ typedef enum eMeshFairingDepth { /* affect_vertices is used to define the fairing area. Indexed by vertex index, set to true when * the vertex should be modified by fairing. */ -void BKE_bmesh_prefair_and_fair_vertices(struct BMesh *bm, - bool *affect_vertices, - eMeshFairingDepth depth); +void BKE_bmesh_prefair_and_fair_verts(struct BMesh *bm, + bool *affect_verts, + eMeshFairingDepth depth); /* This function can optionally use the MVert coordinates of deform_mverts to read and write the * fairing result. When NULL, the function will use mesh->mverts directly. */ -void BKE_mesh_prefair_and_fair_vertices(struct Mesh *mesh, - struct MVert *deform_mverts, - bool *affect_vertices, - eMeshFairingDepth depth); +void BKE_mesh_prefair_and_fair_verts(struct Mesh *mesh, + struct MVert *deform_mverts, + bool *affect_verts, + eMeshFairingDepth depth); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 2197fa3af1e..9a067e761d7 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -402,7 +402,7 @@ typedef struct SculptBoundaryEditInfo { int original_vertex_i; /* How many steps were needed to reach this vertex from the boundary. */ - int num_propagation_steps; + int propagation_steps_num; /* Strength that is used to deform this vertex. */ float strength_factor; @@ -416,10 +416,10 @@ typedef struct SculptBoundaryPreviewEdge { typedef struct SculptBoundary { /* Vertex indices of the active boundary. */ - PBVHVertRef *vertices; - int *vertices_i; - int vertices_capacity; - int num_vertices; + PBVHVertRef *verts; + int *verts_i; + int verts_capacity; + int verts_num; /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into * account the length of all edges between them. Any vertex that is not in the boundary will have @@ -429,7 +429,7 @@ typedef struct SculptBoundary { /* Data for drawing the preview. */ SculptBoundaryPreviewEdge *edges; int edges_capacity; - int num_edges; + int edges_num; /* True if the boundary loops into itself. */ bool forms_loop; diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h index 8c9488b0b46..716ee7d2a21 100644 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@ -389,7 +389,7 @@ const struct CCGKey *BKE_pbvh_get_grid_key(const PBVH *pbvh); struct CCGElem **BKE_pbvh_get_grids(const PBVH *pbvh); BLI_bitmap **BKE_pbvh_get_grid_visibility(const PBVH *pbvh); -int BKE_pbvh_get_grid_num_vertices(const PBVH *pbvh); +int BKE_pbvh_get_grid_num_verts(const PBVH *pbvh); int BKE_pbvh_get_grid_num_faces(const PBVH *pbvh); /** diff --git a/source/blender/blenkernel/intern/mesh_boolean_convert.cc b/source/blender/blenkernel/intern/mesh_boolean_convert.cc index e37de1ae513..4201b03c1f7 100644 --- a/source/blender/blenkernel/intern/mesh_boolean_convert.cc +++ b/source/blender/blenkernel/intern/mesh_boolean_convert.cc @@ -609,7 +609,7 @@ static void copy_or_interp_loop_attributes(Mesh *dest_mesh, get_poly2d_cos(orig_me, orig_mp, cos_2d, mim.to_target_transform[orig_me_index], axis_mat); } CustomData *target_cd = &dest_mesh->ldata; - const Span<MVert> dst_vertices = dest_mesh->verts(); + const Span<MVert> dst_verts = dest_mesh->verts(); const Span<MLoop> dst_loops = dest_mesh->loops(); for (int i = 0; i < mp->totloop; ++i) { int loop_index = mp->loopstart + i; @@ -620,7 +620,7 @@ static void copy_or_interp_loop_attributes(Mesh *dest_mesh, * The coordinate needs to be projected into 2d, just like the interpolating polygon's * coordinates were. The `dest_mesh` coordinates are already in object 0 local space. */ float co[2]; - mul_v2_m3v3(co, axis_mat, dst_vertices[dst_loops[loop_index].v].co); + mul_v2_m3v3(co, axis_mat, dst_verts[dst_loops[loop_index].v].co); interp_weights_poly_v2(weights.data(), cos_2d, orig_mp->totloop, co); } for (int source_layer_i = 0; source_layer_i < source_cd->totlayer; ++source_layer_i) { @@ -723,10 +723,10 @@ static Mesh *imesh_to_mesh(IMesh *im, MeshesToIMeshInfo &mim) merge_vertex_loop_poly_customdata_layers(result, mim); /* Set the vertex coordinate values and other data. */ - MutableSpan<MVert> vertices = result->verts_for_write(); + MutableSpan<MVert> verts = result->verts_for_write(); for (int vi : im->vert_index_range()) { const Vert *v = im->vert(vi); - MVert *mv = &vertices[vi]; + MVert *mv = &verts[vi]; copy_v3fl_v3db(mv->co, v->co); if (v->orig != NO_INDEX) { const Mesh *orig_me; diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc index f2fe2e0b141..b1a70d5450c 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.cc +++ b/source/blender/blenkernel/intern/mesh_evaluate.cc @@ -717,7 +717,7 @@ void BKE_mesh_polygon_flip(const MPoly *mpoly, MLoop *mloop, CustomData *ldata) BKE_mesh_polygon_flip_ex(mpoly, mloop, ldata, nullptr, mdisp, true); } -void BKE_mesh_polygons_flip(const MPoly *mpoly, MLoop *mloop, CustomData *ldata, int totpoly) +void BKE_mesh_polys_flip(const MPoly *mpoly, MLoop *mloop, CustomData *ldata, int totpoly) { MDisps *mdisp = (MDisps *)CustomData_get_layer(ldata, CD_MDISPS); const MPoly *mp; diff --git a/source/blender/blenkernel/intern/mesh_fair.cc b/source/blender/blenkernel/intern/mesh_fair.cc index fe5add864ea..41dcb3501cc 100644 --- a/source/blender/blenkernel/intern/mesh_fair.cc +++ b/source/blender/blenkernel/intern/mesh_fair.cc @@ -76,13 +76,13 @@ class FairingContext { virtual ~FairingContext() = default; - void fair_vertices(bool *affected, - const eMeshFairingDepth depth, - VertexWeight *vertex_weight, - LoopWeight *loop_weight) + void fair_verts(bool *affected, + const eMeshFairingDepth depth, + VertexWeight *vertex_weight, + LoopWeight *loop_weight) { - fair_vertices_ex(affected, (int)depth, vertex_weight, loop_weight); + fair_verts_ex(affected, (int)depth, vertex_weight, loop_weight); } protected: @@ -143,28 +143,28 @@ class FairingContext { loop_weight); } - void fair_vertices_ex(const bool *affected, - const int order, - VertexWeight *vertex_weight, - LoopWeight *loop_weight) + void fair_verts_ex(const bool *affected, + const int order, + VertexWeight *vertex_weight, + LoopWeight *loop_weight) { Map<int, int> vert_col_map; - int num_affected_vertices = 0; + int affected_verts_num = 0; for (int i = 0; i < totvert_; i++) { if (!affected[i]) { continue; } - vert_col_map.add(i, num_affected_vertices); - num_affected_vertices++; + vert_col_map.add(i, affected_verts_num); + affected_verts_num++; } /* Early return, nothing to do. */ - if (ELEM(num_affected_vertices, 0, totvert_)) { + if (ELEM(affected_verts_num, 0, totvert_)) { return; } /* Setup fairing matrices */ - LinearSolver *solver = EIG_linear_solver_new(num_affected_vertices, num_affected_vertices, 3); + LinearSolver *solver = EIG_linear_solver_new(affected_verts_num, affected_verts_num, 3); for (auto item : vert_col_map.items()) { const int v = item.key; const int col = item.value; @@ -450,42 +450,40 @@ class UniformLoopWeight : public LoopWeight { } }; -static void prefair_and_fair_vertices(FairingContext *fairing_context, - bool *affected_vertices, - const eMeshFairingDepth depth) +static void prefair_and_fair_verts(FairingContext *fairing_context, + bool *affected_verts, + const eMeshFairingDepth depth) { /* Prefair. */ UniformVertexWeight *uniform_vertex_weights = new UniformVertexWeight(fairing_context); UniformLoopWeight *uniform_loop_weights = new UniformLoopWeight(); - fairing_context->fair_vertices( - affected_vertices, depth, uniform_vertex_weights, uniform_loop_weights); + fairing_context->fair_verts(affected_verts, depth, uniform_vertex_weights, uniform_loop_weights); delete uniform_vertex_weights; /* Fair. */ VoronoiVertexWeight *voronoi_vertex_weights = new VoronoiVertexWeight(fairing_context); /* TODO: Implement cotangent loop weights. */ - fairing_context->fair_vertices( - affected_vertices, depth, voronoi_vertex_weights, uniform_loop_weights); + fairing_context->fair_verts(affected_verts, depth, voronoi_vertex_weights, uniform_loop_weights); delete uniform_loop_weights; delete voronoi_vertex_weights; } -void BKE_mesh_prefair_and_fair_vertices(struct Mesh *mesh, - struct MVert *deform_mverts, - bool *affect_vertices, - const eMeshFairingDepth depth) +void BKE_mesh_prefair_and_fair_verts(struct Mesh *mesh, + struct MVert *deform_mverts, + bool *affect_verts, + const eMeshFairingDepth depth) { MeshFairingContext *fairing_context = new MeshFairingContext(mesh, deform_mverts); - prefair_and_fair_vertices(fairing_context, affect_vertices, depth); + prefair_and_fair_verts(fairing_context, affect_verts, depth); delete fairing_context; } -void BKE_bmesh_prefair_and_fair_vertices(struct BMesh *bm, - bool *affect_vertices, - const eMeshFairingDepth depth) +void BKE_bmesh_prefair_and_fair_verts(struct BMesh *bm, + bool *affect_verts, + const eMeshFairingDepth depth) { BMeshFairingContext *fairing_context = new BMeshFairingContext(bm); - prefair_and_fair_vertices(fairing_context, affect_vertices, depth); + prefair_and_fair_verts(fairing_context, affect_verts, depth); delete fairing_context; } diff --git a/source/blender/blenkernel/intern/mesh_merge.c b/source/blender/blenkernel/intern/mesh_merge.c index dc1ebf4c6e0..9c0e3c1bf59 100644 --- a/source/blender/blenkernel/intern/mesh_merge.c +++ b/source/blender/blenkernel/intern/mesh_merge.c @@ -354,11 +354,11 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, ml = src_loops + mp->loopstart; /* check faces with all vertices merged */ - bool all_vertices_merged = true; + bool all_verts_merged = true; for (j = 0; j < mp->totloop; j++, ml++) { if (vtargetmap[ml->v] == -1) { - all_vertices_merged = false; + all_verts_merged = false; /* This will be used to check for poly using several time the same vert. */ BLI_BITMAP_DISABLE(vert_tag, ml->v); } @@ -368,7 +368,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh, } } - if (UNLIKELY(all_vertices_merged)) { + if (UNLIKELY(all_verts_merged)) { if (merge_mode == MESH_MERGE_VERTS_DUMP_IF_MAPPED) { /* In this mode, all vertices merged is enough to dump face */ continue; diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc index a88ff4e9d90..21dd39586ec 100644 --- a/source/blender/blenkernel/intern/mesh_normals.cc +++ b/source/blender/blenkernel/intern/mesh_normals.cc @@ -2021,18 +2021,18 @@ void BKE_mesh_normals_loop_custom_set(const MVert *mverts, false); } -void BKE_mesh_normals_loop_custom_from_vertices_set(const MVert *mverts, - const float (*vert_normals)[3], - float (*r_custom_vertnors)[3], - const int numVerts, - MEdge *medges, - const int numEdges, - const MLoop *mloops, - const int numLoops, - const MPoly *mpolys, - const float (*polynors)[3], - const int numPolys, - short (*r_clnors_data)[2]) +void BKE_mesh_normals_loop_custom_from_verts_set(const MVert *mverts, + const float (*vert_normals)[3], + float (*r_custom_vertnors)[3], + const int numVerts, + MEdge *medges, + const int numEdges, + const MLoop *mloops, + const int numLoops, + const MPoly *mpolys, + const float (*polynors)[3], + const int numPolys, + short (*r_clnors_data)[2]) { mesh_normals_loop_custom_set(mverts, vert_normals, @@ -2087,7 +2087,7 @@ void BKE_mesh_set_custom_normals(Mesh *mesh, float (*r_custom_loopnors)[3]) mesh_set_custom_normals(mesh, r_custom_loopnors, false); } -void BKE_mesh_set_custom_normals_from_vertices(Mesh *mesh, float (*r_custom_vertnors)[3]) +void BKE_mesh_set_custom_normals_from_verts(Mesh *mesh, float (*r_custom_vertnors)[3]) { mesh_set_custom_normals(mesh, r_custom_vertnors, true); } diff --git a/source/blender/blenkernel/intern/multires_reshape_smooth.c b/source/blender/blenkernel/intern/multires_reshape_smooth.c index 97c85ae526c..e887f543dc5 100644 --- a/source/blender/blenkernel/intern/multires_reshape_smooth.c +++ b/source/blender/blenkernel/intern/multires_reshape_smooth.c @@ -354,10 +354,9 @@ static GridCoord *vertex_grid_coord_with_grid_index(const Vertex *vertex, const /* Get grid coordinates which correspond to corners of the given face. * All the grid coordinates will be from the same grid index. */ -static void grid_coords_from_face_vertices( - const MultiresReshapeSmoothContext *reshape_smooth_context, - const Face *face, - const GridCoord *grid_coords[]) +static void grid_coords_from_face_verts(const MultiresReshapeSmoothContext *reshape_smooth_context, + const Face *face, + const GridCoord *grid_coords[]) { BLI_assert(face->num_corners == 4); @@ -417,7 +416,7 @@ static void foreach_toplevel_grid_coord_task(void *__restrict userdata_v, const Face *face = &reshape_smooth_context->geometry.faces[face_index]; const GridCoord *face_grid_coords[4]; - grid_coords_from_face_vertices(reshape_smooth_context, face, face_grid_coords); + grid_coords_from_face_verts(reshape_smooth_context, face, face_grid_coords); for (int y = 0; y < inner_grid_size; ++y) { const float ptex_v = (float)y * inner_grid_size_1_inv; diff --git a/source/blender/blenkernel/intern/multires_unsubdivide.c b/source/blender/blenkernel/intern/multires_unsubdivide.c index 7884d6718af..9a0f7aa2126 100644 --- a/source/blender/blenkernel/intern/multires_unsubdivide.c +++ b/source/blender/blenkernel/intern/multires_unsubdivide.c @@ -161,7 +161,7 @@ static bool is_vertex_diagonal(BMVert *from_v, BMVert *to_v) */ static void unsubdivide_face_center_vertex_tag(BMesh *bm, BMVert *initial_vertex) { - bool *visited_vertices = MEM_calloc_arrayN(bm->totvert, sizeof(bool), "visited vertices"); + bool *visited_verts = MEM_calloc_arrayN(bm->totvert, sizeof(bool), "visited vertices"); GSQueue *queue; queue = BLI_gsqueue_new(sizeof(BMVert *)); @@ -177,7 +177,7 @@ static void unsubdivide_face_center_vertex_tag(BMesh *bm, BMVert *initial_vertex int neighbor_vertex_index = BM_elem_index_get(neighbor_v); if (neighbor_v != initial_vertex && is_vertex_diagonal(neighbor_v, initial_vertex)) { BLI_gsqueue_push(queue, &neighbor_v); - visited_vertices[neighbor_vertex_index] = true; + visited_verts[neighbor_vertex_index] = true; BM_elem_flag_set(neighbor_v, BM_ELEM_TAG, true); } } @@ -211,10 +211,10 @@ static void unsubdivide_face_center_vertex_tag(BMesh *bm, BMVert *initial_vertex BM_ITER_ELEM (f, &iter, diagonal_v, BM_FACES_OF_VERT) { BM_ITER_ELEM (neighbor_v, &iter_a, f, BM_VERTS_OF_FACE) { int neighbor_vertex_index = BM_elem_index_get(neighbor_v); - if (!visited_vertices[neighbor_vertex_index] && neighbor_v != diagonal_v && + if (!visited_verts[neighbor_vertex_index] && neighbor_v != diagonal_v && is_vertex_diagonal(neighbor_v, diagonal_v)) { BLI_gsqueue_push(queue, &neighbor_v); - visited_vertices[neighbor_vertex_index] = true; + visited_verts[neighbor_vertex_index] = true; BM_elem_flag_set(neighbor_v, BM_ELEM_TAG, true); } } @@ -224,7 +224,7 @@ static void unsubdivide_face_center_vertex_tag(BMesh *bm, BMVert *initial_vertex } BLI_gsqueue_free(queue); - MEM_freeN(visited_vertices); + MEM_freeN(visited_verts); } /** @@ -352,14 +352,14 @@ static bool unsubdivide_tag_disconnected_mesh_element(BMesh *bm, int *elem_id, i */ static int unsubdivide_init_elem_ids(BMesh *bm, int *elem_id) { - bool *visited_vertices = MEM_calloc_arrayN(bm->totvert, sizeof(bool), "visited vertices"); + bool *visited_verts = MEM_calloc_arrayN(bm->totvert, sizeof(bool), "visited vertices"); int current_id = 0; for (int i = 0; i < bm->totvert; i++) { - if (!visited_vertices[i]) { + if (!visited_verts[i]) { GSQueue *queue; queue = BLI_gsqueue_new(sizeof(BMVert *)); - visited_vertices[i] = true; + visited_verts[i] = true; elem_id[i] = current_id; BMVert *iv = BM_vert_at_index(bm, i); BLI_gsqueue_push(queue, &iv); @@ -372,8 +372,8 @@ static int unsubdivide_init_elem_ids(BMesh *bm, int *elem_id) BM_ITER_ELEM (ed, &iter, current_v, BM_EDGES_OF_VERT) { neighbor_v = BM_edge_other_vert(ed, current_v); const int neighbor_index = BM_elem_index_get(neighbor_v); - if (!visited_vertices[neighbor_index]) { - visited_vertices[neighbor_index] = true; + if (!visited_verts[neighbor_index]) { + visited_verts[neighbor_index] = true; elem_id[neighbor_index] = current_id; BLI_gsqueue_push(queue, &neighbor_v); } @@ -383,7 +383,7 @@ static int unsubdivide_init_elem_ids(BMesh *bm, int *elem_id) BLI_gsqueue_free(queue); } } - MEM_freeN(visited_vertices); + MEM_freeN(visited_verts); return current_id; } diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 73db00e7306..cb15dbef69d 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -1511,7 +1511,7 @@ void BKE_sculptsession_free(Object *ob) } if (ss->boundary_preview) { - MEM_SAFE_FREE(ss->boundary_preview->vertices); + MEM_SAFE_FREE(ss->boundary_preview->verts); MEM_SAFE_FREE(ss->boundary_preview->edges); MEM_SAFE_FREE(ss->boundary_preview->distance); MEM_SAFE_FREE(ss->boundary_preview->edit_info); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index ea058ba1dc5..7f4cded559c 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2120,8 +2120,8 @@ void psys_particle_on_dm(Mesh *mesh_final, const float(*vert_normals)[3] = BKE_mesh_vertex_normals_ensure(mesh_final); if (from == PART_FROM_VERT) { - const MVert *vertices = BKE_mesh_verts(mesh_final); - copy_v3_v3(vec, vertices[mapindex].co); + const MVert *verts = BKE_mesh_verts(mesh_final); + copy_v3_v3(vec, verts[mapindex].co); if (nor) { copy_v3_v3(nor, vert_normals[mapindex]); diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 1c6274ef35e..6d761f56f13 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1831,7 +1831,7 @@ BLI_bitmap **BKE_pbvh_get_grid_visibility(const PBVH *pbvh) return pbvh->grid_hidden; } -int BKE_pbvh_get_grid_num_vertices(const PBVH *pbvh) +int BKE_pbvh_get_grid_num_verts(const PBVH *pbvh) { BLI_assert(pbvh->header.type == PBVH_GRIDS); return pbvh->totgrid * pbvh->gridkey.grid_area; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 6ca598a3688..d1451353feb 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -2632,7 +2632,7 @@ static void springs_from_mesh(Object *ob) BodyPoint *bp; int a; float scale = 1.0f; - const MVert *vertices = BKE_mesh_verts(me); + const MVert *verts = BKE_mesh_verts(me); sb = ob->soft; if (me && sb) { @@ -2643,7 +2643,7 @@ static void springs_from_mesh(Object *ob) if (me->totvert) { bp = ob->soft->bpoint; for (a = 0; a < me->totvert; a++, bp++) { - copy_v3_v3(bp->origS, vertices[a].co); + copy_v3_v3(bp->origS, verts[a].co); mul_m4_v3(ob->obmat, bp->origS); } } @@ -2755,15 +2755,15 @@ static void mesh_faces_to_scratch(Object *ob) MLoopTri *looptri, *lt; BodyFace *bodyface; int a; - const MVert *vertices = BKE_mesh_verts(me); - const MPoly *polygons = BKE_mesh_polys(me); + const MVert *verts = BKE_mesh_verts(me); + const MPoly *polys = BKE_mesh_polys(me); const MLoop *loops = BKE_mesh_loops(me); /* Allocate and copy faces. */ sb->scratch->totface = poly_to_tri_count(me->totpoly, me->totloop); looptri = lt = MEM_mallocN(sizeof(*looptri) * sb->scratch->totface, __func__); - BKE_mesh_recalc_looptri(loops, polygons, vertices, me->totloop, me->totpoly, looptri); + BKE_mesh_recalc_looptri(loops, polys, verts, me->totloop, me->totpoly, looptri); bodyface = sb->scratch->bodyface = MEM_mallocN(sizeof(BodyFace) * sb->scratch->totface, "SB_body_Faces"); diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 11d75e0d8b8..9e5ef41892a 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -996,9 +996,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if ((key = blo_do_versions_newlibadr(fd, lib, me->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(me->totvert, key->refkey->totelem); - MVert *vertices = BKE_mesh_verts_for_write(me); + MVert *verts = BKE_mesh_verts_for_write(me); for (a = 0; a < tot; a++, data += 3) { - copy_v3_v3(vertices[a].co, data); + copy_v3_v3(verts[a].co, data); } } } diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 4e985843123..6e317201424 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -807,15 +807,15 @@ struct DRWCacheBuildingContext { }; static bool draw_subdiv_topology_info_cb(const SubdivForeachContext *foreach_context, - const int num_vertices, + const int num_verts, const int num_edges, const int num_loops, - const int num_polygons, + const int num_polys, const int *subdiv_polygon_offset) { /* num_loops does not take into account meshes with only loose geometry, which might be meshes - * used as custom bone shapes, so let's check the num_vertices also. */ - if (num_vertices == 0 && num_loops == 0) { + * used as custom bone shapes, so let's check the num_verts also. */ + if (num_verts == 0 && num_loops == 0) { return false; } @@ -826,12 +826,12 @@ static bool draw_subdiv_topology_info_cb(const SubdivForeachContext *foreach_con if (num_loops != 0) { cache->num_subdiv_edges = (uint)num_edges; cache->num_subdiv_loops = (uint)num_loops; - cache->num_subdiv_verts = (uint)num_vertices; - cache->num_subdiv_quads = (uint)num_polygons; + cache->num_subdiv_verts = (uint)num_verts; + cache->num_subdiv_quads = (uint)num_polys; cache->subdiv_polygon_offset = static_cast<int *>(MEM_dupallocN(subdiv_polygon_offset)); } - cache->may_have_loose_geom = num_vertices != 0 || num_edges != 0; + cache->may_have_loose_geom = num_verts != 0 || num_edges != 0; /* Initialize cache buffers, prefer dynamic usage so we can reuse memory on the host even after * it was sent to the device, since we may use the data while building other buffers on the CPU @@ -882,7 +882,7 @@ static bool draw_subdiv_topology_info_cb(const SubdivForeachContext *foreach_con if (cache->num_subdiv_verts) { ctx->vert_origindex_map = static_cast<int *>( MEM_mallocN(cache->num_subdiv_verts * sizeof(int), "subdiv_vert_origindex_map")); - for (int i = 0; i < num_vertices; i++) { + for (int i = 0; i < num_verts; i++) { ctx->vert_origindex_map[i] = -1; } } diff --git a/source/blender/editors/mesh/editface.cc b/source/blender/editors/mesh/editface.cc index 26184acc8b4..68a30b0cd77 100644 --- a/source/blender/editors/mesh/editface.cc +++ b/source/blender/editors/mesh/editface.cc @@ -494,21 +494,21 @@ void paintvert_flush_flags(Object *ob) index_array = (const int *)CustomData_get_layer(&me_eval->vdata, CD_ORIGINDEX); - const Span<MVert> vertices = me->verts_for_write(); - MutableSpan<MVert> vertices_eval = me_eval->verts_for_write(); + const Span<MVert> verts = me->verts_for_write(); + MutableSpan<MVert> verts_eval = me_eval->verts_for_write(); if (index_array) { int orig_index; - for (const int i : vertices_eval.index_range()) { + for (const int i : verts_eval.index_range()) { orig_index = index_array[i]; if (orig_index != ORIGINDEX_NONE) { - vertices_eval[i].flag = vertices[index_array[i]].flag; + verts_eval[i].flag = verts[index_array[i]].flag; } } } else { - for (const int i : vertices_eval.index_range()) { - vertices_eval[i].flag = vertices[i].flag; + for (const int i : verts_eval.index_range()) { + verts_eval[i].flag = verts[i].flag; } } diff --git a/source/blender/editors/mesh/editmesh_extrude_screw.c b/source/blender/editors/mesh/editmesh_extrude_screw.c index cc493cab0f9..5addd67ab58 100644 --- a/source/blender/editors/mesh/editmesh_extrude_screw.c +++ b/source/blender/editors/mesh/editmesh_extrude_screw.c @@ -41,7 +41,7 @@ static int edbm_screw_exec(bContext *C, wmOperator *op) int valence; uint objects_empty_len = 0; uint failed_axis_len = 0; - uint failed_vertices_len = 0; + uint failed_verts_len = 0; turns = RNA_int_get(op->ptr, "turns"); steps = RNA_int_get(op->ptr, "steps"); @@ -97,7 +97,7 @@ static int edbm_screw_exec(bContext *C, wmOperator *op) } if (v1 == NULL || v2 == NULL) { - failed_vertices_len++; + failed_verts_len++; continue; } @@ -151,7 +151,7 @@ static int edbm_screw_exec(bContext *C, wmOperator *op) if (failed_axis_len == objects_len - objects_empty_len) { BKE_report(op->reports, RPT_ERROR, "Invalid/unset axis"); } - else if (failed_vertices_len == objects_len - objects_empty_len) { + else if (failed_verts_len == objects_len - objects_empty_len) { BKE_report(op->reports, RPT_ERROR, "You have to select a string of connected vertices too"); } diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index c93d7dc3ee5..09489c50e9d 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -131,8 +131,8 @@ static int voxel_remesh_exec(bContext *C, wmOperator *op) } /* Output mesh will be all smooth or all flat shading. */ - const Span<MPoly> polygons = mesh->polys(); - const bool smooth_normals = polygons.first().flag & ME_SMOOTH; + const Span<MPoly> polys = mesh->polys(); + const bool smooth_normals = polys.first().flag & ME_SMOOTH; float isovalue = 0.0f; if (mesh->flag & ME_REMESH_REPROJECT_VOLUME) { diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc index 006ceb5f136..8f11774a16b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc @@ -186,7 +186,7 @@ static IndexMask get_selected_indices(const Mesh &mesh, return IndexMask(attributes.domain_size(domain)); } -static void face_corner_color_equalize_vertices(Mesh &mesh, const IndexMask selection) +static void face_corner_color_equalize_verts(Mesh &mesh, const IndexMask selection) { using namespace blender; @@ -221,7 +221,7 @@ static bool vertex_color_smooth(Object *ob) Vector<int64_t> indices; const IndexMask selection = get_selected_indices(*me, ATTR_DOMAIN_CORNER, indices); - face_corner_color_equalize_vertices(*me, selection); + face_corner_color_equalize_verts(*me, selection); tag_object_after_update(ob); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 5a17d42468e..51ff064c58d 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -116,7 +116,7 @@ int SCULPT_vertex_count_get(SculptSession *ss) case PBVH_BMESH: return BM_mesh_elem_count(BKE_pbvh_get_bmesh(ss->pbvh), BM_VERT); case PBVH_GRIDS: - return BKE_pbvh_get_grid_num_vertices(ss->pbvh); + return BKE_pbvh_get_grid_num_verts(ss->pbvh); } return 0; @@ -562,7 +562,7 @@ bool SCULPT_vertex_has_face_set(SculptSession *ss, PBVHVertRef vertex, int face_ return true; } -void SCULPT_visibility_sync_all_face_sets_to_vertices(Object *ob) +void SCULPT_visibility_sync_all_face_sets_to_verts(Object *ob) { SculptSession *ss = ob->sculpt; Mesh *mesh = BKE_object_get_original_mesh(ob); @@ -1102,7 +1102,7 @@ void SCULPT_floodfill_init(SculptSession *ss, SculptFloodFill *flood) SCULPT_vertex_random_access_ensure(ss); flood->queue = BLI_gsqueue_new(sizeof(intptr_t)); - flood->visited_vertices = BLI_BITMAP_NEW(vertex_count, "visited vertices"); + flood->visited_verts = BLI_BITMAP_NEW(vertex_count, "visited verts"); } void SCULPT_floodfill_add_initial(SculptFloodFill *flood, PBVHVertRef vertex) @@ -1113,7 +1113,7 @@ void SCULPT_floodfill_add_initial(SculptFloodFill *flood, PBVHVertRef vertex) void SCULPT_floodfill_add_and_skip_initial(SculptFloodFill *flood, PBVHVertRef vertex) { BLI_gsqueue_push(flood->queue, &vertex); - BLI_BITMAP_ENABLE(flood->visited_vertices, vertex.i); + BLI_BITMAP_ENABLE(flood->visited_verts, vertex.i); } void SCULPT_floodfill_add_initial_with_symmetry(Sculpt *sd, @@ -1192,7 +1192,7 @@ void SCULPT_floodfill_execute(SculptSession *ss, const PBVHVertRef to_v = ni.vertex; int to_v_i = BKE_pbvh_vertex_to_index(ss->pbvh, to_v); - if (BLI_BITMAP_TEST(flood->visited_vertices, to_v_i)) { + if (BLI_BITMAP_TEST(flood->visited_verts, to_v_i)) { continue; } @@ -1200,7 +1200,7 @@ void SCULPT_floodfill_execute(SculptSession *ss, continue; } - BLI_BITMAP_ENABLE(flood->visited_vertices, BKE_pbvh_vertex_to_index(ss->pbvh, to_v)); + BLI_BITMAP_ENABLE(flood->visited_verts, BKE_pbvh_vertex_to_index(ss->pbvh, to_v)); if (func(ss, from_v, to_v, ni.is_duplicate, userdata)) { BLI_gsqueue_push(flood->queue, &to_v); @@ -1212,7 +1212,7 @@ void SCULPT_floodfill_execute(SculptSession *ss, void SCULPT_floodfill_free(SculptFloodFill *flood) { - MEM_SAFE_FREE(flood->visited_vertices); + MEM_SAFE_FREE(flood->visited_verts); BLI_gsqueue_free(flood->queue); flood->queue = NULL; } diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.c b/source/blender/editors/sculpt_paint/sculpt_boundary.c index 93da767e3c5..005892b88a0 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.c +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.c @@ -128,22 +128,22 @@ static void sculpt_boundary_index_add(SculptBoundary *boundary, const PBVHVertRef new_vertex, const int new_index, const float distance, - GSet *included_vertices) + GSet *included_verts) { - boundary->vertices[boundary->num_vertices] = new_vertex; + boundary->verts[boundary->verts_num] = new_vertex; if (boundary->distance) { boundary->distance[new_index] = distance; } - if (included_vertices) { - BLI_gset_add(included_vertices, POINTER_FROM_INT(new_index)); + if (included_verts) { + BLI_gset_add(included_verts, POINTER_FROM_INT(new_index)); } - boundary->num_vertices++; - if (boundary->num_vertices >= boundary->vertices_capacity) { - boundary->vertices_capacity += BOUNDARY_INDICES_BLOCK_SIZE; - boundary->vertices = MEM_reallocN_id( - boundary->vertices, boundary->vertices_capacity * sizeof(PBVHVertRef), "boundary indices"); + boundary->verts_num++; + if (boundary->verts_num >= boundary->verts_capacity) { + boundary->verts_capacity += BOUNDARY_INDICES_BLOCK_SIZE; + boundary->verts = MEM_reallocN_id( + boundary->verts, boundary->verts_capacity * sizeof(PBVHVertRef), "boundary indices"); } }; @@ -152,11 +152,11 @@ static void sculpt_boundary_preview_edge_add(SculptBoundary *boundary, const PBVHVertRef v2) { - boundary->edges[boundary->num_edges].v1 = v1; - boundary->edges[boundary->num_edges].v2 = v2; - boundary->num_edges++; + boundary->edges[boundary->edges_num].v1 = v1; + boundary->edges[boundary->edges_num].v2 = v2; + boundary->edges_num++; - if (boundary->num_edges >= boundary->edges_capacity) { + if (boundary->edges_num >= boundary->edges_capacity) { boundary->edges_capacity += BOUNDARY_INDICES_BLOCK_SIZE; boundary->edges = MEM_reallocN_id(boundary->edges, boundary->edges_capacity * sizeof(SculptBoundaryPreviewEdge), @@ -209,7 +209,7 @@ static bool sculpt_boundary_is_vertex_in_editable_boundary(SculptSession *ss, typedef struct BoundaryFloodFillData { SculptBoundary *boundary; - GSet *included_vertices; + GSet *included_verts; EdgeSet *preview_edges; PBVHVertRef last_visited_vertex; @@ -233,7 +233,7 @@ static bool boundary_floodfill_cb( boundary->distance[from_v_i] + edge_len : 0.0f; sculpt_boundary_index_add( - boundary, to_v, to_v_i, distance_boundary_to_dst, data->included_vertices); + boundary, to_v, to_v_i, distance_boundary_to_dst, data->included_verts); if (!is_duplicate) { sculpt_boundary_preview_edge_add(boundary, from_v, to_v); } @@ -247,7 +247,7 @@ static void sculpt_boundary_indices_init(SculptSession *ss, { const int totvert = SCULPT_vertex_count_get(ss); - boundary->vertices = MEM_malloc_arrayN( + boundary->verts = MEM_malloc_arrayN( BOUNDARY_INDICES_BLOCK_SIZE, sizeof(PBVHVertRef), "boundary indices"); if (init_boundary_distances) { @@ -256,7 +256,7 @@ static void sculpt_boundary_indices_init(SculptSession *ss, boundary->edges = MEM_malloc_arrayN( BOUNDARY_INDICES_BLOCK_SIZE, sizeof(SculptBoundaryPreviewEdge), "boundary edges"); - GSet *included_vertices = BLI_gset_int_new_ex("included vertices", BOUNDARY_INDICES_BLOCK_SIZE); + GSet *included_verts = BLI_gset_int_new_ex("included verts", BOUNDARY_INDICES_BLOCK_SIZE); SculptFloodFill flood; SCULPT_floodfill_init(ss, &flood); @@ -268,12 +268,12 @@ static void sculpt_boundary_indices_init(SculptSession *ss, copy_v3_v3(boundary->initial_vertex_position, SCULPT_vertex_co_get(ss, boundary->initial_vertex)); sculpt_boundary_index_add( - boundary, initial_boundary_vertex, initial_boundary_index, 0.0f, included_vertices); + boundary, initial_boundary_vertex, initial_boundary_index, 0.0f, included_verts); SCULPT_floodfill_add_initial(&flood, boundary->initial_vertex); BoundaryFloodFillData fdata = { .boundary = boundary, - .included_vertices = included_vertices, + .included_verts = included_verts, .last_visited_vertex = {BOUNDARY_VERTEX_NONE}, }; @@ -286,7 +286,7 @@ static void sculpt_boundary_indices_init(SculptSession *ss, sculpt_boundary_is_vertex_in_editable_boundary(ss, fdata.last_visited_vertex)) { SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, fdata.last_visited_vertex, ni) { - if (BLI_gset_haskey(included_vertices, POINTER_FROM_INT(ni.index)) && + if (BLI_gset_haskey(included_verts, POINTER_FROM_INT(ni.index)) && sculpt_boundary_is_vertex_in_editable_boundary(ss, ni.vertex)) { sculpt_boundary_preview_edge_add(boundary, fdata.last_visited_vertex, ni.vertex); boundary->forms_loop = true; @@ -295,7 +295,7 @@ static void sculpt_boundary_indices_init(SculptSession *ss, SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); } - BLI_gset_free(included_vertices, NULL); + BLI_gset_free(included_verts, NULL); } /** @@ -318,7 +318,7 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, for (int i = 0; i < totvert; i++) { boundary->edit_info[i].original_vertex_i = BOUNDARY_VERTEX_NONE; - boundary->edit_info[i].num_propagation_steps = BOUNDARY_STEPS_NONE; + boundary->edit_info[i].propagation_steps_num = BOUNDARY_STEPS_NONE; } GSQueue *current_iteration = BLI_gsqueue_new(sizeof(PBVHVertRef)); @@ -326,38 +326,38 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, /* Initialized the first iteration with the vertices already in the boundary. This is propagation * step 0. */ - BLI_bitmap *visited_vertices = BLI_BITMAP_NEW(SCULPT_vertex_count_get(ss), "visited_vertices"); - for (int i = 0; i < boundary->num_vertices; i++) { - int index = BKE_pbvh_vertex_to_index(ss->pbvh, boundary->vertices[i]); + BLI_bitmap *visited_verts = BLI_BITMAP_NEW(SCULPT_vertex_count_get(ss), "visited_verts"); + for (int i = 0; i < boundary->verts_num; i++) { + int index = BKE_pbvh_vertex_to_index(ss->pbvh, boundary->verts[i]); boundary->edit_info[index].original_vertex_i = BKE_pbvh_vertex_to_index(ss->pbvh, - boundary->vertices[i]); - boundary->edit_info[index].num_propagation_steps = 0; + boundary->verts[i]); + boundary->edit_info[index].propagation_steps_num = 0; /* This ensures that all duplicate vertices in the boundary have the same original_vertex * index, so the deformation for them will be the same. */ if (has_duplicates) { SculptVertexNeighborIter ni_duplis; - SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN (ss, boundary->vertices[i], ni_duplis) { + SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN (ss, boundary->verts[i], ni_duplis) { if (ni_duplis.is_duplicate) { boundary->edit_info[ni_duplis.index].original_vertex_i = BKE_pbvh_vertex_to_index( - ss->pbvh, boundary->vertices[i]); + ss->pbvh, boundary->verts[i]); } } SCULPT_VERTEX_NEIGHBORS_ITER_END(ni_duplis); } - BLI_gsqueue_push(current_iteration, &boundary->vertices[i]); + BLI_gsqueue_push(current_iteration, &boundary->verts[i]); } - int num_propagation_steps = 0; + int propagation_steps_num = 0; float accum_distance = 0.0f; while (true) { /* Stop adding steps to edit info. This happens when a steps is further away from the boundary * than the brush radius or when the entire mesh was already processed. */ if (accum_distance > radius || BLI_gsqueue_is_empty(current_iteration)) { - boundary->max_propagation_steps = num_propagation_steps; + boundary->max_propagation_steps = propagation_steps_num; break; } @@ -371,22 +371,22 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN (ss, from_v, ni) { const bool is_visible = SCULPT_vertex_visible_get(ss, ni.vertex); if (!is_visible || - boundary->edit_info[ni.index].num_propagation_steps != BOUNDARY_STEPS_NONE) { + boundary->edit_info[ni.index].propagation_steps_num != BOUNDARY_STEPS_NONE) { continue; } boundary->edit_info[ni.index].original_vertex_i = boundary->edit_info[from_v_i].original_vertex_i; - BLI_BITMAP_ENABLE(visited_vertices, ni.index); + BLI_BITMAP_ENABLE(visited_verts, ni.index); if (ni.is_duplicate) { /* Grids duplicates handling. */ - boundary->edit_info[ni.index].num_propagation_steps = - boundary->edit_info[from_v_i].num_propagation_steps; + boundary->edit_info[ni.index].propagation_steps_num = + boundary->edit_info[from_v_i].propagation_steps_num; } else { - boundary->edit_info[ni.index].num_propagation_steps = - boundary->edit_info[from_v_i].num_propagation_steps + 1; + boundary->edit_info[ni.index].propagation_steps_num = + boundary->edit_info[from_v_i].propagation_steps_num + 1; BLI_gsqueue_push(next_iteration, &ni.vertex); @@ -400,8 +400,8 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, if (ni_duplis.is_duplicate) { boundary->edit_info[ni_duplis.index].original_vertex_i = boundary->edit_info[from_v_i].original_vertex_i; - boundary->edit_info[ni_duplis.index].num_propagation_steps = - boundary->edit_info[from_v_i].num_propagation_steps + 1; + boundary->edit_info[ni_duplis.index].propagation_steps_num = + boundary->edit_info[from_v_i].propagation_steps_num + 1; } } SCULPT_VERTEX_NEIGHBORS_ITER_END(ni_duplis); @@ -428,10 +428,10 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, BLI_gsqueue_push(current_iteration, &next_v); } - num_propagation_steps++; + propagation_steps_num++; } - MEM_SAFE_FREE(visited_vertices); + MEM_SAFE_FREE(visited_verts); BLI_gsqueue_free(current_iteration); BLI_gsqueue_free(next_iteration); @@ -449,9 +449,9 @@ static void sculpt_boundary_falloff_factor_init(SculptSession *ss, BKE_curvemapping_init(brush->curve); for (int i = 0; i < totvert; i++) { - if (boundary->edit_info[i].num_propagation_steps != -1) { + if (boundary->edit_info[i].propagation_steps_num != -1) { boundary->edit_info[i].strength_factor = BKE_brush_curve_strength( - brush, boundary->edit_info[i].num_propagation_steps, boundary->max_propagation_steps); + brush, boundary->edit_info[i].propagation_steps_num, boundary->max_propagation_steps); } if (boundary->edit_info[i].original_vertex_i == @@ -542,7 +542,7 @@ SculptBoundary *SCULPT_boundary_data_init(Object *object, void SCULPT_boundary_data_free(SculptBoundary *boundary) { - MEM_SAFE_FREE(boundary->vertices); + MEM_SAFE_FREE(boundary->verts); MEM_SAFE_FREE(boundary->edges); MEM_SAFE_FREE(boundary->distance); MEM_SAFE_FREE(boundary->edit_info); @@ -564,7 +564,7 @@ static void sculpt_boundary_bend_data_init(SculptSession *ss, SculptBoundary *bo boundary->bend.pivot_positions = MEM_calloc_arrayN(totvert, sizeof(float[3]), "pivot positions"); for (int i = 0; i < totvert; i++) { - if (boundary->edit_info[i].num_propagation_steps != boundary->max_propagation_steps) { + if (boundary->edit_info[i].propagation_steps_num != boundary->max_propagation_steps) { continue; } @@ -586,7 +586,7 @@ static void sculpt_boundary_bend_data_init(SculptSession *ss, SculptBoundary *bo } for (int i = 0; i < totvert; i++) { - if (boundary->edit_info[i].num_propagation_steps == BOUNDARY_STEPS_NONE) { + if (boundary->edit_info[i].propagation_steps_num == BOUNDARY_STEPS_NONE) { continue; } copy_v3_v3(boundary->bend.pivot_positions[i], @@ -602,7 +602,7 @@ static void sculpt_boundary_slide_data_init(SculptSession *ss, SculptBoundary *b boundary->slide.directions = MEM_calloc_arrayN(totvert, sizeof(float[3]), "slide directions"); for (int i = 0; i < totvert; i++) { - if (boundary->edit_info[i].num_propagation_steps != boundary->max_propagation_steps) { + if (boundary->edit_info[i].propagation_steps_num != boundary->max_propagation_steps) { continue; } sub_v3_v3v3( @@ -614,7 +614,7 @@ static void sculpt_boundary_slide_data_init(SculptSession *ss, SculptBoundary *b } for (int i = 0; i < totvert; i++) { - if (boundary->edit_info[i].num_propagation_steps == BOUNDARY_STEPS_NONE) { + if (boundary->edit_info[i].propagation_steps_num == BOUNDARY_STEPS_NONE) { continue; } copy_v3_v3(boundary->slide.directions[i], @@ -625,15 +625,14 @@ static void sculpt_boundary_slide_data_init(SculptSession *ss, SculptBoundary *b static void sculpt_boundary_twist_data_init(SculptSession *ss, SculptBoundary *boundary) { zero_v3(boundary->twist.pivot_position); - float(*poly_verts)[3] = MEM_malloc_arrayN( - boundary->num_vertices, sizeof(float[3]), "poly verts"); - for (int i = 0; i < boundary->num_vertices; i++) { - add_v3_v3(boundary->twist.pivot_position, SCULPT_vertex_co_get(ss, boundary->vertices[i])); - copy_v3_v3(poly_verts[i], SCULPT_vertex_co_get(ss, boundary->vertices[i])); + float(*poly_verts)[3] = MEM_malloc_arrayN(boundary->verts_num, sizeof(float[3]), "poly verts"); + for (int i = 0; i < boundary->verts_num; i++) { + add_v3_v3(boundary->twist.pivot_position, SCULPT_vertex_co_get(ss, boundary->verts[i])); + copy_v3_v3(poly_verts[i], SCULPT_vertex_co_get(ss, boundary->verts[i])); } - mul_v3_fl(boundary->twist.pivot_position, 1.0f / boundary->num_vertices); + mul_v3_fl(boundary->twist.pivot_position, 1.0f / boundary->verts_num); if (boundary->forms_loop) { - normal_poly_v3(boundary->twist.rotation_axis, poly_verts, boundary->num_vertices); + normal_poly_v3(boundary->twist.rotation_axis, poly_verts, boundary->verts_num); } else { sub_v3_v3v3(boundary->twist.rotation_axis, @@ -684,7 +683,7 @@ static void do_boundary_brush_bend_task_cb_ex(void *__restrict userdata, const float angle = angle_factor * M_PI; BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -732,7 +731,7 @@ static void do_boundary_brush_slide_task_cb_ex(void *__restrict userdata, const float disp = sculpt_boundary_displacement_from_grab_delta_get(ss, boundary); BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -778,7 +777,7 @@ static void do_boundary_brush_inflate_task_cb_ex(void *__restrict userdata, const float disp = sculpt_boundary_displacement_from_grab_delta_get(ss, boundary); BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -822,7 +821,7 @@ static void do_boundary_brush_grab_task_cb_ex(void *__restrict userdata, SCULPT_orig_vert_data_init(&orig_data, data->ob, data->nodes[n], SCULPT_UNDO_COORDS); BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -873,7 +872,7 @@ static void do_boundary_brush_twist_task_cb_ex(void *__restrict userdata, const float angle = angle_factor * M_PI; BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -919,7 +918,7 @@ static void do_boundary_brush_smooth_task_cb_ex(void *__restrict userdata, SCULPT_orig_vert_data_init(&orig_data, data->ob, data->nodes[n], SCULPT_UNDO_COORDS); BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { - if (boundary->edit_info[vd.index].num_propagation_steps == -1) { + if (boundary->edit_info[vd.index].propagation_steps_num == -1) { continue; } @@ -931,10 +930,10 @@ static void do_boundary_brush_smooth_task_cb_ex(void *__restrict userdata, float coord_accum[3] = {0.0f, 0.0f, 0.0f}; int total_neighbors = 0; - const int current_propagation_steps = boundary->edit_info[vd.index].num_propagation_steps; + const int current_propagation_steps = boundary->edit_info[vd.index].propagation_steps_num; SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd.vertex, ni) { - if (current_propagation_steps == boundary->edit_info[ni.index].num_propagation_steps) { + if (current_propagation_steps == boundary->edit_info[ni.index].propagation_steps_num) { add_v3_v3(coord_accum, SCULPT_vertex_co_get(ss, ni.vertex)); total_neighbors++; } @@ -1053,8 +1052,8 @@ void SCULPT_boundary_edges_preview_draw(const uint gpuattr, } immUniformColor3fvAlpha(outline_col, outline_alpha); GPU_line_width(2.0f); - immBegin(GPU_PRIM_LINES, ss->boundary_preview->num_edges * 2); - for (int i = 0; i < ss->boundary_preview->num_edges; i++) { + immBegin(GPU_PRIM_LINES, ss->boundary_preview->edges_num * 2); + for (int i = 0; i < ss->boundary_preview->edges_num; i++) { immVertex3fv(gpuattr, SCULPT_vertex_co_get(ss, ss->boundary_preview->edges[i].v1)); immVertex3fv(gpuattr, SCULPT_vertex_co_get(ss, ss->boundary_preview->edges[i].v2)); } diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index 7c4c47261b3..4aafeacfbff 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -351,13 +351,13 @@ static float sculpt_expand_gradient_value_get(SculptSession *ss, static BLI_bitmap *sculpt_expand_bitmap_from_enabled(SculptSession *ss, ExpandCache *expand_cache) { const int totvert = SCULPT_vertex_count_get(ss); - BLI_bitmap *enabled_vertices = BLI_BITMAP_NEW(totvert, "enabled vertices"); + BLI_bitmap *enabled_verts = BLI_BITMAP_NEW(totvert, "enabled verts"); for (int i = 0; i < totvert; i++) { const bool enabled = sculpt_expand_state_get( ss, expand_cache, BKE_pbvh_index_to_vertex(ss->pbvh, i)); - BLI_BITMAP_SET(enabled_vertices, i, enabled); + BLI_BITMAP_SET(enabled_verts, i, enabled); } - return enabled_vertices; + return enabled_verts; } /** @@ -366,13 +366,13 @@ static BLI_bitmap *sculpt_expand_bitmap_from_enabled(SculptSession *ss, ExpandCa * vertex that is not enabled. */ static BLI_bitmap *sculpt_expand_boundary_from_enabled(SculptSession *ss, - const BLI_bitmap *enabled_vertices, + const BLI_bitmap *enabled_verts, const bool use_mesh_boundary) { const int totvert = SCULPT_vertex_count_get(ss); - BLI_bitmap *boundary_vertices = BLI_BITMAP_NEW(totvert, "boundary vertices"); + BLI_bitmap *boundary_verts = BLI_BITMAP_NEW(totvert, "boundary verts"); for (int i = 0; i < totvert; i++) { - if (!BLI_BITMAP_TEST(enabled_vertices, i)) { + if (!BLI_BITMAP_TEST(enabled_verts, i)) { continue; } @@ -381,7 +381,7 @@ static BLI_bitmap *sculpt_expand_boundary_from_enabled(SculptSession *ss, bool is_expand_boundary = false; SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vertex, ni) { - if (!BLI_BITMAP_TEST(enabled_vertices, ni.index)) { + if (!BLI_BITMAP_TEST(enabled_verts, ni.index)) { is_expand_boundary = true; } } @@ -391,10 +391,10 @@ static BLI_bitmap *sculpt_expand_boundary_from_enabled(SculptSession *ss, is_expand_boundary = true; } - BLI_BITMAP_SET(boundary_vertices, i, is_expand_boundary); + BLI_BITMAP_SET(boundary_verts, i, is_expand_boundary); } - return boundary_vertices; + return boundary_verts; } /* Functions implementing different algorithms for initializing falloff values. */ @@ -596,7 +596,7 @@ static float *sculpt_expand_boundary_topology_falloff_create(Object *ob, const P SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "spherical dist"); - BLI_bitmap *visited_vertices = BLI_BITMAP_NEW(totvert, "visited vertices"); + BLI_bitmap *visited_verts = BLI_BITMAP_NEW(totvert, "visited verts"); GSQueue *queue = BLI_gsqueue_new(sizeof(PBVHVertRef)); /* Search and initialize a boundary per symmetry pass, then mark those vertices as visited. */ @@ -614,9 +614,9 @@ static float *sculpt_expand_boundary_topology_falloff_create(Object *ob, const P continue; } - for (int i = 0; i < boundary->num_vertices; i++) { - BLI_gsqueue_push(queue, &boundary->vertices[i]); - BLI_BITMAP_ENABLE(visited_vertices, boundary->vertices_i[i]); + for (int i = 0; i < boundary->verts_num; i++) { + BLI_gsqueue_push(queue, &boundary->verts[i]); + BLI_BITMAP_ENABLE(visited_verts, boundary->verts_i[i]); } SCULPT_boundary_data_free(boundary); } @@ -635,18 +635,18 @@ static float *sculpt_expand_boundary_topology_falloff_create(Object *ob, const P SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, v_next, ni) { - if (BLI_BITMAP_TEST(visited_vertices, ni.index)) { + if (BLI_BITMAP_TEST(visited_verts, ni.index)) { continue; } dists[ni.index] = dists[v_next_i] + 1.0f; - BLI_BITMAP_ENABLE(visited_vertices, ni.index); + BLI_BITMAP_ENABLE(visited_verts, ni.index); BLI_gsqueue_push(queue, &ni.vertex); } SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); } BLI_gsqueue_free(queue); - MEM_freeN(visited_vertices); + MEM_freeN(visited_verts); return dists; } @@ -669,7 +669,7 @@ static float *sculpt_expand_diagonals_falloff_create(Object *ob, const PBVHVertR } /* Search and mask as visited the initial vertices using the enabled symmetry passes. */ - BLI_bitmap *visited_vertices = BLI_BITMAP_NEW(totvert, "visited vertices"); + BLI_bitmap *visited_verts = BLI_BITMAP_NEW(totvert, "visited verts"); GSQueue *queue = BLI_gsqueue_new(sizeof(PBVHVertRef)); const char symm = SCULPT_mesh_symmetry_xyz_get(ob); for (char symm_it = 0; symm_it <= symm; symm_it++) { @@ -682,7 +682,7 @@ static float *sculpt_expand_diagonals_falloff_create(Object *ob, const PBVHVertR int symm_vertex_i = BKE_pbvh_vertex_to_index(ss->pbvh, symm_vertex); BLI_gsqueue_push(queue, &symm_vertex); - BLI_BITMAP_ENABLE(visited_vertices, symm_vertex_i); + BLI_BITMAP_ENABLE(visited_verts, symm_vertex_i); } if (BLI_gsqueue_is_empty(queue)) { @@ -700,18 +700,18 @@ static float *sculpt_expand_diagonals_falloff_create(Object *ob, const PBVHVertR const MPoly *p = &ss->mpoly[ss->pmap[v_next_i].indices[j]]; for (int l = 0; l < p->totloop; l++) { const PBVHVertRef neighbor_v = BKE_pbvh_make_vref(ss->mloop[p->loopstart + l].v); - if (BLI_BITMAP_TEST(visited_vertices, neighbor_v.i)) { + if (BLI_BITMAP_TEST(visited_verts, neighbor_v.i)) { continue; } dists[neighbor_v.i] = dists[v_next_i] + 1.0f; - BLI_BITMAP_ENABLE(visited_vertices, neighbor_v.i); + BLI_BITMAP_ENABLE(visited_verts, neighbor_v.i); BLI_gsqueue_push(queue, &neighbor_v); } } } BLI_gsqueue_free(queue); - MEM_freeN(visited_vertices); + MEM_freeN(visited_verts); return dists; } @@ -842,27 +842,27 @@ static void sculpt_expand_mesh_face_falloff_from_vertex_falloff(SculptSession *s */ static void sculpt_expand_geodesics_from_state_boundary(Object *ob, ExpandCache *expand_cache, - BLI_bitmap *enabled_vertices) + BLI_bitmap *enabled_verts) { SculptSession *ss = ob->sculpt; BLI_assert(BKE_pbvh_type(ss->pbvh) == PBVH_FACES); - GSet *initial_vertices = BLI_gset_int_new("initial_vertices"); - BLI_bitmap *boundary_vertices = sculpt_expand_boundary_from_enabled(ss, enabled_vertices, false); + GSet *initial_verts = BLI_gset_int_new("initial_verts"); + BLI_bitmap *boundary_verts = sculpt_expand_boundary_from_enabled(ss, enabled_verts, false); const int totvert = SCULPT_vertex_count_get(ss); for (int i = 0; i < totvert; i++) { - if (!BLI_BITMAP_TEST(boundary_vertices, i)) { + if (!BLI_BITMAP_TEST(boundary_verts, i)) { continue; } - BLI_gset_add(initial_vertices, POINTER_FROM_INT(i)); + BLI_gset_add(initial_verts, POINTER_FROM_INT(i)); } - MEM_freeN(boundary_vertices); + MEM_freeN(boundary_verts); MEM_SAFE_FREE(expand_cache->vert_falloff); MEM_SAFE_FREE(expand_cache->face_falloff); - expand_cache->vert_falloff = SCULPT_geodesic_distances_create(ob, initial_vertices, FLT_MAX); - BLI_gset_free(initial_vertices, NULL); + expand_cache->vert_falloff = SCULPT_geodesic_distances_create(ob, initial_verts, FLT_MAX); + BLI_gset_free(initial_verts, NULL); } /** @@ -871,7 +871,7 @@ static void sculpt_expand_geodesics_from_state_boundary(Object *ob, */ static void sculpt_expand_topology_from_state_boundary(Object *ob, ExpandCache *expand_cache, - BLI_bitmap *enabled_vertices) + BLI_bitmap *enabled_verts) { MEM_SAFE_FREE(expand_cache->vert_falloff); MEM_SAFE_FREE(expand_cache->face_falloff); @@ -880,19 +880,19 @@ static void sculpt_expand_topology_from_state_boundary(Object *ob, const int totvert = SCULPT_vertex_count_get(ss); float *dists = MEM_calloc_arrayN(totvert, sizeof(float), "topology dist"); - BLI_bitmap *boundary_vertices = sculpt_expand_boundary_from_enabled(ss, enabled_vertices, false); + BLI_bitmap *boundary_verts = sculpt_expand_boundary_from_enabled(ss, enabled_verts, false); SculptFloodFill flood; SCULPT_floodfill_init(ss, &flood); for (int i = 0; i < totvert; i++) { - if (!BLI_BITMAP_TEST(boundary_vertices, i)) { + if (!BLI_BITMAP_TEST(boundary_verts, i)) { continue; } PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); SCULPT_floodfill_add_and_skip_initial(&flood, vertex); } - MEM_freeN(boundary_vertices); + MEM_freeN(boundary_verts); ExpandFloodFillData fdata; fdata.dists = dists; @@ -914,7 +914,7 @@ static void sculpt_expand_resursion_step_add(Object *ob, return; } - BLI_bitmap *enabled_vertices = sculpt_expand_bitmap_from_enabled(ss, expand_cache); + BLI_bitmap *enabled_verts = sculpt_expand_bitmap_from_enabled(ss, expand_cache); /* Each time a new recursion step is created, reset the distortion strength. This is the expected * result from the recursion, as otherwise the new falloff will render with undesired distortion @@ -923,10 +923,10 @@ static void sculpt_expand_resursion_step_add(Object *ob, switch (recursion_type) { case SCULPT_EXPAND_RECURSION_GEODESICS: - sculpt_expand_geodesics_from_state_boundary(ob, expand_cache, enabled_vertices); + sculpt_expand_geodesics_from_state_boundary(ob, expand_cache, enabled_verts); break; case SCULPT_EXPAND_RECURSION_TOPOLOGY: - sculpt_expand_topology_from_state_boundary(ob, expand_cache, enabled_vertices); + sculpt_expand_topology_from_state_boundary(ob, expand_cache, enabled_verts); break; } @@ -936,7 +936,7 @@ static void sculpt_expand_resursion_step_add(Object *ob, sculpt_expand_update_max_face_falloff_factor(ss, expand_cache); } - MEM_freeN(enabled_vertices); + MEM_freeN(enabled_verts); } /* Face Set Boundary falloff. */ @@ -953,7 +953,7 @@ static void sculpt_expand_initialize_from_face_set_boundary(Object *ob, SculptSession *ss = ob->sculpt; const int totvert = SCULPT_vertex_count_get(ss); - BLI_bitmap *enabled_vertices = BLI_BITMAP_NEW(totvert, "enabled vertices"); + BLI_bitmap *enabled_verts = BLI_BITMAP_NEW(totvert, "enabled verts"); for (int i = 0; i < totvert; i++) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); @@ -963,17 +963,17 @@ static void sculpt_expand_initialize_from_face_set_boundary(Object *ob, if (!SCULPT_vertex_has_face_set(ss, vertex, active_face_set)) { continue; } - BLI_BITMAP_ENABLE(enabled_vertices, i); + BLI_BITMAP_ENABLE(enabled_verts, i); } if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES) { - sculpt_expand_geodesics_from_state_boundary(ob, expand_cache, enabled_vertices); + sculpt_expand_geodesics_from_state_boundary(ob, expand_cache, enabled_verts); } else { - sculpt_expand_topology_from_state_boundary(ob, expand_cache, enabled_vertices); + sculpt_expand_topology_from_state_boundary(ob, expand_cache, enabled_verts); } - MEM_freeN(enabled_vertices); + MEM_freeN(enabled_verts); if (internal_falloff) { for (int i = 0; i < totvert; i++) { @@ -1086,7 +1086,7 @@ static void sculpt_expand_snap_initialize_from_enabled(SculptSession *ss, expand_cache->snap = false; expand_cache->invert = false; - BLI_bitmap *enabled_vertices = sculpt_expand_bitmap_from_enabled(ss, expand_cache); + BLI_bitmap *enabled_verts = sculpt_expand_bitmap_from_enabled(ss, expand_cache); const int totface = ss->totfaces; for (int i = 0; i < totface; i++) { @@ -1099,7 +1099,7 @@ static void sculpt_expand_snap_initialize_from_enabled(SculptSession *ss, bool any_disabled = false; for (int l = 0; l < poly->totloop; l++) { const MLoop *loop = &ss->mloop[l + poly->loopstart]; - if (!BLI_BITMAP_TEST(enabled_vertices, loop->v)) { + if (!BLI_BITMAP_TEST(enabled_verts, loop->v)) { any_disabled = true; break; } @@ -1110,7 +1110,7 @@ static void sculpt_expand_snap_initialize_from_enabled(SculptSession *ss, } } - MEM_freeN(enabled_vertices); + MEM_freeN(enabled_verts); expand_cache->snap = prev_snap_state; expand_cache->invert = prev_invert_state; } @@ -1514,7 +1514,7 @@ static void sculpt_expand_reposition_pivot(bContext *C, Object *ob, ExpandCache const bool initial_invert_state = expand_cache->invert; expand_cache->invert = false; - BLI_bitmap *enabled_vertices = sculpt_expand_bitmap_from_enabled(ss, expand_cache); + BLI_bitmap *enabled_verts = sculpt_expand_bitmap_from_enabled(ss, expand_cache); /* For boundary topology, position the pivot using only the boundary of the enabled vertices, * without taking mesh boundary into account. This allows to create deformations like bending the @@ -1522,8 +1522,8 @@ static void sculpt_expand_reposition_pivot(bContext *C, Object *ob, ExpandCache const float use_mesh_boundary = expand_cache->falloff_type != SCULPT_EXPAND_FALLOFF_BOUNDARY_TOPOLOGY; - BLI_bitmap *boundary_vertices = sculpt_expand_boundary_from_enabled( - ss, enabled_vertices, use_mesh_boundary); + BLI_bitmap *boundary_verts = sculpt_expand_boundary_from_enabled( + ss, enabled_verts, use_mesh_boundary); /* Ignore invert state, as this is the expected behavior in most cases and mask are created in * inverted state by default. */ @@ -1537,7 +1537,7 @@ static void sculpt_expand_reposition_pivot(bContext *C, Object *ob, ExpandCache for (int i = 0; i < totvert; i++) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); - if (!BLI_BITMAP_TEST(boundary_vertices, i)) { + if (!BLI_BITMAP_TEST(boundary_verts, i)) { continue; } @@ -1555,8 +1555,8 @@ static void sculpt_expand_reposition_pivot(bContext *C, Object *ob, ExpandCache total++; } - MEM_freeN(enabled_vertices); - MEM_freeN(boundary_vertices); + MEM_freeN(enabled_verts); + MEM_freeN(boundary_verts); if (total > 0) { mul_v3_v3fl(ss->pivot_pos, avg, 1.0f / total); diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c index b89944628da..64bc6188bbc 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.c +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c @@ -746,7 +746,7 @@ static int sculpt_face_set_init_exec(bContext *C, wmOperator *op) SCULPT_undo_push_end(ob); /* Sync face sets visibility and vertex visibility as now all Face Sets are visible. */ - SCULPT_visibility_sync_all_face_sets_to_vertices(ob); + SCULPT_visibility_sync_all_face_sets_to_verts(ob); for (int i = 0; i < totnode; i++) { BKE_pbvh_node_mark_update_visibility(nodes[i]); @@ -933,7 +933,7 @@ static int sculpt_face_sets_change_visibility_exec(bContext *C, wmOperator *op) } /* Sync face sets visibility and vertex visibility. */ - SCULPT_visibility_sync_all_face_sets_to_vertices(ob); + SCULPT_visibility_sync_all_face_sets_to_verts(ob); SCULPT_undo_push_end(ob); @@ -1233,21 +1233,21 @@ static void sculpt_face_set_edit_fair_face_set(Object *ob, const int totvert = SCULPT_vertex_count_get(ss); Mesh *mesh = ob->data; - bool *fair_vertices = MEM_malloc_arrayN(totvert, sizeof(bool), "fair vertices"); + bool *fair_verts = MEM_malloc_arrayN(totvert, sizeof(bool), "fair vertices"); SCULPT_boundary_info_ensure(ob); for (int i = 0; i < totvert; i++) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); - fair_vertices[i] = !SCULPT_vertex_is_boundary(ss, vertex) && - SCULPT_vertex_has_face_set(ss, vertex, active_face_set_id) && - SCULPT_vertex_has_unique_face_set(ss, vertex); + fair_verts[i] = !SCULPT_vertex_is_boundary(ss, vertex) && + SCULPT_vertex_has_face_set(ss, vertex, active_face_set_id) && + SCULPT_vertex_has_unique_face_set(ss, vertex); } MVert *mvert = SCULPT_mesh_deformed_mverts_get(ss); - BKE_mesh_prefair_and_fair_vertices(mesh, mvert, fair_vertices, fair_order); - MEM_freeN(fair_vertices); + BKE_mesh_prefair_and_fair_verts(mesh, mvert, fair_verts, fair_order); + MEM_freeN(fair_verts); } static void sculpt_face_set_apply_edit(Object *ob, @@ -1339,7 +1339,7 @@ static void face_set_edit_do_post_visibility_updates(Object *ob, PBVHNode **node PBVH *pbvh = ss->pbvh; /* Sync face sets visibility and vertex visibility as now all Face Sets are visible. */ - SCULPT_visibility_sync_all_face_sets_to_vertices(ob); + SCULPT_visibility_sync_all_face_sets_to_verts(ob); for (int i = 0; i < totnode; i++) { BKE_pbvh_node_mark_update_visibility(nodes[i]); diff --git a/source/blender/editors/sculpt_paint/sculpt_geodesic.c b/source/blender/editors/sculpt_paint/sculpt_geodesic.c index c07c6126405..a5885092ee3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_geodesic.c +++ b/source/blender/editors/sculpt_paint/sculpt_geodesic.c @@ -61,9 +61,9 @@ /* Propagate distance from v1 and v2 to v0. */ static bool sculpt_geodesic_mesh_test_dist_add( - MVert *mvert, const int v0, const int v1, const int v2, float *dists, GSet *initial_vertices) + MVert *mvert, const int v0, const int v1, const int v2, float *dists, GSet *initial_verts) { - if (BLI_gset_haskey(initial_vertices, POINTER_FROM_INT(v0))) { + if (BLI_gset_haskey(initial_verts, POINTER_FROM_INT(v0))) { return false; } @@ -96,7 +96,7 @@ static bool sculpt_geodesic_mesh_test_dist_add( } static float *SCULPT_geodesic_mesh_create(Object *ob, - GSet *initial_vertices, + GSet *initial_verts, const float limit_radius) { SculptSession *ss = ob->sculpt; @@ -137,7 +137,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, BLI_LINKSTACK_INIT(queue_next); for (int i = 0; i < totvert; i++) { - if (BLI_gset_haskey(initial_vertices, POINTER_FROM_INT(i))) { + if (BLI_gset_haskey(initial_verts, POINTER_FROM_INT(i))) { dists[i] = 0.0f; } else { @@ -159,7 +159,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, /* This is an O(n^2) loop used to limit the geodesic distance calculation to a radius. When * this optimization is needed, it is expected for the tool to request the distance to a low * number of vertices (usually just 1 or 2). */ - GSET_ITER (gs_iter, initial_vertices) { + GSET_ITER (gs_iter, initial_verts) { const int v = POINTER_AS_INT(BLI_gsetIterator_getKey(&gs_iter)); float *v_co = verts[v].co; for (int i = 0; i < totvert; i++) { @@ -193,7 +193,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, SWAP(int, v1, v2); } sculpt_geodesic_mesh_test_dist_add( - verts, v2, v1, SCULPT_GEODESIC_VERTEX_NONE, dists, initial_vertices); + verts, v2, v1, SCULPT_GEODESIC_VERTEX_NONE, dists, initial_verts); } if (ss->epmap[e].count != 0) { @@ -210,8 +210,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, if (ELEM(v_other, v1, v2)) { continue; } - if (sculpt_geodesic_mesh_test_dist_add( - verts, v_other, v1, v2, dists, initial_vertices)) { + if (sculpt_geodesic_mesh_test_dist_add(verts, v_other, v1, v2, dists, initial_verts)) { for (int edge_map_index = 0; edge_map_index < ss->vemap[v_other].count; edge_map_index++) { const int e_other = ss->vemap[v_other].indices[edge_map_index]; @@ -258,7 +257,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, /* For sculpt mesh data that does not support a geodesic distances algorithm, fallback to the * distance to each vertex. In this case, only one of the initial vertices will be used to * calculate the distance. */ -static float *SCULPT_geodesic_fallback_create(Object *ob, GSet *initial_vertices) +static float *SCULPT_geodesic_fallback_create(Object *ob, GSet *initial_verts) { SculptSession *ss = ob->sculpt; @@ -267,7 +266,7 @@ static float *SCULPT_geodesic_fallback_create(Object *ob, GSet *initial_vertices float *dists = MEM_malloc_arrayN(totvert, sizeof(float), "distances"); int first_affected = SCULPT_GEODESIC_VERTEX_NONE; GSetIterator gs_iter; - GSET_ITER (gs_iter, initial_vertices) { + GSET_ITER (gs_iter, initial_verts) { first_affected = POINTER_AS_INT(BLI_gsetIterator_getKey(&gs_iter)); break; } @@ -290,17 +289,15 @@ static float *SCULPT_geodesic_fallback_create(Object *ob, GSet *initial_vertices return dists; } -float *SCULPT_geodesic_distances_create(Object *ob, - GSet *initial_vertices, - const float limit_radius) +float *SCULPT_geodesic_distances_create(Object *ob, GSet *initial_verts, const float limit_radius) { SculptSession *ss = ob->sculpt; switch (BKE_pbvh_type(ss->pbvh)) { case PBVH_FACES: - return SCULPT_geodesic_mesh_create(ob, initial_vertices, limit_radius); + return SCULPT_geodesic_mesh_create(ob, initial_verts, limit_radius); case PBVH_BMESH: case PBVH_GRIDS: - return SCULPT_geodesic_fallback_create(ob, initial_vertices); + return SCULPT_geodesic_fallback_create(ob, initial_verts); } BLI_assert(false); return NULL; @@ -312,7 +309,7 @@ float *SCULPT_geodesic_from_vertex_and_symm(Sculpt *sd, const float limit_radius) { SculptSession *ss = ob->sculpt; - GSet *initial_vertices = BLI_gset_int_new("initial_vertices"); + GSet *initial_verts = BLI_gset_int_new("initial_verts"); const char symm = SCULPT_mesh_symmetry_xyz_get(ob); for (char i = 0; i <= symm; ++i) { @@ -328,22 +325,22 @@ float *SCULPT_geodesic_from_vertex_and_symm(Sculpt *sd, v = SCULPT_nearest_vertex_get(sd, ob, location, FLT_MAX, false); } if (v.i != PBVH_REF_NONE) { - BLI_gset_add(initial_vertices, POINTER_FROM_INT(BKE_pbvh_vertex_to_index(ss->pbvh, v))); + BLI_gset_add(initial_verts, POINTER_FROM_INT(BKE_pbvh_vertex_to_index(ss->pbvh, v))); } } } - float *dists = SCULPT_geodesic_distances_create(ob, initial_vertices, limit_radius); - BLI_gset_free(initial_vertices, NULL); + float *dists = SCULPT_geodesic_distances_create(ob, initial_verts, limit_radius); + BLI_gset_free(initial_verts, NULL); return dists; } float *SCULPT_geodesic_from_vertex(Object *ob, const PBVHVertRef vertex, const float limit_radius) { - GSet *initial_vertices = BLI_gset_int_new("initial_vertices"); - BLI_gset_add(initial_vertices, + GSet *initial_verts = BLI_gset_int_new("initial_verts"); + BLI_gset_add(initial_verts, POINTER_FROM_INT(BKE_pbvh_vertex_to_index(ob->sculpt->pbvh, vertex))); - float *dists = SCULPT_geodesic_distances_create(ob, initial_vertices, limit_radius); - BLI_gset_free(initial_vertices, NULL); + float *dists = SCULPT_geodesic_distances_create(ob, initial_verts, limit_radius); + BLI_gset_free(initial_verts, NULL); return dists; } diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index e4bba135518..4bc06d68a02 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -97,7 +97,7 @@ typedef struct { /* Flood Fill. */ typedef struct { GSQueue *queue; - BLI_bitmap *visited_vertices; + BLI_bitmap *visited_verts; } SculptFloodFill; typedef enum eBoundaryAutomaskMode { @@ -1005,7 +1005,7 @@ void SCULPT_connected_components_ensure(Object *ob); void SCULPT_vertex_visible_set(SculptSession *ss, PBVHVertRef vertex, bool visible); bool SCULPT_vertex_visible_get(SculptSession *ss, PBVHVertRef vertex); -void SCULPT_visibility_sync_all_face_sets_to_vertices(struct Object *ob); +void SCULPT_visibility_sync_all_face_sets_to_verts(struct Object *ob); void SCULPT_visibility_sync_all_vertex_to_face_sets(struct SculptSession *ss); /** \} */ diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c b/source/blender/editors/sculpt_paint/sculpt_ops.c index 97c1f331498..10a2ece73de 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.c +++ b/source/blender/editors/sculpt_paint/sculpt_ops.c @@ -571,49 +571,48 @@ void SCULPT_geometry_preview_lines_update(bContext *C, SculptSession *ss, float float brush_co[3]; copy_v3_v3(brush_co, SCULPT_active_vertex_co_get(ss)); - BLI_bitmap *visited_vertices = BLI_BITMAP_NEW(SCULPT_vertex_count_get(ss), "visited_vertices"); + BLI_bitmap *visited_verts = BLI_BITMAP_NEW(SCULPT_vertex_count_get(ss), "visited_verts"); /* Assuming an average of 6 edges per vertex in a triangulated mesh. */ - const int max_preview_vertices = SCULPT_vertex_count_get(ss) * 3 * 2; + const int max_preview_verts = SCULPT_vertex_count_get(ss) * 3 * 2; if (ss->preview_vert_list == NULL) { - ss->preview_vert_list = MEM_callocN(max_preview_vertices * sizeof(PBVHVertRef), - "preview lines"); + ss->preview_vert_list = MEM_callocN(max_preview_verts * sizeof(PBVHVertRef), "preview lines"); } - GSQueue *not_visited_vertices = BLI_gsqueue_new(sizeof(PBVHVertRef)); + GSQueue *non_visited_verts = BLI_gsqueue_new(sizeof(PBVHVertRef)); PBVHVertRef active_v = SCULPT_active_vertex_get(ss); - BLI_gsqueue_push(not_visited_vertices, &active_v); + BLI_gsqueue_push(non_visited_verts, &active_v); - while (!BLI_gsqueue_is_empty(not_visited_vertices)) { + while (!BLI_gsqueue_is_empty(non_visited_verts)) { PBVHVertRef from_v; - BLI_gsqueue_pop(not_visited_vertices, &from_v); + BLI_gsqueue_pop(non_visited_verts, &from_v); SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, from_v, ni) { - if (totpoints + (ni.size * 2) < max_preview_vertices) { + if (totpoints + (ni.size * 2) < max_preview_verts) { PBVHVertRef to_v = ni.vertex; int to_v_i = ni.index; ss->preview_vert_list[totpoints] = from_v; totpoints++; ss->preview_vert_list[totpoints] = to_v; totpoints++; - if (BLI_BITMAP_TEST(visited_vertices, to_v_i)) { + if (BLI_BITMAP_TEST(visited_verts, to_v_i)) { continue; } - BLI_BITMAP_ENABLE(visited_vertices, to_v_i); + BLI_BITMAP_ENABLE(visited_verts, to_v_i); const float *co = SCULPT_vertex_co_for_grab_active_get(ss, to_v); if (len_squared_v3v3(brush_co, co) < radius * radius) { - BLI_gsqueue_push(not_visited_vertices, &to_v); + BLI_gsqueue_push(non_visited_verts, &to_v); } } } SCULPT_VERTEX_NEIGHBORS_ITER_END(ni); } - BLI_gsqueue_free(not_visited_vertices); + BLI_gsqueue_free(non_visited_verts); - MEM_freeN(visited_vertices); + MEM_freeN(visited_verts); ss->preview_vert_count = totpoints; } diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 2fc49a24cc4..a31be07d8af 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -168,9 +168,9 @@ struct PartialUpdateData { PBVH *pbvh; bool rebuild; char *modified_grids; - bool *modified_hidden_vertices; - bool *modified_mask_vertices; - bool *modified_color_vertices; + bool *modified_hidden_verts; + bool *modified_mask_verts; + bool *modified_color_verts; }; /** @@ -201,25 +201,25 @@ static void update_cb_partial(PBVHNode *node, void *userdata) const int *vert_indices; BKE_pbvh_node_num_verts(data->pbvh, node, NULL, &verts_num); BKE_pbvh_node_get_verts(data->pbvh, node, &vert_indices, NULL); - if (data->modified_mask_vertices != NULL) { + if (data->modified_mask_verts != NULL) { for (int i = 0; i < verts_num; i++) { - if (data->modified_mask_vertices[vert_indices[i]]) { + if (data->modified_mask_verts[vert_indices[i]]) { BKE_pbvh_node_mark_update_mask(node); break; } } } - if (data->modified_color_vertices != NULL) { + if (data->modified_color_verts != NULL) { for (int i = 0; i < verts_num; i++) { - if (data->modified_color_vertices[vert_indices[i]]) { + if (data->modified_color_verts[vert_indices[i]]) { BKE_pbvh_node_mark_update_color(node); break; } } } - if (data->modified_hidden_vertices != NULL) { + if (data->modified_hidden_verts != NULL) { for (int i = 0; i < verts_num; i++) { - if (data->modified_hidden_vertices[vert_indices[i]]) { + if (data->modified_hidden_verts[vert_indices[i]]) { if (data->rebuild) { BKE_pbvh_node_mark_update_visibility(node); } @@ -755,7 +755,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase BKE_sculpt_update_object_for_edit(depsgraph, ob, true, need_mask, false); - SCULPT_visibility_sync_all_face_sets_to_vertices(ob); + SCULPT_visibility_sync_all_face_sets_to_verts(ob); BKE_pbvh_update_vertex_data(ss->pbvh, PBVH_UpdateVisibility); @@ -790,9 +790,9 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase /* The PBVH already keeps track of which vertices need updated normals, but it doesn't keep track * of other updated. In order to tell the corresponding PBVH nodes to update, keep track of which * elements were updated for specific layers. */ - bool *modified_hidden_vertices = NULL; - bool *modified_mask_vertices = NULL; - bool *modified_color_vertices = NULL; + bool *modified_hidden_verts = NULL; + bool *modified_mask_verts = NULL; + bool *modified_color_verts = NULL; char *undo_modified_grids = NULL; bool use_multires_undo = false; @@ -825,19 +825,19 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase } break; case SCULPT_UNDO_HIDDEN: - if (modified_hidden_vertices == NULL) { - modified_hidden_vertices = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); + if (modified_hidden_verts == NULL) { + modified_hidden_verts = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); } - if (sculpt_undo_restore_hidden(C, unode, modified_hidden_vertices)) { + if (sculpt_undo_restore_hidden(C, unode, modified_hidden_verts)) { rebuild = true; update_visibility = true; } break; case SCULPT_UNDO_MASK: - if (modified_mask_vertices == NULL) { - modified_mask_vertices = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); + if (modified_mask_verts == NULL) { + modified_mask_verts = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); } - if (sculpt_undo_restore_mask(C, unode, modified_mask_vertices)) { + if (sculpt_undo_restore_mask(C, unode, modified_mask_verts)) { update = true; update_mask = true; } @@ -845,10 +845,10 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase case SCULPT_UNDO_FACE_SETS: break; case SCULPT_UNDO_COLOR: - if (modified_color_vertices == NULL) { - modified_color_vertices = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); + if (modified_color_verts == NULL) { + modified_color_verts = MEM_calloc_arrayN(ss->totvert, sizeof(bool), __func__); } - if (sculpt_undo_restore_color(C, unode, modified_color_vertices)) { + if (sculpt_undo_restore_color(C, unode, modified_color_verts)) { update = true; } @@ -899,9 +899,9 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase .rebuild = rebuild, .pbvh = ss->pbvh, .modified_grids = undo_modified_grids, - .modified_hidden_vertices = modified_hidden_vertices, - .modified_mask_vertices = modified_mask_vertices, - .modified_color_vertices = modified_color_vertices, + .modified_hidden_verts = modified_hidden_verts, + .modified_mask_verts = modified_mask_verts, + .modified_color_verts = modified_color_verts, }; BKE_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb_partial, &data); BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw); @@ -947,9 +947,9 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase } } - MEM_SAFE_FREE(modified_hidden_vertices); - MEM_SAFE_FREE(modified_mask_vertices); - MEM_SAFE_FREE(modified_color_vertices); + MEM_SAFE_FREE(modified_hidden_verts); + MEM_SAFE_FREE(modified_mask_verts); + MEM_SAFE_FREE(modified_color_verts); MEM_SAFE_FREE(undo_modified_grids); } diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc index 0f872d0a02e..a796ed5a817 100644 --- a/source/blender/editors/space_info/info_stats.cc +++ b/source/blender/editors/space_info/info_stats.cc @@ -345,7 +345,7 @@ static void stats_object_sculpt(const Object *ob, SceneStats *stats) stats->tottri = ob->sculpt->bm->totface; break; case PBVH_GRIDS: - stats->totvertsculpt = BKE_pbvh_get_grid_num_vertices(ss->pbvh); + stats->totvertsculpt = BKE_pbvh_get_grid_num_verts(ss->pbvh); stats->totfacesculpt = BKE_pbvh_get_grid_num_faces(ss->pbvh); break; } diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index 2424ea5b5d7..ad816f420fe 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -364,22 +364,22 @@ static bool edbm_backbuf_check_and_select_faces_obmode(Mesh *me, EditSelectBuf_Cache *esel, const eSelectOp sel_op) { - MPoly *polygons = BKE_mesh_polys_for_write(me); + MPoly *polys = BKE_mesh_polys_for_write(me); bool changed = false; const BLI_bitmap *select_bitmap = esel->select_bitmap; - if (polygons) { + if (polys) { const bool *hide_poly = (const bool *)CustomData_get_layer_named( &me->vdata, CD_PROP_BOOL, ".hide_poly"); for (int index = 0; index < me->totpoly; index++) { if (!(hide_poly && hide_poly[index])) { - const bool is_select = polygons[index].flag & ME_FACE_SEL; + const bool is_select = polys[index].flag & ME_FACE_SEL; const bool is_inside = BLI_BITMAP_TEST_BOOL(select_bitmap, index); const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside); if (sel_op_result != -1) { - SET_FLAG_FROM_TEST(polygons[index].flag, sel_op_result, ME_FACE_SEL); + SET_FLAG_FROM_TEST(polys[index].flag, sel_op_result, ME_FACE_SEL); changed = true; } } @@ -3434,7 +3434,8 @@ static bool do_mesh_box_select(ViewContext *vc, } if (ts->selectmode & SCE_SELECT_EDGE) { /* Does both use_zbuf and non-use_zbuf versions (need screen cos for both) */ - struct BoxSelectUserData_ForMeshEdge cb_data {}; + struct BoxSelectUserData_ForMeshEdge cb_data { + }; cb_data.data = &data; cb_data.esel = use_zbuf ? esel : nullptr; cb_data.backbuf_offset = use_zbuf ? DRW_select_buffer_context_offset_for_object_elem( diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 0b035a08433..d2fc5a698bc 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -576,7 +576,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) mesh->totloop = group->totloop; mesh->totcol = group->materials.size(); - MVert *vertices = (MVert *)CustomData_add_layer( + MVert *verts = (MVert *)CustomData_add_layer( &mesh->vdata, CD_MVERT, CD_SET_DEFAULT, nullptr, mesh->totvert); MEdge *edges = (MEdge *)CustomData_add_layer( &mesh->edata, CD_MEDGE, CD_SET_DEFAULT, nullptr, mesh->totedge); @@ -663,19 +663,19 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) else { if (!visible) { // first vertex - vertices->co[0] = svRep[0]->point2d()[0]; - vertices->co[1] = svRep[0]->point2d()[1]; - vertices->co[2] = get_stroke_vertex_z(); + verts->co[0] = svRep[0]->point2d()[0]; + verts->co[1] = svRep[0]->point2d()[1]; + verts->co[2] = get_stroke_vertex_z(); - ++vertices; + ++verts; ++vertex_index; // second vertex - vertices->co[0] = svRep[1]->point2d()[0]; - vertices->co[1] = svRep[1]->point2d()[1]; - vertices->co[2] = get_stroke_vertex_z(); + verts->co[0] = svRep[1]->point2d()[0]; + verts->co[1] = svRep[1]->point2d()[1]; + verts->co[2] = get_stroke_vertex_z(); - ++vertices; + ++verts; ++vertex_index; // first edge @@ -687,10 +687,10 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) visible = true; // vertex - vertices->co[0] = svRep[2]->point2d()[0]; - vertices->co[1] = svRep[2]->point2d()[1]; - vertices->co[2] = get_stroke_vertex_z(); - ++vertices; + verts->co[0] = svRep[2]->point2d()[0]; + verts->co[1] = svRep[2]->point2d()[1]; + verts->co[2] = get_stroke_vertex_z(); + ++verts; ++vertex_index; // edges diff --git a/source/blender/geometry/intern/mesh_primitive_cuboid.cc b/source/blender/geometry/intern/mesh_primitive_cuboid.cc index 528a9e72e9e..ad41cbd259d 100644 --- a/source/blender/geometry/intern/mesh_primitive_cuboid.cc +++ b/source/blender/geometry/intern/mesh_primitive_cuboid.cc @@ -54,7 +54,7 @@ struct CuboidConfig { } }; -static void calculate_vertices(const CuboidConfig &config, MutableSpan<MVert> verts) +static void calculate_verts(const CuboidConfig &config, MutableSpan<MVert> verts) { const float z_bottom = -config.size.z / 2.0f; const float z_delta = config.size.z / config.edges_z; @@ -409,7 +409,7 @@ Mesh *create_cuboid_mesh(const float3 &size, MutableSpan<MPoly> polys = mesh->polys_for_write(); MutableSpan<MLoop> loops = mesh->loops_for_write(); - calculate_vertices(config, verts); + calculate_verts(config, verts); calculate_polys(config, polys, loops); BKE_mesh_calc_edges(mesh, false, false); diff --git a/source/blender/geometry/intern/mesh_to_volume.cc b/source/blender/geometry/intern/mesh_to_volume.cc index 0c0d550fc99..b1c7be38609 100644 --- a/source/blender/geometry/intern/mesh_to_volume.cc +++ b/source/blender/geometry/intern/mesh_to_volume.cc @@ -16,7 +16,7 @@ namespace blender::geometry { /* This class follows the MeshDataAdapter interface from openvdb. */ class OpenVDBMeshAdapter { private: - Span<MVert> vertices_; + Span<MVert> verts_; Span<MLoop> loops_; Span<MLoopTri> looptris_; float4x4 transform_; @@ -30,7 +30,7 @@ class OpenVDBMeshAdapter { }; OpenVDBMeshAdapter::OpenVDBMeshAdapter(const Mesh &mesh, float4x4 transform) - : vertices_(mesh.verts()), loops_(mesh.loops()), transform_(transform) + : verts_(mesh.verts()), loops_(mesh.loops()), transform_(transform) { /* This only updates a cache and can be considered to be logically const. */ const MLoopTri *looptris = BKE_mesh_runtime_looptri_ensure(&mesh); @@ -45,7 +45,7 @@ size_t OpenVDBMeshAdapter::polygonCount() const size_t OpenVDBMeshAdapter::pointCount() const { - return static_cast<size_t>(vertices_.size()); + return static_cast<size_t>(verts_.size()); } size_t OpenVDBMeshAdapter::vertexCount(size_t UNUSED(polygon_index)) const @@ -59,7 +59,7 @@ void OpenVDBMeshAdapter::getIndexSpacePoint(size_t polygon_index, openvdb::Vec3d &pos) const { const MLoopTri &looptri = looptris_[polygon_index]; - const MVert &vertex = vertices_[loops_[looptri.tri[vertex_index]].v]; + const MVert &vertex = verts_[loops_[looptri.tri[vertex_index]].v]; const float3 transformed_co = transform_ * float3(vertex.co); pos = &transformed_co.x; } diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 64f1087a5de..5494bfaa6e8 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -57,7 +57,7 @@ static void get_uvs(const CDStreamConfig &config, } const int num_poly = config.totpoly; - MPoly *polygons = config.mpoly; + MPoly *mpoly = config.mpoly; MLoop *mloop = config.mloop; if (!config.pack_uvs) { @@ -67,7 +67,7 @@ static void get_uvs(const CDStreamConfig &config, /* Iterate in reverse order to match exported polygons. */ for (int i = 0; i < num_poly; i++) { - MPoly ¤t_poly = polygons[i]; + MPoly ¤t_poly = mpoly[i]; const MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop; for (int j = 0; j < current_poly.totloop; j++, count++) { @@ -85,7 +85,7 @@ static void get_uvs(const CDStreamConfig &config, int idx_count = 0; for (int i = 0; i < num_poly; i++) { - MPoly ¤t_poly = polygons[i]; + MPoly ¤t_poly = mpoly[i]; MLoop *looppoly = mloop + current_poly.loopstart + current_poly.totloop; const MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop; diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index c80d580eb32..d0c2063b7e6 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -310,7 +310,7 @@ static void process_vertex_normals(CDStreamConfig &config, } config.mesh->flag |= ME_AUTOSMOOTH; - BKE_mesh_set_custom_normals_from_vertices(config.mesh, vnors); + BKE_mesh_set_custom_normals_from_verts(config.mesh, vnors); MEM_freeN(vnors); } diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc index cd724152b05..7f421b010b7 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc @@ -242,8 +242,8 @@ const Material *OBJMesh::get_object_material(const int16_t mat_nr) const bool OBJMesh::is_ith_poly_smooth(const int poly_index) const { - const Span<MPoly> polygons = export_mesh_eval_->polys(); - return polygons[poly_index].flag & ME_SMOOTH; + const Span<MPoly> polys = export_mesh_eval_->polys(); + return polys[poly_index].flag & ME_SMOOTH; } const char *OBJMesh::get_object_name() const @@ -317,7 +317,7 @@ void OBJMesh::store_uv_coords_and_indices() if (uv_vert->separate) { tot_uv_vertices_ += 1; } - const int vertices_in_poly = polys[uv_vert->poly_index].totloop; + const int verts_in_poly = polys[uv_vert->poly_index].totloop; /* Store UV vertex coordinates. */ uv_coords_.resize(tot_uv_vertices_); @@ -326,7 +326,7 @@ void OBJMesh::store_uv_coords_and_indices() uv_coords_[tot_uv_vertices_ - 1] = float2(vert_uv_coords[0], vert_uv_coords[1]); /* Store UV vertex indices. */ - uv_indices_[uv_vert->poly_index].resize(vertices_in_poly); + uv_indices_[uv_vert->poly_index].resize(verts_in_poly); /* Keep indices zero-based and let the writer handle the "+ 1" as per OBJ spec. */ uv_indices_[uv_vert->poly_index][uv_vert->loop_of_poly_index] = tot_uv_vertices_ - 1; } diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 3635759ad4d..7551f9d7096 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -102,10 +102,10 @@ static void rna_Mesh_calc_smooth_groups( static void rna_Mesh_normals_split_custom_do(Mesh *mesh, float (*custom_loopnors)[3], - const bool use_vertices) + const bool use_verts) { - if (use_vertices) { - BKE_mesh_set_custom_normals_from_vertices(mesh, custom_loopnors); + if (use_verts) { + BKE_mesh_set_custom_normals_from_verts(mesh, custom_loopnors); } else { BKE_mesh_set_custom_normals(mesh, custom_loopnors); @@ -165,7 +165,7 @@ static void rna_Mesh_transform(Mesh *mesh, float mat[16], bool shape_keys) static void rna_Mesh_flip_normals(Mesh *mesh) { - BKE_mesh_polygons_flip( + BKE_mesh_polys_flip( BKE_mesh_polys(mesh), BKE_mesh_loops_for_write(mesh), &mesh->ldata, mesh->totpoly); BKE_mesh_tessface_clear(mesh); BKE_mesh_normals_tag_dirty(mesh); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index cd2434ff5be..40e7f6e65c2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -212,10 +212,10 @@ static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *valu if (pa) { Mesh *hair_mesh = (psmd->psys->flag & PSYS_HAIR_DYNAMICS) ? psmd->psys->hair_out_mesh : NULL; - const MVert *vertices = BKE_mesh_verts(hair_mesh); + const MVert *verts = BKE_mesh_verts(hair_mesh); if (hair_mesh) { - const MVert *mvert = &vertices[pa->hair_index + (hkey - pa->hair)]; - copy_v3_v3(values, mvert->co); + const MVert *mv = &verts[pa->hair_index + (hkey - pa->hair)]; + copy_v3_v3(values, mv->co); } else { float hairmat[4][4]; @@ -279,9 +279,9 @@ static void hair_key_location_object_set(HairKey *hair_key, if (hair_key_index == -1) { return; } - MVert *vertices = BKE_mesh_verts_for_write(hair_mesh); - MVert *mvert = &vertices[particle->hair_index + (hair_key_index)]; - copy_v3_v3(mvert->co, src_co); + MVert *verts = BKE_mesh_verts_for_write(hair_mesh); + MVert *mv = &verts[particle->hair_index + (hair_key_index)]; + copy_v3_v3(mv->co, src_co); return; } @@ -324,9 +324,9 @@ static void rna_ParticleHairKey_co_object(HairKey *hairkey, NULL; if (particle) { if (hair_mesh) { - const MVert *vertices = BKE_mesh_verts(hair_mesh); - const MVert *mvert = &vertices[particle->hair_index + (hairkey - particle->hair)]; - copy_v3_v3(n_co, mvert->co); + const MVert *verts = BKE_mesh_verts(hair_mesh); + const MVert *mv = &verts[particle->hair_index + (hairkey - particle->hair)]; + copy_v3_v3(n_co, mv->co); } else { float hairmat[4][4]; 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); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc index 1c8a34dab1f..82a6504cf4e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_delete_geometry.cc @@ -176,9 +176,9 @@ static void copy_face_corner_attributes(const Map<AttributeIDRef, AttributeKind> attributes, src_attributes, dst_attributes, ATTR_DOMAIN_CORNER, IndexMask(indices)); } -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(); @@ -239,16 +239,16 @@ static void copy_masked_polys_to_new_mesh(const Mesh &src_mesh, Span<int> masked_poly_indices, Span<int> new_loop_starts) { - const Span<MPoly> src_polygons = src_mesh.polys(); + const Span<MPoly> src_polys = src_mesh.polys(); const Span<MLoop> src_loops = src_mesh.loops(); - MutableSpan<MPoly> dst_polygons = dst_mesh.polys_for_write(); + MutableSpan<MPoly> dst_polys = dst_mesh.polys_for_write(); MutableSpan<MLoop> dst_loops = dst_mesh.loops_for_write(); for (const int i_dst : masked_poly_indices.index_range()) { const int i_src = masked_poly_indices[i_dst]; - const MPoly &mp_src = src_polygons[i_src]; - MPoly &mp_dst = dst_polygons[i_dst]; + const MPoly &mp_src = src_polys[i_src]; + MPoly &mp_dst = dst_polys[i_dst]; const int i_ml_src = mp_src.loopstart; const int i_ml_dst = new_loop_starts[i_dst]; @@ -270,16 +270,16 @@ static void copy_masked_polys_to_new_mesh(const Mesh &src_mesh, Span<int> masked_poly_indices, Span<int> new_loop_starts) { - const Span<MPoly> src_polygons = src_mesh.polys(); + const Span<MPoly> src_polys = src_mesh.polys(); const Span<MLoop> src_loops = src_mesh.loops(); - MutableSpan<MPoly> dst_polygons = dst_mesh.polys_for_write(); + MutableSpan<MPoly> dst_polys = dst_mesh.polys_for_write(); MutableSpan<MLoop> dst_loops = dst_mesh.loops_for_write(); for (const int i_dst : masked_poly_indices.index_range()) { const int i_src = masked_poly_indices[i_dst]; - const MPoly &mp_src = src_polygons[i_src]; - MPoly &mp_dst = dst_polygons[i_dst]; + const MPoly &mp_src = src_polys[i_src]; + MPoly &mp_dst = dst_polys[i_dst]; const int i_ml_src = mp_src.loopstart; const int i_ml_dst = new_loop_starts[i_dst]; @@ -302,16 +302,16 @@ static void copy_masked_polys_to_new_mesh(const Mesh &src_mesh, Span<int> masked_poly_indices, Span<int> new_loop_starts) { - const Span<MPoly> src_polygons = src_mesh.polys(); + const Span<MPoly> src_polys = src_mesh.polys(); const Span<MLoop> src_loops = src_mesh.loops(); - MutableSpan<MPoly> dst_polygons = dst_mesh.polys_for_write(); + MutableSpan<MPoly> dst_polys = dst_mesh.polys_for_write(); MutableSpan<MLoop> dst_loops = dst_mesh.loops_for_write(); for (const int i_dst : masked_poly_indices.index_range()) { const int i_src = masked_poly_indices[i_dst]; - const MPoly &mp_src = src_polygons[i_src]; - MPoly &mp_dst = dst_polygons[i_dst]; + const MPoly &mp_src = src_polys[i_src]; + MPoly &mp_dst = dst_polys[i_dst]; const int i_ml_src = mp_src.loopstart; const int i_ml_dst = new_loop_starts[i_dst]; @@ -407,9 +407,9 @@ static void delete_selected_instances(GeometrySet &geometry_set, instances.remove_instances(selection); } -static void compute_selected_vertices_from_vertex_selection(const Span<bool> vertex_selection, - MutableSpan<int> r_vertex_map, - int *r_selected_vertices_num) +static void compute_selected_verts_from_vertex_selection(const Span<bool> vertex_selection, + MutableSpan<int> r_vertex_map, + int *r_selected_verts_num) { BLI_assert(vertex_selection.size() == r_vertex_map.size()); @@ -424,7 +424,7 @@ static void compute_selected_vertices_from_vertex_selection(const Span<bool> ver } } - *r_selected_vertices_num = selected_verts_num; + *r_selected_verts_num = selected_verts_num; } static void compute_selected_edges_from_vertex_selection(const Mesh &mesh, @@ -452,12 +452,12 @@ static void compute_selected_edges_from_vertex_selection(const Mesh &mesh, *r_selected_edges_num = selected_edges_num; } -static void compute_selected_polygons_from_vertex_selection(const Mesh &mesh, - const Span<bool> vertex_selection, - Vector<int> &r_selected_poly_indices, - Vector<int> &r_loop_starts, - int *r_selected_polys_num, - int *r_selected_loops_num) +static void compute_selected_polys_from_vertex_selection(const Mesh &mesh, + const Span<bool> vertex_selection, + Vector<int> &r_selected_poly_indices, + Vector<int> &r_loop_starts, + int *r_selected_polys_num, + int *r_selected_loops_num) { BLI_assert(mesh.totvert == vertex_selection.size()); const Span<MPoly> polys = mesh.polys(); @@ -494,13 +494,12 @@ static void compute_selected_polygons_from_vertex_selection(const Mesh &mesh, * Checks for every edge if it is in `edge_selection`. If it is, then the two vertices of the * edge are kept along with the edge. */ -static void compute_selected_vertices_and_edges_from_edge_selection( - const Mesh &mesh, - const Span<bool> edge_selection, - MutableSpan<int> r_vertex_map, - MutableSpan<int> r_edge_map, - int *r_selected_vertices_num, - int *r_selected_edges_num) +static void compute_selected_verts_and_edges_from_edge_selection(const Mesh &mesh, + const Span<bool> edge_selection, + MutableSpan<int> r_vertex_map, + MutableSpan<int> r_edge_map, + int *r_selected_verts_num, + int *r_selected_edges_num) { BLI_assert(mesh.totedge == edge_selection.size()); const Span<MEdge> edges = mesh.edges(); @@ -526,7 +525,7 @@ static void compute_selected_vertices_and_edges_from_edge_selection( } } - *r_selected_vertices_num = selected_verts_num; + *r_selected_verts_num = selected_verts_num; *r_selected_edges_num = selected_edges_num; } @@ -558,12 +557,12 @@ static void compute_selected_edges_from_edge_selection(const Mesh &mesh, * Checks for every polygon if all the edges are in `edge_selection`. If they are, then that * polygon is kept. */ -static void compute_selected_polygons_from_edge_selection(const Mesh &mesh, - const Span<bool> edge_selection, - Vector<int> &r_selected_poly_indices, - Vector<int> &r_loop_starts, - int *r_selected_polys_num, - int *r_selected_loops_num) +static void compute_selected_polys_from_edge_selection(const Mesh &mesh, + const Span<bool> edge_selection, + Vector<int> &r_selected_poly_indices, + Vector<int> &r_loop_starts, + int *r_selected_polys_num, + int *r_selected_loops_num) { const Span<MPoly> polys = mesh.polys(); const Span<MLoop> loops = mesh.loops(); @@ -612,12 +611,12 @@ static void compute_selected_mesh_data_from_vertex_selection_edge_face( compute_selected_edges_from_vertex_selection( mesh, vertex_selection, r_edge_map, r_selected_edges_num); - compute_selected_polygons_from_vertex_selection(mesh, - vertex_selection, - r_selected_poly_indices, - r_loop_starts, - r_selected_polys_num, - r_selected_loops_num); + compute_selected_polys_from_vertex_selection(mesh, + vertex_selection, + r_selected_poly_indices, + r_loop_starts, + r_selected_polys_num, + r_selected_loops_num); } /** @@ -630,23 +629,23 @@ static void compute_selected_mesh_data_from_vertex_selection(const Mesh &mesh, MutableSpan<int> r_edge_map, Vector<int> &r_selected_poly_indices, Vector<int> &r_loop_starts, - int *r_selected_vertices_num, + int *r_selected_verts_num, int *r_selected_edges_num, int *r_selected_polys_num, int *r_selected_loops_num) { - compute_selected_vertices_from_vertex_selection( - vertex_selection, r_vertex_map, r_selected_vertices_num); + compute_selected_verts_from_vertex_selection( + vertex_selection, r_vertex_map, r_selected_verts_num); compute_selected_edges_from_vertex_selection( mesh, vertex_selection, r_edge_map, r_selected_edges_num); - compute_selected_polygons_from_vertex_selection(mesh, - vertex_selection, - r_selected_poly_indices, - r_loop_starts, - r_selected_polys_num, - r_selected_loops_num); + compute_selected_polys_from_vertex_selection(mesh, + vertex_selection, + r_selected_poly_indices, + r_loop_starts, + r_selected_polys_num, + r_selected_loops_num); } /** @@ -665,12 +664,12 @@ static void compute_selected_mesh_data_from_edge_selection_edge_face( { compute_selected_edges_from_edge_selection( mesh, edge_selection, r_edge_map, r_selected_edges_num); - compute_selected_polygons_from_edge_selection(mesh, - edge_selection, - r_selected_poly_indices, - r_loop_starts, - r_selected_polys_num, - r_selected_loops_num); + compute_selected_polys_from_edge_selection(mesh, + edge_selection, + r_selected_poly_indices, + r_loop_starts, + r_selected_polys_num, + r_selected_loops_num); } /** @@ -683,35 +682,31 @@ static void compute_selected_mesh_data_from_edge_selection(const Mesh &mesh, MutableSpan<int> r_edge_map, Vector<int> &r_selected_poly_indices, Vector<int> &r_loop_starts, - int *r_selected_vertices_num, + int *r_selected_verts_num, int *r_selected_edges_num, int *r_selected_polys_num, int *r_selected_loops_num) { r_vertex_map.fill(-1); - compute_selected_vertices_and_edges_from_edge_selection(mesh, - edge_selection, - r_vertex_map, - r_edge_map, - r_selected_vertices_num, - r_selected_edges_num); - compute_selected_polygons_from_edge_selection(mesh, - edge_selection, - r_selected_poly_indices, - r_loop_starts, - r_selected_polys_num, - r_selected_loops_num); + compute_selected_verts_and_edges_from_edge_selection( + mesh, edge_selection, r_vertex_map, r_edge_map, r_selected_verts_num, r_selected_edges_num); + compute_selected_polys_from_edge_selection(mesh, + edge_selection, + r_selected_poly_indices, + r_loop_starts, + r_selected_polys_num, + r_selected_loops_num); } /** * Checks for every polygon if it is in `poly_selection`. */ -static void compute_selected_polygons_from_poly_selection(const Mesh &mesh, - const Span<bool> poly_selection, - Vector<int> &r_selected_poly_indices, - Vector<int> &r_loop_starts, - int *r_selected_polys_num, - int *r_selected_loops_num) +static void compute_selected_polys_from_poly_selection(const Mesh &mesh, + const Span<bool> poly_selection, + Vector<int> &r_selected_poly_indices, + Vector<int> &r_loop_starts, + int *r_selected_polys_num, + int *r_selected_loops_num) { BLI_assert(mesh.totpoly == poly_selection.size()); const Span<MPoly> polys = mesh.polys(); @@ -792,7 +787,7 @@ static void compute_selected_mesh_data_from_poly_selection(const Mesh &mesh, MutableSpan<int> r_edge_map, Vector<int> &r_selected_poly_indices, Vector<int> &r_loop_starts, - int *r_selected_vertices_num, + int *r_selected_verts_num, int *r_selected_edges_num, int *r_selected_polys_num, int *r_selected_loops_num) @@ -834,7 +829,7 @@ static void compute_selected_mesh_data_from_poly_selection(const Mesh &mesh, } } } - *r_selected_vertices_num = selected_verts_num; + *r_selected_verts_num = selected_verts_num; *r_selected_edges_num = selected_edges_num; *r_selected_polys_num = r_selected_poly_indices.size(); *r_selected_loops_num = selected_loops_num; @@ -919,7 +914,7 @@ static void do_mesh_separation(GeometrySet &geometry_set, selected_polys_num); /* Copy the selected parts of the mesh over to the new mesh. */ - copy_masked_vertices_to_new_mesh(mesh_in, *mesh_out, vertex_map); + copy_masked_verts_to_new_mesh(mesh_in, *mesh_out, vertex_map); copy_masked_edges_to_new_mesh(mesh_in, *mesh_out, vertex_map, edge_map); copy_masked_polys_to_new_mesh( mesh_in, *mesh_out, vertex_map, edge_map, selected_poly_indices, new_loop_starts); @@ -1028,28 +1023,28 @@ static void do_mesh_separation(GeometrySet &geometry_set, /* Fill all the maps based on the selection. */ switch (domain) { case ATTR_DOMAIN_POINT: - compute_selected_polygons_from_vertex_selection(mesh_in, - selection, - selected_poly_indices, - new_loop_starts, - &selected_polys_num, - &selected_loops_num); + compute_selected_polys_from_vertex_selection(mesh_in, + selection, + selected_poly_indices, + new_loop_starts, + &selected_polys_num, + &selected_loops_num); break; case ATTR_DOMAIN_EDGE: - compute_selected_polygons_from_edge_selection(mesh_in, - selection, - selected_poly_indices, - new_loop_starts, - &selected_polys_num, - &selected_loops_num); + compute_selected_polys_from_edge_selection(mesh_in, + selection, + selected_poly_indices, + new_loop_starts, + &selected_polys_num, + &selected_loops_num); break; case ATTR_DOMAIN_FACE: - compute_selected_polygons_from_poly_selection(mesh_in, - selection, - selected_poly_indices, - new_loop_starts, - &selected_polys_num, - &selected_loops_num); + compute_selected_polys_from_poly_selection(mesh_in, + selection, + selected_poly_indices, + new_loop_starts, + &selected_polys_num, + &selected_loops_num); break; default: BLI_assert_unreachable(); diff --git a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc index 7d81ee91a1c..861711e06cc 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc @@ -263,10 +263,10 @@ static void calc_boundaries(const Mesh &mesh, static void create_vertex_poly_map(const Mesh &mesh, MutableSpan<Vector<int>> r_vertex_poly_indices) { - const Span<MPoly> polygons = mesh.polys(); + const Span<MPoly> polys = mesh.polys(); const Span<MLoop> loops = mesh.loops(); - for (const int i : polygons.index_range()) { - const MPoly &poly = polygons[i]; + for (const int i : polys.index_range()) { + const MPoly &poly = polys[i]; const Span<MLoop> poly_loops = loops.slice(poly.loopstart, poly.totloop); for (const MLoop &loop : poly_loops) { r_vertex_poly_indices[loop.v].append(i); @@ -335,18 +335,18 @@ static bool sort_vertex_polys(const Span<MEdge> edges, const int vertex_index, const bool boundary_vertex, const Span<EdgeType> edge_types, - MutableSpan<int> connected_polygons, + MutableSpan<int> connected_polys, MutableSpan<int> r_shared_edges, MutableSpan<int> r_sorted_corners) { - if (connected_polygons.size() <= 2 && (!boundary_vertex || connected_polygons.size() == 0)) { + if (connected_polys.size() <= 2 && (!boundary_vertex || connected_polys.size() == 0)) { return true; } /* For each polygon store the two corners whose edge contains the vertex. */ - Array<std::pair<int, int>> poly_vertex_corners(connected_polygons.size()); - for (const int i : connected_polygons.index_range()) { - const MPoly &poly = polys[connected_polygons[i]]; + Array<std::pair<int, int>> poly_vertex_corners(connected_polys.size()); + for (const int i : connected_polys.index_range()) { + const MPoly &poly = polys[connected_polys[i]]; bool first_edge_done = false; for (const int loop_index : IndexRange(poly.loopstart, poly.totloop)) { const MLoop &loop = loops[loop_index]; @@ -369,20 +369,20 @@ static bool sort_vertex_polys(const Span<MEdge> edges, * the loop to determine the 'average' orientation. */ if (boundary_vertex) { /* Our first polygon needs to be one which has a boundary edge. */ - for (const int i : connected_polygons.index_range()) { + for (const int i : connected_polys.index_range()) { const MLoop &first_loop = loops[poly_vertex_corners[i].first]; const MLoop &second_loop = loops[poly_vertex_corners[i].second]; if (edge_types[first_loop.e] == EdgeType::Boundary && first_loop.v == vertex_index) { shared_edge_i = second_loop.e; r_sorted_corners[0] = poly_vertex_corners[i].first; - std::swap(connected_polygons[i], connected_polygons[0]); + std::swap(connected_polys[i], connected_polys[0]); std::swap(poly_vertex_corners[i], poly_vertex_corners[0]); break; } if (edge_types[second_loop.e] == EdgeType::Boundary && second_loop.v == vertex_index) { shared_edge_i = first_loop.e; r_sorted_corners[0] = poly_vertex_corners[i].second; - std::swap(connected_polygons[i], connected_polygons[0]); + std::swap(connected_polys[i], connected_polys[0]); std::swap(poly_vertex_corners[i], poly_vertex_corners[0]); break; } @@ -390,20 +390,20 @@ static bool sort_vertex_polys(const Span<MEdge> edges, if (shared_edge_i == -1) { /* The rotation is inconsistent between the two polygons on the boundary. Just choose one * of the polygon's orientation. */ - for (const int i : connected_polygons.index_range()) { + for (const int i : connected_polys.index_range()) { const MLoop &first_loop = loops[poly_vertex_corners[i].first]; const MLoop &second_loop = loops[poly_vertex_corners[i].second]; if (edge_types[first_loop.e] == EdgeType::Boundary) { shared_edge_i = second_loop.e; r_sorted_corners[0] = poly_vertex_corners[i].first; - std::swap(connected_polygons[i], connected_polygons[0]); + std::swap(connected_polys[i], connected_polys[0]); std::swap(poly_vertex_corners[i], poly_vertex_corners[0]); break; } if (edge_types[second_loop.e] == EdgeType::Boundary) { shared_edge_i = first_loop.e; r_sorted_corners[0] = poly_vertex_corners[i].second; - std::swap(connected_polygons[i], connected_polygons[0]); + std::swap(connected_polys[i], connected_polys[0]); std::swap(poly_vertex_corners[i], poly_vertex_corners[0]); break; } @@ -425,12 +425,12 @@ static bool sort_vertex_polys(const Span<MEdge> edges, } BLI_assert(shared_edge_i != -1); - for (const int i : IndexRange(connected_polygons.size() - 1)) { + for (const int i : IndexRange(connected_polys.size() - 1)) { r_shared_edges[i] = shared_edge_i; /* Look at the other polys to see if it has this shared edge. */ int j = i + 1; - for (; j < connected_polygons.size(); ++j) { + for (; j < connected_polys.size(); ++j) { const MLoop &first_loop = loops[poly_vertex_corners[j].first]; const MLoop &second_loop = loops[poly_vertex_corners[j].second]; if (first_loop.e == shared_edge_i) { @@ -444,13 +444,13 @@ static bool sort_vertex_polys(const Span<MEdge> edges, break; } } - if (j == connected_polygons.size()) { + if (j == connected_polys.size()) { /* The vertex is not manifold because the polygons around the vertex don't form a loop, and * hence can't be sorted. */ return false; } - std::swap(connected_polygons[i + 1], connected_polygons[j]); + std::swap(connected_polys[i + 1], connected_polys[j]); std::swap(poly_vertex_corners[i + 1], poly_vertex_corners[j]); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc index ac66e3906a7..483a535dfa7 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc @@ -59,9 +59,9 @@ class PathToEdgeSelectionFieldInput final : public bke::MeshFieldInput { Field<int> next_vertex_; public: - PathToEdgeSelectionFieldInput(Field<bool> start_vertices, Field<int> next_vertex) + PathToEdgeSelectionFieldInput(Field<bool> start_verts, Field<int> next_vertex) : bke::MeshFieldInput(CPPType::get<bool>(), "Edge Selection"), - start_vertices_(start_vertices), + start_vertices_(start_verts), next_vertex_(next_vertex) { category_ = Category::Generated; @@ -110,10 +110,10 @@ class PathToEdgeSelectionFieldInput final : public bke::MeshFieldInput { static void node_geo_exec(GeoNodeExecParams params) { - Field<bool> start_vertices = params.extract_input<Field<bool>>("Start Vertices"); + Field<bool> start_verts = params.extract_input<Field<bool>>("Start Vertices"); Field<int> next_vertex = params.extract_input<Field<int>>("Next Vertex Index"); Field<bool> selection_field{ - std::make_shared<PathToEdgeSelectionFieldInput>(start_vertices, next_vertex)}; + std::make_shared<PathToEdgeSelectionFieldInput>(start_verts, next_vertex)}; params.set_output("Selection", std::move(selection_field)); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc index 50ebf78e58f..597400c1751 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc @@ -27,9 +27,9 @@ static void node_declare(NodeDeclarationBuilder &b) enum VertexNumber { VERTEX_ONE, VERTEX_TWO }; -static VArray<int> construct_edge_vertices_gvarray(const Mesh &mesh, - const VertexNumber vertex, - const eAttrDomain domain) +static VArray<int> construct_edge_verts_gvarray(const Mesh &mesh, + const VertexNumber vertex, + const eAttrDomain domain) { const Span<MEdge> edges = mesh.edges(); if (domain == ATTR_DOMAIN_EDGE) { @@ -57,7 +57,7 @@ class EdgeVerticesFieldInput final : public bke::MeshFieldInput { const eAttrDomain domain, IndexMask UNUSED(mask)) const final { - return construct_edge_vertices_gvarray(mesh, vertex_, domain); + return construct_edge_verts_gvarray(mesh, vertex_, domain); } uint64_t hash() const override diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc index 93ecc96337e..20e805ab4e1 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc @@ -255,7 +255,7 @@ int ConeConfig::calculate_total_corners() return corner_total; } -static void calculate_cone_vertices(const MutableSpan<MVert> &verts, const ConeConfig &config) +static void calculate_cone_verts(const MutableSpan<MVert> &verts, const ConeConfig &config) { Array<float2> circle(config.circle_segments); const float angle_delta = 2.0f * (M_PI / static_cast<float>(config.circle_segments)); @@ -694,7 +694,7 @@ Mesh *create_cylinder_or_cone_mesh(const float radius_top, MutableSpan<MPoly> polys = mesh->polys_for_write(); MutableSpan<MLoop> loops = mesh->loops_for_write(); - calculate_cone_vertices(verts, config); + calculate_cone_verts(verts, config); calculate_cone_edges(edges, config); calculate_cone_faces(loops, polys, config); calculate_cone_uvs(mesh, config); diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc index b2f629806cd..4fd6399f4eb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc @@ -179,15 +179,15 @@ Mesh *create_line_mesh(const float3 start, const float3 delta, const int count) Mesh *mesh = BKE_mesh_new_nomain(count, count - 1, 0, 0, 0); BKE_id_material_eval_ensure_default_slot(&mesh->id); - MutableSpan<MVert> vertices = mesh->verts_for_write(); + MutableSpan<MVert> verts = mesh->verts_for_write(); MutableSpan<MEdge> edges = mesh->edges_for_write(); threading::parallel_invoke( 1024 < count, [&]() { - threading::parallel_for(vertices.index_range(), 4096, [&](IndexRange range) { + threading::parallel_for(verts.index_range(), 4096, [&](IndexRange range) { for (const int i : range) { - copy_v3_v3(vertices[i].co, start + delta * i); + copy_v3_v3(verts[i].co, start + delta * i); } }); }, diff --git a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc index 8fd05e70ed3..2ebbf88b8ad 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc @@ -282,11 +282,11 @@ static Vector<ElementIsland> prepare_face_islands(const Mesh &mesh, const IndexM return islands; } -static void get_face_vertices(const Span<MEdge> /*edges*/, - const Span<MPoly> polys, - const Span<MLoop> loops, - int face_index, - VectorSet<int> &r_vertex_indices) +static void get_face_verts(const Span<MEdge> /*edges*/, + const Span<MPoly> polys, + const Span<MLoop> loops, + int face_index, + VectorSet<int> &r_vertex_indices) { const MPoly &poly = polys[face_index]; const Span<MLoop> poly_loops = loops.slice(poly.loopstart, poly.totloop); @@ -315,7 +315,7 @@ static void scale_faces_on_axis(Mesh &mesh, const AxisScaleFields &fields) AxisScaleParams params = evaluate_axis_scale_fields(evaluator, fields); Vector<ElementIsland> island = prepare_face_islands(mesh, params.selection); - scale_vertex_islands_on_axis(mesh, island, params, get_face_vertices); + scale_vertex_islands_on_axis(mesh, island, params, get_face_verts); } static UniformScaleParams evaluate_uniform_scale_fields(FieldEvaluator &evaluator, @@ -337,7 +337,7 @@ static void scale_faces_uniformly(Mesh &mesh, const UniformScaleFields &fields) UniformScaleParams params = evaluate_uniform_scale_fields(evaluator, fields); Vector<ElementIsland> island = prepare_face_islands(mesh, params.selection); - scale_vertex_islands_uniformly(mesh, island, params, get_face_vertices); + scale_vertex_islands_uniformly(mesh, island, params, get_face_verts); } static Vector<ElementIsland> prepare_edge_islands(const Mesh &mesh, const IndexMask edge_selection) @@ -371,11 +371,11 @@ static Vector<ElementIsland> prepare_edge_islands(const Mesh &mesh, const IndexM return islands; } -static void get_edge_vertices(const Span<MEdge> edges, - const Span<MPoly> /*polygons*/, - const Span<MLoop> /*loops*/, - int edge_index, - VectorSet<int> &r_vertex_indices) +static void get_edge_verts(const Span<MEdge> edges, + const Span<MPoly> /*polys*/, + const Span<MLoop> /*loops*/, + int edge_index, + VectorSet<int> &r_vertex_indices) { const MEdge &edge = edges[edge_index]; r_vertex_indices.add(edge.v1); @@ -389,7 +389,7 @@ static void scale_edges_uniformly(Mesh &mesh, const UniformScaleFields &fields) UniformScaleParams params = evaluate_uniform_scale_fields(evaluator, fields); Vector<ElementIsland> island = prepare_edge_islands(mesh, params.selection); - scale_vertex_islands_uniformly(mesh, island, params, get_edge_vertices); + scale_vertex_islands_uniformly(mesh, island, params, get_edge_verts); } static void scale_edges_on_axis(Mesh &mesh, const AxisScaleFields &fields) @@ -399,7 +399,7 @@ static void scale_edges_on_axis(Mesh &mesh, const AxisScaleFields &fields) AxisScaleParams params = evaluate_axis_scale_fields(evaluator, fields); Vector<ElementIsland> island = prepare_edge_islands(mesh, params.selection); - scale_vertex_islands_on_axis(mesh, island, params, get_edge_vertices); + scale_vertex_islands_on_axis(mesh, island, params, get_edge_verts); } static void node_geo_exec(GeoNodeExecParams params) diff --git a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc index 13bfe78fbe5..76ffb3cbb52 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc @@ -235,12 +235,12 @@ static void get_closest_mesh_looptris(const Mesh &mesh, free_bvhtree_from_mesh(&tree_data); } -static void get_closest_mesh_polygons(const Mesh &mesh, - const VArray<float3> &positions, - const IndexMask mask, - const MutableSpan<int> r_poly_indices, - const MutableSpan<float> r_distances_sq, - const MutableSpan<float3> r_positions) +static void get_closest_mesh_polys(const Mesh &mesh, + const VArray<float3> &positions, + const IndexMask mask, + const MutableSpan<int> r_poly_indices, + const MutableSpan<float> r_distances_sq, + const MutableSpan<float3> r_positions) { BLI_assert(mesh.totpoly > 0); @@ -270,7 +270,7 @@ static void get_closest_mesh_corners(const Mesh &mesh, BLI_assert(mesh.totloop > 0); Array<int> poly_indices(positions.size()); - get_closest_mesh_polygons(mesh, positions, mask, poly_indices, {}, {}); + get_closest_mesh_polys(mesh, positions, mask, poly_indices, {}, {}); for (const int i : mask) { const float3 position = positions[i]; @@ -540,7 +540,7 @@ class NearestTransferFunction : public fn::MultiFunction { break; } case ATTR_DOMAIN_FACE: { - get_closest_mesh_polygons(*mesh, positions, mask, mesh_indices, mesh_distances, {}); + get_closest_mesh_polys(*mesh, positions, mask, mesh_indices, mesh_distances, {}); break; } case ATTR_DOMAIN_CORNER: { |