Fix #120594: Mesh vertex position change in RNA missing update tag

With an addon like "animall" the `MeshVertex.co` property can be
animated. However, the animation system doesn't call the property's
update callback, meaning the cached normals aren't invalidated when
the positions change. In this case that is easy to fix by moving the
tag to the "set" callback, though that is not a general solution for
other properties where adding a "set" could cause a performance
regression.
This commit is contained in:
Hans Goudey
2024-04-17 08:41:37 -04:00
parent 916c4fcdac
commit 6307e7011d

View File

@@ -268,8 +268,6 @@ 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);
mesh->tag_positions_changed();
rna_Mesh_update_data_legacy_deg_tag_all(bmain, scene, ptr);
}
@@ -403,6 +401,8 @@ static void rna_MeshVertex_co_get(PointerRNA *ptr, float *value)
static void rna_MeshVertex_co_set(PointerRNA *ptr, const float *value)
{
copy_v3_v3((float *)ptr->data, value);
Mesh *mesh = rna_mesh(ptr);
mesh->tag_positions_changed();
}
static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)