Cycles: svn merge -r39457:39669 https://svn.blender.org/svnroot/bf-blender/trunk...
[blender-staging.git] / source / blender / makesrna / intern / rna_scene.c
index 552ff7b6365b8217be4c1fa60dbd77ce9ee28055..dd8ae7f049c5bc74e2a45d2064295beb088fca4b 100644 (file)
@@ -41,6 +41,7 @@
 #include "DNA_userdef_types.h"
 
 /* Include for Bake Options */
+#include "RE_engine.h"
 #include "RE_pipeline.h"
 
 #ifdef WITH_QUICKTIME
@@ -56,6 +57,8 @@
 #include <libavformat/avformat.h>
 #endif
 
+#include "ED_render.h"
+
 #include "WM_api.h"
 #include "WM_types.h"
 
@@ -752,6 +755,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;
@@ -2964,7 +2972,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, engine_items);
        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);