Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
[blender.git] / source / blender / blenkernel / intern / world.c
index 434bfe19c1f83c0b6127a9560a2d369cdda4d0ca..206f829eaa83e4b4f82c95656a8a36a7121456e8 100644 (file)
@@ -40,7 +40,6 @@
 
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
-#include "BLI_bpath.h"
 
 #include "BKE_animsys.h"
 #include "BKE_global.h"
@@ -80,9 +79,8 @@ void BKE_world_free(World *wrld)
        BKE_world_free_ex(wrld, TRUE);
 }
 
-World *add_world(const char *name)
+World *add_world(Main *bmain, const char *name)
 {
-       Main *bmain = G.main;
        World *wrld;
 
        wrld = BKE_libblock_alloc(&bmain->world, ID_WO, name);
@@ -107,7 +105,7 @@ World *add_world(const char *name)
        wrld->ao_indirect_energy = 1.0f;
        wrld->ao_indirect_bounces = 1;
        wrld->aobias = 0.05f;
-       wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY;    
+       wrld->ao_samp_method = WO_AOSAMP_HAMMERSLEY;
        wrld->ao_approx_error = 0.25f;
        
        wrld->preview = NULL;