Fix: cycles not supporting scene background sets.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 23 May 2012 09:46:33 +0000 (09:46 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 23 May 2012 09:46:33 +0000 (09:46 +0000)
intern/cycles/blender/blender_object.cpp
source/blender/makesrna/intern/rna_scene.c

index 405c7ea..14d4c2f 100644 (file)
@@ -285,52 +285,55 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
 
        /* object loop */
        BL::Scene::objects_iterator b_ob;
+       BL::Scene b_sce = b_scene;
 
-       for(b_scene.objects.begin(b_ob); b_ob != b_scene.objects.end(); ++b_ob) {
-               bool hide = (render_layer.use_viewport_visibility)? b_ob->hide(): b_ob->hide_render();
-               uint ob_layer = get_layer(b_ob->layers());
+       for(; b_sce; b_sce = b_sce.background_set()) {
+               for(b_sce.objects.begin(b_ob); b_ob != b_sce.objects.end(); ++b_ob) {
+                       bool hide = (render_layer.use_viewport_visibility)? b_ob->hide(): b_ob->hide_render();
+                       uint ob_layer = get_layer(b_ob->layers());
 
-               if(!hide && (ob_layer & scene_layer)) {
-                       if(b_ob->is_duplicator()) {
-                               /* dupli objects */
-                               object_create_duplilist(*b_ob, b_scene);
+                       if(!hide && (ob_layer & scene_layer)) {
+                               if(b_ob->is_duplicator()) {
+                                       /* dupli objects */
+                                       object_create_duplilist(*b_ob, b_scene);
 
-                               BL::Object::dupli_list_iterator b_dup;
-                               int b_index = 0;
+                                       BL::Object::dupli_list_iterator b_dup;
+                                       int b_index = 0;
 
-                               for(b_ob->dupli_list.begin(b_dup); b_dup != b_ob->dupli_list.end(); ++b_dup) {
-                                       Transform tfm = get_transform(b_dup->matrix());
-                                       BL::Object b_dup_ob = b_dup->object();
-                                       bool dup_hide = (b_v3d)? b_dup_ob.hide(): b_dup_ob.hide_render();
+                                       for(b_ob->dupli_list.begin(b_dup); b_dup != b_ob->dupli_list.end(); ++b_dup) {
+                                               Transform tfm = get_transform(b_dup->matrix());
+                                               BL::Object b_dup_ob = b_dup->object();
+                                               bool dup_hide = (b_v3d)? b_dup_ob.hide(): b_dup_ob.hide_render();
 
-                                       if(!(b_dup->hide() || dup_hide))
-                                               sync_object(*b_ob, b_index, b_dup_ob, tfm, ob_layer, motion);
+                                               if(!(b_dup->hide() || dup_hide))
+                                                       sync_object(*b_ob, b_index, b_dup_ob, tfm, ob_layer, motion);
 
-                                       b_index++;
-                               }
-
-                               object_free_duplilist(*b_ob);
+                                               b_index++;
+                                       }
 
-                               hide = true;
-                       }
+                                       object_free_duplilist(*b_ob);
 
-                       /* check if we should render or hide particle emitter */
-                       BL::Object::particle_systems_iterator b_psys;
-                       bool render_emitter = false;
+                                       hide = true;
+                               }
 
-                       for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys) {
-                               if(b_psys->settings().use_render_emitter()) {
-                                       hide = false;
-                                       render_emitter = true;
+                               /* check if we should render or hide particle emitter */
+                               BL::Object::particle_systems_iterator b_psys;
+                               bool render_emitter = false;
+
+                               for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys) {
+                                       if(b_psys->settings().use_render_emitter()) {
+                                               hide = false;
+                                               render_emitter = true;
+                                       }
+                                       else if(!render_emitter)
+                                               hide = true;
                                }
-                               else if(!render_emitter)
-                                       hide = true;
-                       }
 
-                       if(!hide) {
-                               /* object itself */
-                               Transform tfm = get_transform(b_ob->matrix_world());
-                               sync_object(*b_ob, 0, *b_ob, tfm, ob_layer, motion);
+                               if(!hide) {
+                                       /* object itself */
+                                       Transform tfm = get_transform(b_ob->matrix_world());
+                                       sync_object(*b_ob, 0, *b_ob, tfm, ob_layer, motion);
+                               }
                        }
                }
        }
index e6a0401..5b355e5 100644 (file)
@@ -4214,7 +4214,7 @@ void RNA_def_scene(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK);
        RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL);
        RNA_def_property_ui_text(prop, "Background Scene", "Background set scene");
-       RNA_def_property_update(prop, NC_SCENE | NA_EDITED, NULL);
+       RNA_def_property_update(prop, NC_SCENE | NA_EDITED, "rna_Scene_glsl_update");
 
        prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EDITABLE);