diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 10:17:53 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-13 15:17:22 +0300 |
commit | 340bfdef2e424c59e85785c1660db805b3255882 (patch) | |
tree | d4677eef333ecd0d9d07e8d87b7d31aa254bf02d /source/blender/depsgraph/intern/depsgraph_query.cc | |
parent | 5d7952d9c75d087b551ab95dff90ee2f7f636417 (diff) |
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
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query.cc | 25 |
1 files changed, 25 insertions, 0 deletions
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<const DEG::Depsgraph *>(graph); + return deg_graph->scene; +} + +struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph); + return deg_graph->view_layer; +} + +eEvaluationMode DEG_get_mode(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(graph); + return deg_graph->mode; +} + +float DEG_get_ctime(const Depsgraph *graph) +{ + const DEG::Depsgraph *deg_graph = reinterpret_cast<const DEG::Depsgraph *>(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; |