From 496be8244ef62868fd7345f06bea05febd912281 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 May 2010 08:10:05 +0000 Subject: fix for crash baking in background mode. --- source/blender/editors/physics/physics_pointcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/physics/physics_pointcache.c') diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index 689e51339f9..5ebbb00939e 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -89,7 +89,7 @@ void bake_console_progress_end(void *arg) static int ptcache_bake_all_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); - wmWindow *win = CTX_wm_window(C); + wmWindow *win = G.background ? NULL : CTX_wm_window(C); PTCacheBaker baker; @@ -171,7 +171,7 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot) static int ptcache_bake_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - wmWindow *win = CTX_wm_window(C); + wmWindow *win = G.background ? NULL : CTX_wm_window(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); Object *ob= ptr.id.data; PointCache *cache= ptr.data; -- cgit v1.2.3