Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-09-07 08:06:31 +0300
committerHans Goudey <h.goudey@me.com>2022-09-07 08:06:31 +0300
commitbe038b844cb53bc228d3e98bfe09071560930cde (patch)
tree13de4a3fc3b49a8b2075a0413dc8261603fbc718 /source/blender/editors/mesh
parent20daaeffce4cf9bfe48ab7c84cb9e2b1d71d2c91 (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/mesh')
-rw-r--r--source/blender/editors/mesh/editface.cc32
-rw-r--r--source/blender/editors/mesh/mesh_data.cc10
-rw-r--r--source/blender/editors/mesh/mesh_mirror.c2
-rw-r--r--source/blender/editors/mesh/meshtools.cc10
4 files changed, 27 insertions, 27 deletions
diff --git a/source/blender/editors/mesh/editface.cc b/source/blender/editors/mesh/editface.cc
index 6313c01011e..26184acc8b4 100644
--- a/source/blender/editors/mesh/editface.cc
+++ b/source/blender/editors/mesh/editface.cc
@@ -73,11 +73,11 @@ void paintface_flush_flags(bContext *C,
Mesh *me_eval = (Mesh *)ob_eval->runtime.data_eval;
bke::MutableAttributeAccessor attributes_eval = bke::mesh_attributes_for_write(*me_eval);
bool updated = false;
- const Span<MPoly> me_polys = me->polygons();
+ const Span<MPoly> me_polys = me->polys();
if (me_orig != nullptr && me_eval != nullptr && me_orig->totpoly == me->totpoly) {
/* Update the COW copy of the mesh. */
- MutableSpan<MPoly> orig_polys = me_orig->polygons_for_write();
+ MutableSpan<MPoly> orig_polys = me_orig->polys_for_write();
for (int i = 0; i < me->totpoly; i++) {
orig_polys[i].flag = me_polys[i].flag;
}
@@ -92,7 +92,7 @@ void paintface_flush_flags(bContext *C,
/* Mesh polys => Final derived polys */
if ((index_array = (const int *)CustomData_get_layer(&me_eval->pdata, CD_ORIGINDEX))) {
- MutableSpan<MPoly> eval_polys = me_orig->polygons_for_write();
+ MutableSpan<MPoly> eval_polys = me_orig->polys_for_write();
/* loop over final derived polys */
for (const int i : eval_polys.index_range()) {
if (index_array[i] != ORIGINDEX_NONE) {
@@ -141,7 +141,7 @@ void paintface_hide(bContext *C, Object *ob, const bool unselected)
return;
}
- MutableSpan<MPoly> polys = me->polygons_for_write();
+ MutableSpan<MPoly> polys = me->polys_for_write();
bke::MutableAttributeAccessor attributes = bke::mesh_attributes_for_write(*me);
bke::SpanAttributeWriter<bool> hide_poly = attributes.lookup_or_add_for_write_span<bool>(
".hide_poly", ATTR_DOMAIN_FACE);
@@ -174,7 +174,7 @@ void paintface_reveal(bContext *C, Object *ob, const bool select)
return;
}
- MutableSpan<MPoly> polys = me->polygons_for_write();
+ MutableSpan<MPoly> polys = me->polys_for_write();
bke::MutableAttributeAccessor attributes = bke::mesh_attributes_for_write(*me);
if (select) {
@@ -207,7 +207,7 @@ static void select_linked_tfaces_with_seams(Mesh *me, const uint index, const bo
BLI_bitmap *poly_tag = BLI_BITMAP_NEW(me->totpoly, __func__);
const Span<MEdge> edges = me->edges();
- MutableSpan<MPoly> polys = me->polygons_for_write();
+ MutableSpan<MPoly> polys = me->polys_for_write();
const Span<MLoop> loops = me->loops();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_poly = attributes.lookup_or_default<bool>(
@@ -305,7 +305,7 @@ bool paintface_deselect_all_visible(bContext *C, Object *ob, int action, bool fl
return false;
}
- MutableSpan<MPoly> polys = me->polygons_for_write();
+ MutableSpan<MPoly> polys = me->polys_for_write();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_poly = attributes.lookup_or_default<bool>(
".hide_poly", ATTR_DOMAIN_FACE, false);
@@ -369,8 +369,8 @@ bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
copy_m3_m4(bmat, ob->obmat);
- 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();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_poly = attributes.lookup_or_default<bool>(
@@ -409,7 +409,7 @@ bool paintface_mouse_select(bContext *C,
/* Get the face under the cursor */
Mesh *me = BKE_mesh_from_object(ob);
- MutableSpan<MPoly> polys = me->polygons_for_write();
+ MutableSpan<MPoly> polys = me->polys_for_write();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_poly = attributes.lookup_or_default<bool>(
".hide_poly", ATTR_DOMAIN_FACE, false);
@@ -494,8 +494,8 @@ void paintvert_flush_flags(Object *ob)
index_array = (const int *)CustomData_get_layer(&me_eval->vdata, CD_ORIGINDEX);
- const Span<MVert> vertices = me->vertices_for_write();
- MutableSpan<MVert> vertices_eval = me_eval->vertices_for_write();
+ const Span<MVert> vertices = me->verts_for_write();
+ MutableSpan<MVert> vertices_eval = me_eval->verts_for_write();
if (index_array) {
int orig_index;
@@ -529,7 +529,7 @@ bool paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
return false;
}
- MutableSpan<MVert> verts = me->vertices_for_write();
+ MutableSpan<MVert> verts = me->verts_for_write();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_vert = attributes.lookup_or_default<bool>(
".hide_vert", ATTR_DOMAIN_POINT, false);
@@ -606,7 +606,7 @@ void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags)
paintvert_deselect_all_visible(ob, SEL_DESELECT, false);
}
- MutableSpan<MVert> verts = me->vertices_for_write();
+ MutableSpan<MVert> verts = me->verts_for_write();
bke::AttributeAccessor attributes = bke::mesh_attributes(*me);
const VArray<bool> hide_vert = attributes.lookup_or_default<bool>(
".hide_vert", ATTR_DOMAIN_POINT, false);
@@ -635,7 +635,7 @@ void paintvert_hide(bContext *C, Object *ob, const bool unselected)
return;
}
- MutableSpan<MVert> verts = me->vertices_for_write();
+ MutableSpan<MVert> verts = me->verts_for_write();
bke::MutableAttributeAccessor attributes = bke::mesh_attributes_for_write(*me);
bke::SpanAttributeWriter<bool> hide_vert = attributes.lookup_or_add_for_write_span<bool>(
".hide_vert", ATTR_DOMAIN_POINT);
@@ -668,7 +668,7 @@ void paintvert_reveal(bContext *C, Object *ob, const bool select)
return;
}
- MutableSpan<MVert> verts = me->vertices_for_write();
+ MutableSpan<MVert> verts = me->verts_for_write();
bke::MutableAttributeAccessor attributes = bke::mesh_attributes_for_write(*me);
const VArray<bool> hide_vert = attributes.lookup_or_default<bool>(
".hide_vert", ATTR_DOMAIN_POINT, false);
diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc
index 09673b3d7ad..4ee518b5662 100644
--- a/source/blender/editors/mesh/mesh_data.cc
+++ b/source/blender/editors/mesh/mesh_data.cc
@@ -225,7 +225,7 @@ void ED_mesh_uv_loop_reset_ex(Mesh *me, const int layernum)
BLI_assert(CustomData_has_layer(&me->ldata, CD_MLOOPUV));
MLoopUV *mloopuv = (MLoopUV *)CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, layernum);
- const MPoly *polys = BKE_mesh_polygons(me);
+ const MPoly *polys = BKE_mesh_polys(me);
for (int i = 0; i < me->totpoly; i++) {
mesh_uv_reset_mface(&polys[i], mloopuv);
}
@@ -776,9 +776,9 @@ static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator
/* Tag edges as sharp according to smooth threshold if needed,
* to preserve autosmooth shading. */
if (me->flag & ME_AUTOSMOOTH) {
- const Span<MVert> verts = me->vertices();
+ const Span<MVert> verts = me->verts();
MutableSpan<MEdge> edges = me->edges_for_write();
- const Span<MPoly> polys = me->polygons();
+ const Span<MPoly> polys = me->polys();
const Span<MLoop> loops = me->loops();
BKE_edges_sharp_from_angle_set(verts.data(),
@@ -893,7 +893,7 @@ static void mesh_add_verts(Mesh *mesh, int len)
const int old_vertex_num = mesh->totvert;
mesh->totvert = totvert;
- MutableSpan<MVert> verts = mesh->vertices_for_write();
+ MutableSpan<MVert> verts = mesh->verts_for_write();
for (MVert &vert : verts.drop_front(old_vertex_num)) {
vert.flag = SELECT;
}
@@ -986,7 +986,7 @@ static void mesh_add_polys(Mesh *mesh, int len)
const int old_polys_num = mesh->totpoly;
mesh->totpoly = totpoly;
- MutableSpan<MPoly> polys = mesh->polygons_for_write();
+ MutableSpan<MPoly> polys = mesh->polys_for_write();
for (MPoly &poly : polys.drop_front(old_polys_num)) {
poly.flag = ME_FACE_SEL;
}
diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c
index 905eb5d43e1..ad5a5d362f1 100644
--- a/source/blender/editors/mesh/mesh_mirror.c
+++ b/source/blender/editors/mesh/mesh_mirror.c
@@ -55,7 +55,7 @@ void ED_mesh_mirror_spatial_table_begin(Object *ob, BMEditMesh *em, Mesh *me_eva
}
}
else {
- const MVert *verts = BKE_mesh_vertices(me_eval ? me_eval : me);
+ const MVert *verts = BKE_mesh_verts(me_eval ? me_eval : me);
for (int i = 0; i < totvert; i++) {
BLI_kdtree_3d_insert(MirrKdStore.tree, i, verts[i].co);
}
diff --git a/source/blender/editors/mesh/meshtools.cc b/source/blender/editors/mesh/meshtools.cc
index 88c204b56e9..ad7f504c87b 100644
--- a/source/blender/editors/mesh/meshtools.cc
+++ b/source/blender/editors/mesh/meshtools.cc
@@ -906,7 +906,7 @@ static bool ed_mesh_mirror_topo_table_update(Object *ob, Mesh *me_eval)
static int mesh_get_x_mirror_vert_spatial(Object *ob, Mesh *me_eval, int index)
{
Mesh *me = static_cast<Mesh *>(ob->data);
- const Span<MVert> verts = me_eval ? me_eval->vertices() : me->vertices();
+ const Span<MVert> verts = me_eval ? me_eval->verts() : me->verts();
float vec[3];
@@ -1143,7 +1143,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em, Mesh *me_eval)
mirrorverts = static_cast<int *>(MEM_callocN(sizeof(int) * totvert, "MirrorVerts"));
mirrorfaces = static_cast<int *>(MEM_callocN(sizeof(int[2]) * totface, "MirrorFaces"));
- const Span<MVert> verts = me_eval ? me_eval->vertices() : me->vertices();
+ const Span<MVert> verts = me_eval ? me_eval->verts() : me->verts();
MFace *mface = (MFace *)CustomData_get_layer(&(me_eval ? me_eval : me)->fdata, CD_MFACE);
ED_mesh_mirror_spatial_table_begin(ob, em, me_eval);
@@ -1275,8 +1275,8 @@ bool ED_mesh_pick_face_vert(
const float mval_f[2] = {(float)mval[0], (float)mval[1]};
float len_best = FLT_MAX;
- const Span<MVert> verts = me_eval->vertices();
- const Span<MPoly> polys = me_eval->polygons();
+ const Span<MVert> verts = me_eval->verts();
+ const Span<MPoly> polys = me_eval->polys();
const Span<MLoop> loops = me_eval->loops();
const int *index_mp_to_orig = (const int *)CustomData_get_layer(&me_eval->pdata, CD_ORIGINDEX);
@@ -1411,7 +1411,7 @@ bool ED_mesh_pick_vert(
}
/* setup data */
- const Span<MVert> verts = me->vertices();
+ const Span<MVert> verts = me->verts();
data.mvert = verts.data();
data.region = region;
data.mval_f = mval_f;