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_query.cc | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc') diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 4e70e56ae71..6f0ba26c8f7 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -49,6 +49,31 @@ extern "C" { #include "intern/depsgraph_intern.h" #include "intern/nodes/deg_node_id.h" +struct Scene *DEG_get_input_scene(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + return deg_graph->scene; +} + +struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + return deg_graph->view_layer; +} + +eEvaluationMode DEG_get_mode(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + return deg_graph->mode; +} + +float DEG_get_ctime(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + return deg_graph->ctime; +} + + bool DEG_id_type_tagged(Main *bmain, short id_type) { return bmain->id_tag_update[BKE_idcode_to_index(id_type)] != 0; -- cgit v1.2.3