diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_boolean_convert.cc | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_evaluate.cc | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_fair.cc | 58 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_merge.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_normals.cc | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires_reshape_smooth.c | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires_unsubdivide.c | 22 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.cc | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 10 |
11 files changed, 73 insertions, 76 deletions
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"); |