Cleanup: Use consistent "positions" term for mesh update tag functions

Consistent with naming from 1af62cb3bf. Keep the "coord"
naming in the "vert_coords_alloc" set of functions since they should be
removed (see #103789).
This commit is contained in:
Hans Goudey
2023-02-27 16:08:48 -05:00
parent b37111c574
commit c3d803c2ef
18 changed files with 27 additions and 27 deletions

View File

@@ -60,12 +60,12 @@ extern "C" {
/**
* Call after changing vertex positions to tag lazily calculated caches for recomputation.
*/
void BKE_mesh_tag_coords_changed(struct Mesh *mesh);
void BKE_mesh_tag_positions_changed(struct Mesh *mesh);
/**
* Call after moving every mesh vertex by the same translation.
*/
void BKE_mesh_tag_coords_changed_uniformly(struct Mesh *mesh);
void BKE_mesh_tag_positions_changed_uniformly(struct Mesh *mesh);
void BKE_mesh_tag_topology_changed(struct Mesh *mesh);

View File

@@ -44,7 +44,7 @@ void BKE_mesh_runtime_reset_edit_data(struct Mesh *mesh);
* directly or making other large changes to topology. It does not need to be called on new meshes.
*
* For "smaller" changes to meshes like updating positions, consider calling a more specific update
* function like #BKE_mesh_tag_coords_changed.
* function like #BKE_mesh_tag_positions_changed.
*
* Also note that some derived caches like #CD_NORMAL and #CD_TANGENT are stored directly in
* #CustomData.

View File

@@ -1185,7 +1185,7 @@ static Mesh *cloth_make_rest_mesh(ClothModifierData *clmd, Mesh *mesh)
for (const int i : positions.index_range()) {
positions[i] = verts[i].xrest;
}
BKE_mesh_tag_coords_changed(new_mesh);
BKE_mesh_tag_positions_changed(new_mesh);
return new_mesh;
}

View File

@@ -2036,13 +2036,13 @@ static Mesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, Object *
settings.use_threading = (sData->total_points > 1000);
BLI_task_parallel_range(
0, sData->total_points, &data, dynamic_paint_apply_surface_wave_cb, &settings);
BKE_mesh_tag_coords_changed(result);
BKE_mesh_tag_positions_changed(result);
}
/* displace */
if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
dynamicPaint_applySurfaceDisplace(surface, result);
BKE_mesh_tag_coords_changed(result);
BKE_mesh_tag_positions_changed(result);
}
}
}

View File

@@ -909,7 +909,7 @@ static void tag_component_positions_changed(void *owner)
{
Mesh *mesh = static_cast<Mesh *>(owner);
if (mesh != nullptr) {
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
}
}

View File

@@ -1609,7 +1609,7 @@ void BKE_mesh_transform(Mesh *me, const float mat[4][4], bool do_keys)
mul_m3_v3(m3, *lnors);
}
}
BKE_mesh_tag_coords_changed(me);
BKE_mesh_tag_positions_changed(me);
}
void BKE_mesh_translate(Mesh *me, const float offset[3], const bool do_keys)
@@ -1628,7 +1628,7 @@ void BKE_mesh_translate(Mesh *me, const float offset[3], const bool do_keys)
}
}
}
BKE_mesh_tag_coords_changed_uniformly(me);
BKE_mesh_tag_positions_changed_uniformly(me);
}
void BKE_mesh_tessface_clear(Mesh *mesh)
@@ -1794,7 +1794,7 @@ void BKE_mesh_vert_coords_apply(Mesh *mesh, const float (*vert_coords)[3])
for (const int i : positions.index_range()) {
copy_v3_v3(positions[i], vert_coords[i]);
}
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
}
void BKE_mesh_vert_coords_apply_with_mat4(Mesh *mesh,
@@ -1805,7 +1805,7 @@ void BKE_mesh_vert_coords_apply_with_mat4(Mesh *mesh,
for (const int i : positions.index_range()) {
mul_v3_m4v3(positions[i], mat, vert_coords[i]);
}
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
}
static float (*ensure_corner_normal_layer(Mesh &mesh))[3]

View File

@@ -254,7 +254,7 @@ void BKE_mesh_tag_edges_split(struct Mesh *mesh)
}
}
void BKE_mesh_tag_coords_changed(Mesh *mesh)
void BKE_mesh_tag_positions_changed(Mesh *mesh)
{
BKE_mesh_normals_tag_dirty(mesh);
free_bvh_cache(*mesh->runtime);
@@ -262,7 +262,7 @@ void BKE_mesh_tag_coords_changed(Mesh *mesh)
mesh->runtime->bounds_cache.tag_dirty();
}
void BKE_mesh_tag_coords_changed_uniformly(Mesh *mesh)
void BKE_mesh_tag_positions_changed_uniformly(Mesh *mesh)
{
/* The normals and triangulation didn't change, since all verts moved by the same amount. */
free_bvh_cache(*mesh->runtime);

View File

@@ -1018,7 +1018,7 @@ void BKE_modifier_deform_verts(ModifierData *md,
}
mti->deformVerts(md, ctx, me, vertexCos, numVerts);
if (me) {
BKE_mesh_tag_coords_changed(me);
BKE_mesh_tag_positions_changed(me);
}
}

View File

@@ -160,7 +160,7 @@ void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape
/* Vertices were moved around, need to update normals after all the vertices are updated
* Probably this is possible to do in the loop above, but this is rather tricky because
* we don't know all needed vertices' coordinates there yet. */
BKE_mesh_tag_coords_changed(base_mesh);
BKE_mesh_tag_positions_changed(base_mesh);
}
void multires_reshape_apply_base_refine_from_base(MultiresReshapeContext *reshape_context)

View File

@@ -5547,7 +5547,7 @@ void SCULPT_flush_update_step(bContext *C, SculptUpdateType update_flags)
if (update_flags & SCULPT_UPDATE_COORDS && !ss->shapekey_active) {
if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES) {
/* When sculpting and changing the positions of a mesh, tag them as changed and update. */
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
/* Update the mesh's bounds eagerly since the PBVH already has that information. */
mesh->runtime->bounds_cache.ensure([&](Bounds<float3> &r_bounds) {
BKE_pbvh_bounding_box(ob->sculpt->pbvh, r_bounds.min, r_bounds.max);

View File

@@ -1092,7 +1092,7 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase
if (tag_update) {
Mesh *mesh = static_cast<Mesh *>(ob->data);
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
BKE_sculptsession_free_deformMats(ss);
}

View File

@@ -146,7 +146,7 @@ static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data)
mesh_data.ceil_positions != nullptr &&
mesh_data.ceil_positions->size() == positions->size()) {
read_mverts_interp(vert_positions, positions, mesh_data.ceil_positions, config.weight);
BKE_mesh_tag_coords_changed(config.mesh);
BKE_mesh_tag_positions_changed(config.mesh);
return;
}
@@ -161,7 +161,7 @@ void read_mverts(Mesh &mesh, const P3fArraySamplePtr positions, const N3fArraySa
copy_zup_from_yup(vert_positions[i], pos_in.getValue());
}
BKE_mesh_tag_coords_changed(&mesh);
BKE_mesh_tag_positions_changed(&mesh);
if (normals) {
float(*vert_normals)[3] = BKE_mesh_vert_normals_for_write(&mesh);

View File

@@ -651,7 +651,7 @@ void USDMeshReader::read_mesh_sample(ImportSettings *settings,
for (int i = 0; i < positions_.size(); i++) {
vert_positions[i] = {positions_[i][0], positions_[i][1], positions_[i][2]};
}
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
read_vertex_creases(mesh, motionSampleTime);
}

View File

@@ -352,7 +352,7 @@ static void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
static void rna_Mesh_update_positions_tag(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Mesh *mesh = rna_mesh(ptr);
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
rna_Mesh_update_data_legacy_deg_tag_all(bmain, scene, ptr);
}

View File

@@ -148,7 +148,7 @@ static Mesh *get_quick_mesh(
mul_m4_v3(omat, positions[i]);
}
BKE_mesh_tag_coords_changed(result);
BKE_mesh_tag_positions_changed(result);
}
break;

View File

@@ -466,7 +466,7 @@ static Mesh *doOcean(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mes
}
}
BKE_mesh_tag_coords_changed(mesh);
BKE_mesh_tag_positions_changed(mesh);
if (allocated_ocean) {
BKE_ocean_free(omd->ocean);

View File

@@ -188,7 +188,7 @@ static void scale_vertex_islands_uniformly(Mesh &mesh,
}
});
BKE_mesh_tag_coords_changed(&mesh);
BKE_mesh_tag_positions_changed(&mesh);
}
static void scale_vertex_islands_on_axis(Mesh &mesh,
@@ -234,7 +234,7 @@ static void scale_vertex_islands_on_axis(Mesh &mesh,
}
});
BKE_mesh_tag_coords_changed(&mesh);
BKE_mesh_tag_positions_changed(&mesh);
}
static Vector<ElementIsland> prepare_face_islands(const Mesh &mesh, const IndexMask face_selection)

View File

@@ -58,14 +58,14 @@ static void translate_mesh(Mesh &mesh, const float3 translation)
{
if (!math::is_zero(translation)) {
translate_positions(mesh.vert_positions_for_write(), translation);
BKE_mesh_tag_coords_changed_uniformly(&mesh);
BKE_mesh_tag_positions_changed_uniformly(&mesh);
}
}
static void transform_mesh(Mesh &mesh, const float4x4 &transform)
{
transform_positions(mesh.vert_positions_for_write(), transform);
BKE_mesh_tag_coords_changed(&mesh);
BKE_mesh_tag_positions_changed(&mesh);
}
static void translate_pointcloud(PointCloud &pointcloud, const float3 translation)