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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-06 13:07:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-16 20:55:33 +0300
commit34ab90f546f097cada951b2c9ca22bf271996980 (patch)
treeebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/depsgraph/intern/depsgraph_eval.cc
parent0c495005dd83913864acb510c1d4194a2275dbb0 (diff)
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_eval.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc70
1 files changed, 0 insertions, 70 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index ac92d440bbe..edb6600f3e0 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -55,76 +55,6 @@ extern "C" {
#include "intern/depsgraph.h"
-/* ****************** */
-/* Evaluation Context */
-
-/* Create new evaluation context. */
-EvaluationContext *DEG_evaluation_context_new(eEvaluationMode mode)
-{
- EvaluationContext *eval_ctx =
- (EvaluationContext *)MEM_callocN(sizeof(EvaluationContext),
- "EvaluationContext");
- DEG_evaluation_context_init(eval_ctx, mode);
- return eval_ctx;
-}
-
-/**
- * Initialize evaluation context.
- * 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,
- eEvaluationMode mode)
-{
- eval_ctx->mode = mode;
-}
-
-void DEG_evaluation_context_init_from_scene(
- EvaluationContext *eval_ctx,
- Scene *scene,
- ViewLayer *view_layer,
- eEvaluationMode mode)
-{
- DEG_evaluation_context_init(eval_ctx, mode);
- eval_ctx->depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
- eval_ctx->view_layer = view_layer;
- eval_ctx->ctime = BKE_scene_frame_get(scene);
-}
-
-void DEG_evaluation_context_init_from_view_layer_for_render(
- EvaluationContext *eval_ctx,
- Depsgraph *depsgraph,
- Scene *scene,
- ViewLayer *view_layer)
-{
- /* ViewLayer may come from a copy of scene.viewlayers, we need to find the original though. */
- ViewLayer *view_layer_original = (ViewLayer *)BLI_findstring(&scene->view_layers, view_layer->name, offsetof(ViewLayer, name));
- BLI_assert(view_layer_original != NULL);
-
- DEG_evaluation_context_init(eval_ctx, DAG_EVAL_RENDER);
- eval_ctx->ctime = BKE_scene_frame_get(scene);
- eval_ctx->depsgraph = depsgraph;
- eval_ctx->view_layer = view_layer_original;
-}
-
-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->depsgraph = depsgraph;
- eval_ctx->view_layer = DEG_get_evaluated_view_layer(depsgraph);
-}
-
-/* Free evaluation context. */
-void DEG_evaluation_context_free(EvaluationContext *eval_ctx)
-{
- MEM_freeN(eval_ctx);
-}
-
/* Evaluate all nodes tagged for updating. */
void DEG_evaluate_on_refresh(Depsgraph *graph)
{