Cycles: svn merge -r41182:41205 ^/trunk/blender
[blender-staging.git] / source / blender / makesrna / intern / rna_scene.c
index 2a2c9c279ddf0a3b9c631d20abb1867c5355fdac..d525af29d6b5cb691bbd4fc10cbea683f3630497 100644 (file)
@@ -42,6 +42,7 @@
 #include "BLI_math.h"
 
 /* Include for Bake Options */
+#include "RE_engine.h"
 #include "RE_pipeline.h"
 
 #ifdef WITH_QUICKTIME
@@ -57,6 +58,8 @@
 #include <libavformat/avformat.h>
 #endif
 
+#include "ED_render.h"
+
 #include "WM_api.h"
 #include "WM_types.h"
 
@@ -775,6 +778,11 @@ static int rna_RenderSettings_engine_get(PointerRNA *ptr)
        return 0;
 }
 
+static void rna_RenderSettings_engine_update(Main *bmain, Scene *UNUSED(unused), PointerRNA *UNUSED(ptr))
+{
+       ED_render_engine_changed(bmain);
+}
+
 static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
        Scene *scene= (Scene*)ptr->id.data;
@@ -832,6 +840,12 @@ static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
        return (BLI_countlist(&R_engines) > 1);
 }
 
+static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
+{
+       Scene *scene= (Scene*)ptr->id.data;
+       return scene_use_new_shading_nodes(scene);
+}
+
 static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
 {
        RenderData *rd= (RenderData*)ptr->data;
@@ -3214,13 +3228,18 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        RNA_def_property_enum_funcs(prop, "rna_RenderSettings_engine_get", "rna_RenderSettings_engine_set",
                                    "rna_RenderSettings_engine_itemf");
        RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering");
-       RNA_def_property_update(prop, NC_WINDOW, NULL);
+       RNA_def_property_update(prop, NC_WINDOW, "rna_RenderSettings_engine_update");
 
        prop= RNA_def_property(srna, "has_multiple_engines", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_multiple_engines_get", NULL);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
 
+       prop= RNA_def_property(srna, "use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_shading_nodes_get", NULL);
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Use Shading Nodes", "Active render engine uses new shading nodes system");
+
        prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);