Fix T62327: Multires with Particles: Undo not working
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Mar 2019 13:37:46 +0000 (14:37 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Mar 2019 13:38:28 +0000 (14:38 +0100)
Modifier stack was forced to be re-evaluated when it was not
supposed to. Should also improve sculpt performance.

source/blender/depsgraph/intern/depsgraph_tag.cc

index 493247e..f6887af 100644 (file)
@@ -622,8 +622,12 @@ void graph_id_tag_update(Main *bmain,
        /* Special case for nested node tree datablocks. */
        id_tag_update_ntree_special(bmain, graph, id, flag, update_source);
        /* Direct update tags means that something outside of simulated/cached
-        * physics did change and that cache is to be invalidated. */
-       if (update_source == DEG_UPDATE_SOURCE_USER_EDIT) {
+        * physics did change and that cache is to be invalidated.
+        * This is only needed if data changes. If it's just a drawing, we keep the
+        * point cache. */
+       if (update_source == DEG_UPDATE_SOURCE_USER_EDIT &&
+           flag != ID_RECALC_SHADING)
+       {
                graph_id_tag_update_single_flag(
                        bmain, graph, id, id_node, ID_RECALC_POINT_CACHE, update_source);
        }