From 28add50083204e99121c5290242652ccd3fcca9e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 9 Jun 2013 18:05:53 +0000 Subject: Fix #35696: cycles crash with no world assigned to scene, after recent changes. --- intern/cycles/blender/blender_sync.cpp | 31 +++++++++++++++++-------------- 1 file 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)) -- cgit v1.2.3