Fix Spring characters being in the rest pose on file open
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Feb 2019 09:54:46 +0000 (10:54 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Feb 2019 09:55:12 +0000 (10:55 +0100)
This partially reverts bf2c5217 and makes it so animation is evaluated
for datablocks which were never evaluated within the dependency graph.

Not ideal, but safest way currently.

Animation for already evaluated datablocks will only be evaluated on
manual edits, so the initial bugfix is still valid.

source/blender/depsgraph/intern/depsgraph_tag.cc

index 53697a8aabdcbbc6a914881979446a7d57f75f93..454b622385a1bf45ed0ef778adfbb2a9ab62a63b 100644 (file)
@@ -484,6 +484,13 @@ void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph)
                int flag = 0;
                if (!DEG::deg_copy_on_write_is_expanded(id_node->id_cow)) {
                        flag |= ID_RECALC_COPY_ON_WRITE;
+                       /* TODO(sergey): Shouldn't be needed, but currently we are lackign
+                        * some flushing of evaluated data to the original one, which makes,
+                        * for example, files saved with the rest pose.
+                        * Need to solve those issues carefully, for until then we evaluate
+                        * animation for datablocks which appears in the graph for the first
+                        * time. */
+                       flag |= ID_RECALC_ANIMATION;
                }
                /* We only tag components which needs an update. Tagging everything is
                 * not a good idea because that might reset particles cache (or any