diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-09 22:05:53 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-09 22:05:53 +0400 |
commit | 28add50083204e99121c5290242652ccd3fcca9e (patch) | |
tree | f38390dbd6200b0ae84b5cc041718815168f9046 | |
parent | 860fce4eb97e4961065afad76f7b0915600b1ddb (diff) |
Fix #35696: cycles crash with no world assigned to scene, after recent changes.
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index ef9ce85ddf8..72ed1b84915 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -211,7 +211,6 @@ void BlenderSync::sync_integrator() void BlenderSync::sync_film() { PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); - BL::WorldMistSettings b_mist = b_scene.world().mist_settings(); Film *film = scene->film; Film prevfilm = *film; @@ -220,19 +219,23 @@ void BlenderSync::sync_film() film->filter_type = (FilterType)RNA_enum_get(&cscene, "filter_type"); film->filter_width = (film->filter_type == FILTER_BOX)? 1.0f: get_float(cscene, "filter_width"); - film->mist_start = b_mist.start(); - film->mist_depth = b_mist.depth(); - - switch(b_mist.falloff()) { - case BL::WorldMistSettings::falloff_QUADRATIC: - film->mist_falloff = 2.0f; - break; - case BL::WorldMistSettings::falloff_LINEAR: - film->mist_falloff = 1.0f; - break; - case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC: - film->mist_falloff = 0.5f; - break; + if(b_scene.world()) { + BL::WorldMistSettings b_mist = b_scene.world().mist_settings(); + + film->mist_start = b_mist.start(); + film->mist_depth = b_mist.depth(); + + switch(b_mist.falloff()) { + case BL::WorldMistSettings::falloff_QUADRATIC: + film->mist_falloff = 2.0f; + break; + case BL::WorldMistSettings::falloff_LINEAR: + film->mist_falloff = 1.0f; + break; + case BL::WorldMistSettings::falloff_INVERSE_QUADRATIC: + film->mist_falloff = 0.5f; + break; + } } if(film->modified(prevfilm)) |