Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-08-20 17:29:34 +0300
committerJacques Lucke <jacques@blender.org>2020-08-20 17:29:34 +0300
commit263148dbacc496b922a46397fd94e558e0d1e9ac (patch)
tree92edccf586ae09d858393362953429282a615c0a /source/blender/depsgraph/intern/node
parent948e080fc5bb501f5fde183c3d5f52c3ca797190 (diff)
Depsgraph: refactor tagging after time changes
This reverts {rB1693a5efe91999b60b3dc0bdff727473b3bd00bb} and implements an alternative solution. The old patch had the problem that the depsgraph would always evaluate at the current frame of the original scene (even when `DEG_evaluate_on_framechange` was used). Now it is possible to evaluate the depsgraph at a specific frame without having to change the original scene. Reviewers: sergey, sybren Differential Revision: https://developer.blender.org/D8616
Diffstat (limited to 'source/blender/depsgraph/intern/node')
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_time.cc10
-rw-r--r--source/blender/depsgraph/intern/node/deg_node_time.h4
2 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/node/deg_node_time.cc b/source/blender/depsgraph/intern/node/deg_node_time.cc
index af931fbae34..4f7f70fef33 100644
--- a/source/blender/depsgraph/intern/node/deg_node_time.cc
+++ b/source/blender/depsgraph/intern/node/deg_node_time.cc
@@ -31,8 +31,16 @@
namespace blender {
namespace deg {
-void TimeSourceNode::tag_update(Depsgraph *graph, eUpdateSource /*source*/)
+void TimeSourceNode::tag_update(Depsgraph * /*graph*/, eUpdateSource /*source*/)
{
+ tagged_for_update = true;
+}
+
+void TimeSourceNode::flush_update_tag(Depsgraph *graph)
+{
+ if (!tagged_for_update) {
+ return;
+ }
for (Relation *rel : outlinks) {
Node *node = rel->to;
node->tag_update(graph, DEG_UPDATE_SOURCE_TIME);
diff --git a/source/blender/depsgraph/intern/node/deg_node_time.h b/source/blender/depsgraph/intern/node/deg_node_time.h
index fe17684abb0..79ad92f336f 100644
--- a/source/blender/depsgraph/intern/node/deg_node_time.h
+++ b/source/blender/depsgraph/intern/node/deg_node_time.h
@@ -30,10 +30,14 @@ namespace deg {
/* Time Source Node. */
struct TimeSourceNode : public Node {
+ bool tagged_for_update = false;
+
// TODO: evaluate() operation needed
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override;
+ void flush_update_tag(Depsgraph *graph);
+
DEG_DEPSNODE_DECLARE;
};