diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-22 17:56:39 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-22 17:56:39 +0400 |
commit | 27e94f7cbe21c43899d9f889c1e1078ca1df7d8c (patch) | |
tree | 61c02b1d09a2a177fc164b781d7a0b4dc8e5de07 /intern | |
parent | 3fa4b6ea7d932d5be9abbf306bbaf342d20c519f (diff) |
Fix #29935: missing cycles update/crash when removing world datablock form scene.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index bc7868e0192..c805bd03063 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -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); + } } } |