diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-06 13:26:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-07 10:12:54 +0300 |
commit | d8bff8e8f621b0c2c9de64e14847a19d376e60d3 (patch) | |
tree | 1cc198af3d6a071eb0cc051175eb20f8840ac8c7 /source/blender/blenkernel/intern/mesh.c | |
parent | 2a5fcfaad0c16a486e4582aed86b8a140ede9d40 (diff) |
Free evaluated mesh when owner mesh changes
Ensures that evaluated mesh shares the same settings as its owner when
updates related on animation system happens.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index aa13950f0d5..755a8036e8e 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2001,4 +2001,12 @@ void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh) /* Clear autospace flag in evaluated mesh, so that texspace does not get recomputed when bbox is * (e.g. after modifiers, etc.) */ mesh->texflag &= ~ME_AUTOSPACE; + /* We are here because something did change in the mesh. This means we can not trust the existing + * evaluated mesh, and we don't know what parts of the mesh did change. So we simply delete the + * evaluated mesh and let objects to re-create it with updated settings. */ + if (mesh->runtime.mesh_eval != NULL) { + mesh->runtime.mesh_eval->edit_mesh = NULL; + BKE_id_free(NULL, mesh->runtime.mesh_eval); + mesh->runtime.mesh_eval = NULL; + } } |