From 340bfdef2e424c59e85785c1660db805b3255882 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 6 Apr 2018 09:17:53 +0200 Subject: Depsgraph: store mode and time in depsgraph, add view layer / scene accessors. Scene, view layer and mode are now set in the constructor and never changed. Time is updated on frame changes to indicate which frame is being or has been evaluated last. This is a step towards making EvaluationContext obsolete. Differential Revision: https://developer.blender.org/D3144 --- source/blender/depsgraph/intern/depsgraph_eval.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/depsgraph/intern/depsgraph_eval.cc') diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 0b3e4fd8db9..d50e55e4cfb 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -134,9 +134,10 @@ void DEG_evaluate_on_refresh(EvaluationContext *eval_ctx, Depsgraph *graph) { DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + deg_graph->ctime = BKE_scene_frame_get(deg_graph->scene); /* Update time on primary timesource. */ DEG::TimeSourceDepsNode *tsrc = deg_graph->find_time_source(); - tsrc->cfra = BKE_scene_frame_get(deg_graph->scene); + tsrc->cfra = deg_graph->ctime; DEG::deg_evaluate_on_refresh(eval_ctx, deg_graph); } @@ -147,6 +148,7 @@ void DEG_evaluate_on_framechange(EvaluationContext *eval_ctx, float ctime) { DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + deg_graph->ctime = ctime; /* Update time on primary timesource. */ DEG::TimeSourceDepsNode *tsrc = deg_graph->find_time_source(); tsrc->cfra = ctime; -- cgit v1.2.3