Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-07-26 17:27:15 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-26 17:33:44 +0300
commita01c1849e9f593e277da044c4f30a459d9391d75 (patch)
tree6cc8df5fbb7407b25dced0dabeaa5e81befe44bb /source/blender/depsgraph/intern/depsgraph_eval.cc
parente99350aeaa82ffd3765ea0b2c03e57ba3b837646 (diff)
Depsgraph: Add utility function to initialize evaluation context from scene and layer
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_eval.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index 73a0428c264..77a32740524 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -56,7 +56,7 @@ extern "C" {
/* Evaluation Context */
/* Create new evaluation context. */
-EvaluationContext *DEG_evaluation_context_new(int mode)
+EvaluationContext *DEG_evaluation_context_new(eEvaluationMode mode)
{
EvaluationContext *eval_ctx =
(EvaluationContext *)MEM_callocN(sizeof(EvaluationContext),
@@ -70,11 +70,22 @@ EvaluationContext *DEG_evaluation_context_new(int mode)
* Used by the areas which currently overrides the context or doesn't have
* access to a proper one.
*/
-void DEG_evaluation_context_init(EvaluationContext *eval_ctx, int mode)
+void DEG_evaluation_context_init(EvaluationContext *eval_ctx,
+ eEvaluationMode mode)
{
eval_ctx->mode = mode;
}
+void DEG_evaluation_context_init_from_scene(EvaluationContext *eval_ctx,
+ Scene *scene,
+ SceneLayer *scene_layer,
+ eEvaluationMode mode)
+{
+ DEG_evaluation_context_init(eval_ctx, mode);
+ eval_ctx->scene_layer = scene_layer;
+ eval_ctx->ctime = BKE_scene_frame_get(scene);
+}
+
/* Free evaluation context. */
void DEG_evaluation_context_free(EvaluationContext *eval_ctx)
{