[Bf-blender-cvs] [52b36af] depsgraph_refactor: Depsgraph: Fix for scene update might have been using wrong time

Sergey Sharybin noreply at git.blender.org
Mon Feb 23 19:39:52 CET 2015


Commit: 52b36af9e5279ce585331a3963921c4c22646354
Author: Sergey Sharybin
Date:   Mon Feb 23 23:39:27 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB52b36af9e5279ce585331a3963921c4c22646354

Depsgraph: Fix for scene update might have been using wrong time

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

M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/depsgraph/DEG_depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_eval.cpp

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

diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index eee5604..315f3f4 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -2846,7 +2846,7 @@ void BKE_animsys_eval_animdata(EvaluationContext *eval_ctx, ID *id)
 	Scene *scene = NULL; /* XXX: this is only needed for flushing RNA updates,
 	                      * which should get handled as part of the graph instead...
 	                      */
-	DEBUG_PRINT("%s on %s\n", __func__, id->name);
+	DEBUG_PRINT("%s on %s, time=%f\n\n", __func__, id->name, (double)eval_ctx->ctime);
 	BKE_animsys_evaluate_animdata(scene, id, adt, eval_ctx->ctime, ADT_RECALC_ANIM);
 }
 
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 5fd0eb1..de8e8d5 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1718,13 +1718,13 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
 	 * only objects and scenes. - brecht */
 #ifdef WITH_LEGACY_DEPSGRAPH
 	if (use_new_eval) {
-		DEG_evaluate_on_refresh(eval_ctx, bmain, scene->depsgraph);
+		DEG_evaluate_on_refresh(eval_ctx, bmain, scene->depsgraph, scene);
 	}
 	else {
 		scene_update_tagged_recursive(eval_ctx, bmain, scene, scene);
 	}
 #else
-	DEG_evaluate_on_refresh(eval_ctx, bmain, scene->depsgraph);
+	DEG_evaluate_on_refresh(eval_ctx, bmain, scene->depsgraph, scene);
 #endif
 
 	/* update sound system animation (TODO, move to depsgraph) */
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index c61cd32..4498ba9 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -185,7 +185,8 @@ void DEG_evaluate_on_refresh_ex(struct EvaluationContext *eval_ctx,
  */
 void DEG_evaluate_on_refresh(struct EvaluationContext *eval_ctx,
                              struct Main *bmain,
-                             Depsgraph *graph);
+                             Depsgraph *graph,
+                             struct Scene *scene);
 
 /* Editors Integration  -------------------------- */
 
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cpp b/source/blender/depsgraph/intern/depsgraph_eval.cpp
index c038f8f..c1332a4 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cpp
@@ -35,6 +35,7 @@ extern "C" {
 #include "BLI_task.h"
 
 #include "BKE_depsgraph.h"
+#include "BKE_scene.h"
 
 #include "DEG_depsgraph.h"
 } /* extern "C" */
@@ -280,6 +281,8 @@ static void schedule_children(TaskPool *pool,
 /* Evaluate all nodes tagged for updating,
  * ! This is usually done as part of main loop, but may also be
  *   called from frame-change update.
+ *
+ * NOTE: Time sources should be all valid!
  */
 void DEG_evaluate_on_refresh_ex(EvaluationContext *eval_ctx,
                                 Main *bmain,
@@ -348,8 +351,13 @@ void DEG_evaluate_on_refresh_ex(EvaluationContext *eval_ctx,
 /* Evaluate all nodes tagged for updating. */
 void DEG_evaluate_on_refresh(EvaluationContext *eval_ctx,
                              Main *bmain,
-                             Depsgraph *graph)
+                             Depsgraph *graph,
+                             Scene *scene)
 {
+	/* Update time on primary timesource. */
+	TimeSourceDepsNode *tsrc = graph->find_time_source();
+	tsrc->cfra = BKE_scene_frame_get(scene);;
+
 	DEG_evaluate_on_refresh_ex(eval_ctx, bmain, graph, graph->layers);
 }




More information about the Bf-blender-cvs mailing list