Commit: d8bff8e8f621b0c2c9de64e14847a19d376e60d3
Author: Sergey Sharybin
Date:   Thu Jun 6 12:26:40 2019 +0200
Branches: master
https://developer.blender.org/rBd8bff8e8f621b0c2c9de64e14847a19d376e60d3

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.

===================================================================

M       source/blender/blenkernel/intern/mesh.c

===================================================================

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;
+  }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to