Rename any instance of scene layer or render layer in code with view layer
[blender.git] / source / blender / depsgraph / intern / depsgraph_eval.cc
index 9235069f531f763ea63df2a5c9c6f5d50ebac1f1..31332b416d58493639e54eed0fb6c961bcd6530f 100644 (file)
@@ -37,6 +37,8 @@
 
 extern "C" {
 #include "BKE_scene.h"
+
+#include "DNA_scene_types.h"
 } /* extern "C" */
 
 #include "DEG_depsgraph.h"
@@ -78,14 +80,16 @@ void DEG_evaluation_context_init(EvaluationContext *eval_ctx,
 
 void DEG_evaluation_context_init_from_scene(EvaluationContext *eval_ctx,
                                             Scene *scene,
-                                            SceneLayer *scene_layer,
+                                            ViewLayer *view_layer,
                                             RenderEngineType *engine,
                                             eEvaluationMode mode)
 {
        DEG_evaluation_context_init(eval_ctx, mode);
-       eval_ctx->scene_layer = scene_layer;
+       eval_ctx->depsgraph = BKE_scene_get_depsgraph(scene, view_layer, false);
+       eval_ctx->view_layer = view_layer;
        eval_ctx->engine = engine;
        eval_ctx->ctime = BKE_scene_frame_get(scene);
+       BLI_assert(eval_ctx->depsgraph != NULL);
 }
 
 /* Free evaluation context. */
@@ -96,13 +100,12 @@ void DEG_evaluation_context_free(EvaluationContext *eval_ctx)
 
 /* Evaluate all nodes tagged for updating. */
 void DEG_evaluate_on_refresh(EvaluationContext *eval_ctx,
-                             Depsgraph *graph,
-                             Scene *scene)
+                             Depsgraph *graph)
 {
        DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
        /* Update time on primary timesource. */
        DEG::TimeSourceDepsNode *tsrc = deg_graph->find_time_source();
-       tsrc->cfra = BKE_scene_frame_get(scene);
+       tsrc->cfra = BKE_scene_frame_get(deg_graph->scene);
        DEG::deg_evaluate_on_refresh(eval_ctx, deg_graph);
 }