From 06dc059f48da7fdb4149c07ffd03aff6c9fa35a2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Sep 2018 14:09:07 +0200 Subject: Depsgraph: update frame in scene on frame change. Normally the time can be read from DEG_get_ctime(depsgraph), but this is a bit more forgiving for e.g. addons that don't care too much about the details of the COW depsgraph. --- source/blender/depsgraph/intern/depsgraph_eval.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index edb6600f3e0..5b6516509b0 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -63,6 +63,10 @@ void DEG_evaluate_on_refresh(Depsgraph *graph) /* Update time on primary timesource. */ DEG::TimeSourceDepsNode *tsrc = deg_graph->find_time_source(); tsrc->cfra = deg_graph->ctime; + /* Update time in scene. */ + if (deg_graph->scene_cow) { + BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); + } DEG::deg_evaluate_on_refresh(deg_graph); } @@ -78,6 +82,10 @@ void DEG_evaluate_on_framechange(Main *bmain, tsrc->cfra = ctime; tsrc->tag_update(deg_graph); DEG::deg_graph_flush_updates(bmain, deg_graph); + /* Update time in scene. */ + if (deg_graph->scene_cow) { + BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime); + } /* Perform recalculation updates. */ DEG::deg_evaluate_on_refresh(deg_graph); } -- cgit v1.2.3