Depsgraph: Avoid use of 0 tag flag on build finish
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 13 Jun 2018 07:49:14 +0000 (09:49 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 13 Jun 2018 07:49:14 +0000 (09:49 +0200)
Use all the explicit tagging. Solves characters being in T-pose after
opening specific scene files.

source/blender/depsgraph/intern/builder/deg_builder.cc

index f1f3da85968817a5fa8030b8d01e72f7beddfcb9..1b2dcd8fcf8cc08471b28acaae8647596bb4b10f 100644 (file)
 
 #include "intern/builder/deg_builder.h"
 
+#include "DNA_anim_types.h"
 #include "DNA_object_types.h"
 #include "DNA_ID.h"
 
+extern "C" {
+#include "BKE_animsys.h"
+}
+
 #include "intern/depsgraph.h"
 #include "intern/depsgraph_types.h"
 #include "intern/eval/deg_eval_copy_on_write.h"
@@ -53,12 +58,17 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph)
        foreach (IDDepsNode *id_node, graph->id_nodes) {
                ID *id = id_node->id_orig;
                id_node->finalize_build(graph);
+               int flag = DEG_TAG_TRANSFORM | DEG_TAG_GEOMETRY;
                if ((id->recalc & ID_RECALC_ALL)) {
-                       DEG_id_tag_update_ex(bmain, id_node->id_orig, 0);
+                       AnimData *adt = BKE_animdata_from_id(id);
+                       if (adt != NULL && (adt->recalc & ADT_RECALC_ANIM) != 0) {
+                               flag |= DEG_TAG_TIME;
+                       }
                }
                if (!deg_copy_on_write_is_expanded(id_node->id_cow)) {
-                       DEG_id_tag_update_ex(bmain, id_node->id_orig, DEG_TAG_COPY_ON_WRITE);
+                       flag |= DEG_TAG_COPY_ON_WRITE;
                }
+               DEG_id_tag_update_ex(bmain, id_node->id_orig, flag);
        }
 }