Fix #29935: missing cycles update/crash when removing world datablock form scene.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 22 Jan 2012 13:56:39 +0000 (13:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 22 Jan 2012 13:56:39 +0000 (13:56 +0000)
intern/cycles/blender/blender_object.cpp
source/blender/makesrna/intern/rna_scene.c
source/blender/quicktime/quicktime_export.h

index bc7868e01921d0feb54e3fc21a6703bb3cc4d95e..c805bd0306349201c7330918e34ef71df509cd4b 100644 (file)
@@ -159,24 +159,26 @@ void BlenderSync::sync_background_light()
 {
        BL::World b_world = b_scene.world();
 
-       PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
-       bool sample_as_light = get_boolean(cworld, "sample_as_light");
-
-       if(sample_as_light) {
-               /* test if we need to sync */
-               Light *light;
-               ObjectKey key(b_world, 0, b_world);
-
-               if(light_map.sync(&light, b_world, b_world, key) ||
-                  world_recalc ||
-                  b_world.ptr.data != world_map)
-               {
-                       light->type = LIGHT_BACKGROUND;
-                       light->map_resolution  = get_int(cworld, "sample_map_resolution");
-                       light->shader = scene->default_background;
-
-                       light->tag_update(scene);
-                       light_map.set_recalc(b_world);
+       if(b_world) {
+               PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
+               bool sample_as_light = get_boolean(cworld, "sample_as_light");
+
+               if(sample_as_light) {
+                       /* test if we need to sync */
+                       Light *light;
+                       ObjectKey key(b_world, 0, b_world);
+
+                       if(light_map.sync(&light, b_world, b_world, key) ||
+                          world_recalc ||
+                          b_world.ptr.data != world_map)
+                       {
+                               light->type = LIGHT_BACKGROUND;
+                               light->map_resolution  = get_int(cworld, "sample_map_resolution");
+                               light->shader = scene->default_background;
+
+                               light->tag_update(scene);
+                               light_map.set_recalc(b_world);
+                       }
                }
        }
 
index 7f01a9387b5f2204d1dcce0e15583b894472e929..83c82cdeb5ba11bfac65d31edddce7a5e16ffc57 100644 (file)
@@ -3957,7 +3957,7 @@ void RNA_def_scene(BlenderRNA *brna)
        prop= RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
-       RNA_def_property_update(prop, NC_SCENE|ND_WORLD, NULL);
+       RNA_def_property_update(prop, NC_SCENE|ND_WORLD, "rna_Scene_glsl_update");
 
        prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "cursor");
index f64521bda35889638ebf5d66fd7077d906a056e3..71827b1e202cb36d6d89297c8e41c9547db7d78c 100644 (file)
@@ -50,10 +50,11 @@ typedef struct QuicktimeCodecTypeDesc {
 } QuicktimeCodecTypeDesc ;
 
 // quicktime movie output functions
+struct ImageFormatData;
 struct RenderData;
+struct ReportList;
 struct Scene;
 struct wmOperatorType;
-struct ReportList;
 
 int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports);    //for movie handle (BKE writeavi.c now)
 int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports);