Pass EvaluationContext argument everywhere
[blender.git] / source / blender / makesrna / intern / rna_render.c
index 267a81c81af8d535d2e318c562b86844c9313178..19002d1229b0b1ba0631c2c340ec157288a1700e 100644 (file)
@@ -385,6 +385,16 @@ static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr)
        }
 }
 
+static PointerRNA rna_RenderEngine_scene_layer_get(PointerRNA *ptr)
+{
+       RenderEngine *engine = (RenderEngine *)ptr->data;
+       if (engine->re != NULL) {
+               SceneLayer* scene_layer = RE_engine_get_scene_layer(engine->re);
+               return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, scene_layer);
+       }
+       return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, NULL);
+}
+
 static PointerRNA rna_RenderEngine_camera_override_get(PointerRNA *ptr)
 {
        RenderEngine *engine = (RenderEngine *)ptr->data;
@@ -729,6 +739,11 @@ static void rna_def_render_engine(BlenderRNA *brna)
        prop = RNA_def_enum(func, "type", render_pass_type_items, SOCK_FLOAT, "Type", "");
        RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 
+       prop = RNA_def_property(srna, "scene_layer", PROP_POINTER, PROP_NONE);
+       RNA_def_property_struct_type(prop, "SceneLayer");
+       RNA_def_property_pointer_funcs(prop, "rna_RenderEngine_scene_layer_get", NULL, NULL, NULL);
+       RNA_def_property_ui_text(prop, "Scene layer", "");
+
        /* registration */
 
        prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);