Merge branch 'master' into blender2.8
[blender.git] / source / blender / nodes / composite / nodes / node_composite_image.c
index 1e240c2f84b7d49156776d0daaed793a5008a4a4..7712d7d0e71091864b88d81f6acae5f97fac011a 100644 (file)
@@ -41,6 +41,7 @@
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
+#include "BKE_scene.h"
 
 /* **************** IMAGE (and RenderResult, multilayer image) ******************** */
 
@@ -190,16 +191,16 @@ typedef struct RLayerUpdateData {
        int prev_index;
 } RLayerUpdateData;
 
-void node_cmp_rlayers_register_pass(bNodeTree *ntree, bNode *node, Scene *scene, SceneRenderLayer *srl, const char *name, int type)
+void node_cmp_rlayers_register_pass(bNodeTree *ntree, bNode *node, Scene *scene, ViewLayer *view_layer, const char *name, int type)
 {
        RLayerUpdateData *data = node->storage;
 
-       if (scene == NULL || srl == NULL || data == NULL || node->id != (ID *)scene) {
+       if (scene == NULL || view_layer == NULL || data == NULL || node->id != (ID *)scene) {
                return;
        }
 
-       SceneRenderLayer *node_srl = BLI_findlink(&scene->r.layers, node->custom1);
-       if (node_srl != srl) {
+       ViewLayer *node_view_layer = BLI_findlink(&scene->view_layers, node->custom1);
+       if (node_view_layer != view_layer) {
                return;
        }
 
@@ -218,17 +219,17 @@ static void cmp_node_rlayer_create_outputs(bNodeTree *ntree, bNode *node, LinkNo
        Scene *scene = (Scene *)node->id;
 
        if (scene) {
-               RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
+               RenderEngineType *engine_type = RE_engines_find(scene->view_render.engine_id);
                if (engine_type && engine_type->update_render_passes) {
-                       SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, node->custom1);
-                       if (srl) {
+                       ViewLayer *view_layer = BLI_findlink(&scene->view_layers, node->custom1);
+                       if (view_layer) {
                                RLayerUpdateData *data = MEM_mallocN(sizeof(RLayerUpdateData), "render layer update data");
                                data->available_sockets = available_sockets;
                                data->prev_index = -1;
                                node->storage = data;
 
                                RenderEngine *engine = RE_engine_create(engine_type);
-                               engine_type->update_render_passes(engine, scene, srl);
+                               engine_type->update_render_passes(engine, scene, view_layer);
                                RE_engine_free(engine);
 
                                MEM_freeN(data);