diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-28 19:54:00 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-28 19:55:56 +0300 |
commit | 382218beb29f52e1ea5c10803edf95a937878308 (patch) | |
tree | f435025a91e8cce8627898f2f269db4fa48a6f3b /source/blender/depsgraph/intern/depsgraph_eval.cc | |
parent | 4a892adac5937fdaa19d0309e5195a83bdb14e72 (diff) |
Point cache: Pass EvaluationContext for all the related functions
Now the only missing bit seems to be in Cycles to pass depsgraph to
builtin_image_float_pixels().
Ideally we could get evaluation context instead of using depsgraph + settings.
But for the other rna EvaluationContext functions this is how we are doing.
Reviewers: sergey, brecht
Differential Revision: https://developer.blender.org/D3087
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_eval.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_eval.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index ddb049a0043..d76eba29628 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -39,10 +39,12 @@ extern "C" { #include "BKE_scene.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" } /* extern "C" */ #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "intern/eval/deg_eval.h" #include "intern/eval/deg_eval_flush.h" @@ -111,6 +113,20 @@ void DEG_evaluation_context_init_from_view_layer_for_render( eval_ctx->engine_type = NULL; } +void DEG_evaluation_context_init_from_depsgraph( + EvaluationContext *eval_ctx, + Depsgraph *depsgraph, + eEvaluationMode mode) +{ + Scene *scene = DEG_get_evaluated_scene(depsgraph); + DEG_evaluation_context_init(eval_ctx, mode); + eval_ctx->ctime = (float)scene->r.cfra + scene->r.subframe; + eval_ctx->object_mode = OB_MODE_OBJECT; + eval_ctx->depsgraph = depsgraph; + eval_ctx->view_layer = DEG_get_evaluated_view_layer(depsgraph); + eval_ctx->engine_type = NULL; +} + /* Free evaluation context. */ void DEG_evaluation_context_free(EvaluationContext *eval_ctx) { |