diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-23 20:00:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-23 20:00:25 +0300 |
commit | 54182e4925de4ee7e49e4351479e79cb257acc73 (patch) | |
tree | d598250e653ee2e61f875b113ce4f41f87e4a084 /source/blender/blenkernel/intern/geometry_component_mesh.cc | |
parent | 3e5a4d14124029dd3ccb111de2db299bb405d668 (diff) |
Mesh: Add an explicit "positions changed" function
We store various lazily calculated caches on meshes, some of which
depend on the vertex positions staying the same. The current API to
invalidate these caches is a bit confusing. With an explicit set of
functions modeled after the functions in `BKE_node_tree_update.h`,
it becomes clear which function to call. This may become more
important if more lazy caches are added in the future.
Differential Revision: https://developer.blender.org/D14760
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_mesh.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_mesh.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index 8a021e596bd..88ea1af8a8d 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -864,11 +864,11 @@ static void set_vertex_position(MVert &vert, float3 position) copy_v3_v3(vert.co, position); } -static void tag_normals_dirty_when_writing_position(GeometryComponent &component) +static void tag_component_positions_changed(GeometryComponent &component) { Mesh *mesh = get_mesh_from_component_for_write(component); if (mesh != nullptr) { - BKE_mesh_normals_tag_dirty(mesh); + BKE_mesh_tag_coords_changed(mesh); } } @@ -1213,7 +1213,7 @@ static ComponentAttributeProviders create_attribute_providers_for_mesh() point_access, make_derived_read_attribute<MVert, float3, get_vertex_position>, make_derived_write_attribute<MVert, float3, get_vertex_position, set_vertex_position>, - tag_normals_dirty_when_writing_position); + tag_component_positions_changed); static NormalAttributeProvider normal; |