diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-07 08:06:31 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-07 08:06:31 +0300 |
commit | be038b844cb53bc228d3e98bfe09071560930cde (patch) | |
tree | 13de4a3fc3b49a8b2075a0413dc8261603fbc718 /source/blender/editors/sculpt_paint | |
parent | 20daaeffce4cf9bfe48ab7c84cb9e2b1d71d2c91 (diff) |
Cleanup: Tweak naming for recently added mesh accessors
Use `verts` instead of `vertices` and `polys` instead of `polygons`
in the API added in 05952aa94d33eeb50. This aligns better with
existing naming where the shorter names are much more common.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
13 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc index 3b13575f7bb..d452d94d2f0 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc @@ -142,7 +142,7 @@ struct AddOperationExecutor { report_empty_evaluated_surface(stroke_extension.reports); return; } - surface_verts_eval_ = surface_eval_->vertices(); + surface_verts_eval_ = surface_eval_->verts(); surface_loops_eval_ = surface_eval_->loops(); surface_looptris_eval_ = {BKE_mesh_runtime_looptri_ensure(surface_eval_), BKE_mesh_runtime_looptri_len(surface_eval_)}; diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_puff.cc b/source/blender/editors/sculpt_paint/curves_sculpt_puff.cc index 062bacc7add..ec69aae372c 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_puff.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_puff.cc @@ -119,7 +119,7 @@ struct PuffOperationExecutor { reinterpret_cast<const float3 *>(CustomData_get_layer(&surface_->ldata, CD_NORMAL)), surface_->totloop}; - surface_verts_ = surface_->vertices(); + surface_verts_ = surface_->verts(); surface_loops_ = surface_->loops(); surface_looptris_ = {BKE_mesh_runtime_looptri_ensure(surface_), BKE_mesh_runtime_looptri_len(surface_)}; diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc index e65d81a4225..833f00ae0d0 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc @@ -177,8 +177,8 @@ struct SlideOperationExecutor { if (surface_orig_->totpoly == 0) { report_empty_original_surface(stroke_extension.reports); return; - } - surface_looptris_orig_ = {BKE_mesh_runtime_looptri_ensure(surface_orig_), + } + surface_looptris_orig_ = {BKE_mesh_runtime_looptri_ensure(surface_orig_), BKE_mesh_runtime_looptri_len(surface_orig_)}; surface_uv_map_orig_ = bke::mesh_attributes(*surface_orig_).lookup<float2>(uv_map_name, ATTR_DOMAIN_CORNER); @@ -207,7 +207,7 @@ struct SlideOperationExecutor { } surface_looptris_eval_ = {BKE_mesh_runtime_looptri_ensure(surface_eval_), BKE_mesh_runtime_looptri_len(surface_eval_)}; - surface_verts_eval_ = surface_eval_->vertices(); + surface_verts_eval_ = surface_eval_->verts(); surface_loops_eval_ = surface_eval_->loops(); surface_uv_map_eval_ = bke::mesh_attributes(*surface_eval_).lookup<float2>(uv_map_name, ATTR_DOMAIN_CORNER); @@ -323,7 +323,7 @@ struct SlideOperationExecutor { { const float4x4 brush_transform_inv = brush_transform.inverted(); - const Span<MVert> verts_orig_su = surface_orig_->vertices(); + const Span<MVert> verts_orig_su = surface_orig_->verts(); const Span<MLoop> loops_orig = surface_orig_->loops(); MutableSpan<float3> positions_orig_cu = curves_orig_->positions_for_write(); diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index f1e6c7bf8dd..1ca5df47e17 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -4055,13 +4055,13 @@ static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *p } ps->mat_array[totmat - 1] = NULL; - ps->mvert_eval = BKE_mesh_vertices(ps->me_eval); + ps->mvert_eval = BKE_mesh_verts(ps->me_eval); ps->vert_normals = BKE_mesh_vertex_normals_ensure(ps->me_eval); if (ps->do_mask_cavity) { ps->medge_eval = BKE_mesh_edges(ps->me_eval); } ps->mloop_eval = BKE_mesh_loops(ps->me_eval); - ps->mpoly_eval = BKE_mesh_polygons(ps->me_eval); + ps->mpoly_eval = BKE_mesh_polys(ps->me_eval); ps->material_indices = (const int *)CustomData_get_layer_named( &ps->me_eval->pdata, CD_PROP_INT32, "material_index"); @@ -4155,7 +4155,7 @@ static void proj_paint_face_lookup_init(const ProjPaintState *ps, ProjPaintFaceL memset(face_lookup, 0, sizeof(*face_lookup)); if (ps->do_face_sel) { face_lookup->index_mp_to_orig = CustomData_get_layer(&ps->me_eval->pdata, CD_ORIGINDEX); - face_lookup->mpoly_orig = BKE_mesh_polygons((Mesh *)ps->ob->data); + face_lookup->mpoly_orig = BKE_mesh_polys((Mesh *)ps->ob->data); } } diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 34c5fc3124c..332a0830081 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -1123,7 +1123,7 @@ static void sculpt_gesture_trim_geometry_generate(SculptGestureContext *sgcontex const float(*ob_imat)[4] = vc->obact->imat; /* Write vertices coordinates for the front face. */ - MVert *verts = BKE_mesh_vertices_for_write(trim_operation->mesh); + MVert *verts = BKE_mesh_verts_for_write(trim_operation->mesh); float depth_point[3]; madd_v3_v3v3fl(depth_point, shape_origin, shape_normal, depth_front); for (int i = 0; i < tot_screen_points; i++) { @@ -1160,7 +1160,7 @@ static void sculpt_gesture_trim_geometry_generate(SculptGestureContext *sgcontex BLI_polyfill_calc(screen_points, tot_screen_points, 0, r_tris); /* Write the front face triangle indices. */ - MPoly *polys = BKE_mesh_polygons_for_write(trim_operation->mesh); + MPoly *polys = BKE_mesh_polys_for_write(trim_operation->mesh); MLoop *loops = BKE_mesh_loops_for_write(trim_operation->mesh); MPoly *mp = polys; MLoop *ml = loops; @@ -1333,7 +1333,7 @@ static void sculpt_gesture_trim_apply_for_symmetry_pass(bContext *UNUSED(C), { SculptGestureTrimOperation *trim_operation = (SculptGestureTrimOperation *)sgcontext->operation; Mesh *trim_mesh = trim_operation->mesh; - MVert *verts = BKE_mesh_vertices_for_write(trim_mesh); + MVert *verts = BKE_mesh_verts_for_write(trim_mesh); for (int i = 0; i < trim_mesh->totvert; i++) { flip_v3_v3(verts[i].co, trim_operation->true_mesh_co[i], sgcontext->symmpass); } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 7336166d651..1cedcde7035 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -288,7 +288,7 @@ static void imapaint_pick_uv( const MLoopTri *lt = BKE_mesh_runtime_looptri_ensure(me_eval); const int tottri = me_eval->runtime.looptris.len; - const MVert *mvert = BKE_mesh_vertices(me_eval); + const MVert *mvert = BKE_mesh_verts(me_eval); const MLoop *mloop = BKE_mesh_loops(me_eval); const int *index_mp_to_orig = CustomData_get_layer(&me_eval->pdata, CD_ORIGINDEX); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 2d2033cac96..c38a79cb6bb 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -1237,7 +1237,7 @@ static void vertex_paint_init_session_data(const ToolSettings *ts, Object *ob) } Mesh *me = (Mesh *)ob->data; - const Span<MPoly> polys = me->polygons(); + const Span<MPoly> polys = me->polys(); const Span<MLoop> loops = me->loops(); if (gmap->vert_to_loop == nullptr) { @@ -4088,8 +4088,8 @@ static bool vertex_color_set(Object *ob, ColorPaint4f paintcol_in, CustomDataLay } else { Color *color_layer = static_cast<Color *>(layer->data); - const Span<MVert> verts = me->vertices(); - const Span<MPoly> polys = me->polygons(); + const Span<MVert> verts = me->verts(); + const Span<MPoly> polys = me->polys(); const Span<MLoop> loops = me->loops(); for (const int i : polys.index_range()) { 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 7aa0adfc3d4..006ceb5f136 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc @@ -159,8 +159,8 @@ static IndexMask get_selected_indices(const Mesh &mesh, Vector<int64_t> &indices) { using namespace blender; - Span<MVert> verts = mesh.vertices(); - Span<MPoly> polys = mesh.polygons(); + const Span<MVert> verts = mesh.verts(); + const Span<MPoly> polys = mesh.polys(); bke::AttributeAccessor attributes = bke::mesh_attributes(mesh); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c index f40a287adf6..0a0d7cff214 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -317,7 +317,7 @@ static const EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, ED_view3d_viewcontext_init(C, &vc, depsgraph); me = BKE_mesh_from_object(vc.obact); - const MPoly *polys = BKE_mesh_polygons(me); + const MPoly *polys = BKE_mesh_polys(me); const MLoop *loops = BKE_mesh_loops(me); const MDeformVert *dverts = BKE_mesh_deform_verts(me); @@ -445,8 +445,8 @@ static bool weight_paint_set(Object *ob, float paintweight) /* mutually exclusive, could be made into a */ const short paint_selmode = ME_EDIT_PAINT_SEL_MODE(me); - const MVert *verts = BKE_mesh_vertices(me); - const MPoly *polys = BKE_mesh_polygons(me); + const MVert *verts = BKE_mesh_verts(me); + const MPoly *polys = BKE_mesh_polys(me); const MLoop *loops = BKE_mesh_loops(me); MDeformVert *dvert = BKE_mesh_deform_verts_for_write(me); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 6ccb756099f..5a17d42468e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3162,7 +3162,7 @@ void SCULPT_vertcos_to_key(Object *ob, KeyBlock *kb, const float (*vertCos)[3]) /* Modifying of basis key should update mesh. */ if (kb == me->key->refkey) { - MVert *verts = BKE_mesh_vertices_for_write(me); + MVert *verts = BKE_mesh_verts_for_write(me); for (a = 0; a < me->totvert; a++) { copy_v3_v3(verts[a].co, vertCos[a]); @@ -3589,7 +3589,7 @@ static void sculpt_flush_pbvhvert_deform(Object *ob, PBVHVertexIter *vd) copy_v3_v3(ss->deform_cos[index], vd->co); copy_v3_v3(ss->orig_cos[index], newco); - MVert *verts = BKE_mesh_vertices_for_write(me); + MVert *verts = BKE_mesh_verts_for_write(me); if (!ss->shapekey_active) { copy_v3_v3(verts[index].co, newco); } @@ -5910,7 +5910,7 @@ void SCULPT_boundary_info_ensure(Object *object) Mesh *base_mesh = BKE_mesh_from_object(object); const MEdge *edges = BKE_mesh_edges(base_mesh); - const MPoly *polys = BKE_mesh_polygons(base_mesh); + const MPoly *polys = BKE_mesh_polys(base_mesh); const MLoop *loops = BKE_mesh_loops(base_mesh); ss->vertex_info.boundary = BLI_BITMAP_NEW(base_mesh->totvert, "Boundary info"); diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c index 63d5c14a931..7c4c47261b3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.c +++ b/source/blender/editors/sculpt_paint/sculpt_expand.c @@ -776,7 +776,7 @@ static void sculpt_expand_grids_to_faces_falloff(SculptSession *ss, Mesh *mesh, ExpandCache *expand_cache) { - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const CCGKey *key = BKE_pbvh_get_grid_key(ss->pbvh); for (int p = 0; p < mesh->totpoly; p++) { @@ -794,7 +794,7 @@ static void sculpt_expand_grids_to_faces_falloff(SculptSession *ss, static void sculpt_expand_vertex_to_faces_falloff(Mesh *mesh, ExpandCache *expand_cache) { - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const MLoop *loops = BKE_mesh_loops(mesh); for (int p = 0; p < mesh->totpoly; p++) { @@ -1940,7 +1940,7 @@ static void sculpt_expand_delete_face_set_id(int *r_face_sets, { const int totface = ss->totfaces; MeshElemMap *pmap = ss->pmap; - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const MLoop *loops = BKE_mesh_loops(mesh); /* Check that all the face sets IDs in the mesh are not equal to `delete_id` diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c index c8e546ecef3..b89944628da 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.c +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c @@ -1096,7 +1096,7 @@ static void sculpt_face_set_grow(Object *ob, const bool modify_hidden) { Mesh *mesh = BKE_mesh_from_object(ob); - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const MLoop *loops = BKE_mesh_loops(mesh); for (int p = 0; p < mesh->totpoly; p++) { @@ -1127,7 +1127,7 @@ static void sculpt_face_set_shrink(Object *ob, const bool modify_hidden) { Mesh *mesh = BKE_mesh_from_object(ob); - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const MLoop *loops = BKE_mesh_loops(mesh); for (int p = 0; p < mesh->totpoly; p++) { if (!modify_hidden && prev_face_sets[p] <= 0) { diff --git a/source/blender/editors/sculpt_paint/sculpt_geodesic.c b/source/blender/editors/sculpt_paint/sculpt_geodesic.c index 4b871da1d02..c07c6126405 100644 --- a/source/blender/editors/sculpt_paint/sculpt_geodesic.c +++ b/source/blender/editors/sculpt_paint/sculpt_geodesic.c @@ -109,7 +109,7 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, MVert *verts = SCULPT_mesh_deformed_mverts_get(ss); const MEdge *edges = BKE_mesh_edges(mesh); - const MPoly *polys = BKE_mesh_polygons(mesh); + const MPoly *polys = BKE_mesh_polys(mesh); const MLoop *loops = BKE_mesh_loops(mesh); float *dists = MEM_malloc_arrayN(totvert, sizeof(float), "distances"); |