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/makesrna/intern/rna_mesh.c | |
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/makesrna/intern/rna_mesh.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index fd548ea6a56..2cdcae53677 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -295,6 +295,13 @@ static void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr) rna_Mesh_update_draw(bmain, scene, ptr); } +static void rna_Mesh_update_positions_tag(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Mesh *mesh = (Mesh *)ptr->data; + BKE_mesh_tag_coords_changed(mesh); + rna_Mesh_update_data_legacy_deg_tag_all(bmain, scene, ptr); +} + /** \} */ /* -------------------------------------------------------------------- */ @@ -1727,7 +1734,7 @@ static void rna_def_mvert(BlenderRNA *brna) prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_ui_text(prop, "Location", ""); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data_legacy_deg_tag_all"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_positions_tag"); prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_array(prop, 3); |