Mesh: Remove unnecessary mesh position copying #105756

Merged
Hans Goudey merged 6 commits from sixthat/blender:remove-unneccessary-vert-pos-copy into main 2023-03-19 00:26:41 +01:00
4 changed files with 4 additions and 0 deletions
Showing only changes of commit 04c034b972 - Show all commits

View File

@ -745,6 +745,7 @@ static GeometrySet curve_calc_modifiers_post(Depsgraph *depsgraph,
if (mti->type == eModifierTypeType_OnlyDeform) {
mti->deformVerts(
md, &mectx_deform, mesh, BKE_mesh_vert_positions_for_write(mesh), mesh->totvert);
sixthat marked this conversation as resolved
Review

This needs a call to BKE_mesh_tag_positions_changed, otherwise various caches that depend on mesh positions won't be properly updated after the deformation.

This needs a call to `BKE_mesh_tag_positions_changed`, otherwise various caches that depend on mesh positions won't be properly updated after the deformation.
BKE_mesh_tag_positions_changed(mesh);
}
else {
Mesh *output_mesh = mti->modifyMesh(md, &mectx_apply, mesh);

View File

@ -687,6 +687,7 @@ void BKE_mball_data_update(Depsgraph *depsgraph, Scene *scene, Object *ob)
if (ob->parent && ob->parent->type == OB_LATTICE && ob->partype == PARSKEL) {
BKE_lattice_deform_coords(
ob->parent, ob, BKE_mesh_vert_positions_for_write(mesh), mesh->totvert, 0, nullptr, 1.0f);
BKE_mesh_tag_positions_changed(mesh);
}
ob->runtime.geometry_set_eval = new GeometrySet(GeometrySet::create_with_mesh(mesh));

View File

@ -3500,6 +3500,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
sim->ob,
psys->hair_in_mesh,
BKE_mesh_vert_positions_for_write(psys->hair_in_mesh));
sixthat marked this conversation as resolved Outdated

The update tag from BKE_mesh_vert_coords_apply is missing here too.

The update tag from `BKE_mesh_vert_coords_apply` is missing here too.
BKE_mesh_tag_positions_changed(psys->hair_in_mesh);
/* restore cloth effector weights */
psys->clmd->sim_parms->effector_weights = clmd_effweights;

View File

@ -1547,6 +1547,7 @@ void BKE_shrinkwrap_mesh_nearest_surface_deform(bContext *C, Object *ob_source,
-1,
BKE_mesh_vert_positions_for_write(src_me),
src_me->totvert);
sixthat marked this conversation as resolved
Review

Same here

Same here
BKE_mesh_tag_positions_changed(src_me);
}
void BKE_shrinkwrap_remesh_target_project(Mesh *src_me, Mesh *target_me, Object *ob_target)