[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57319] trunk/blender/intern/cycles/ blender/blender_sync.cpp: Fix #35696: cycles crash with no world assigned to scene, after recent changes.

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Jun 9 20:05:53 CEST 2013


Revision: 57319
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57319
Author:   blendix
Date:     2013-06-09 18:05:53 +0000 (Sun, 09 Jun 2013)
Log Message:
-----------
Fix #35696: cycles crash with no world assigned to scene, after recent changes.

Modified Paths:
--------------
    trunk/blender/intern/cycles/blender/blender_sync.cpp

Modified: trunk/blender/intern/cycles/blender/blender_sync.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_sync.cpp	2013-06-09 18:05:50 UTC (rev 57318)
+++ trunk/blender/intern/cycles/blender/blender_sync.cpp	2013-06-09 18:05:53 UTC (rev 57319)
@@ -211,7 +211,6 @@
 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 @@
 	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();
+	if(b_scene.world()) {
+		BL::WorldMistSettings b_mist = b_scene.world().mist_settings();
 
-	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;
+		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))




More information about the Bf-blender-cvs mailing list