diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-11-11 07:08:09 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-11-11 07:08:09 +0300 |
commit | e776ecfddec846b50b6bbd86f2ea56d159b6f237 (patch) | |
tree | 2f52be68814102c174e77c2d080061eaa43e2038 /source/blender/windowmanager/intern/wm.c | |
parent | f7d71499369fabc19ebc46ca723b6437943005de (diff) |
Background mode in more working conditions.
What works:
The usual command line options for rendering.
All python scripts are loaded (which includes custom properties)
Render engines are loaded and can be used
-P to run scripts works partially: rna api works ok, not operators.
What doesn't:
Most operator calls in python. This is a problem with poll functions. (Brecht and Campbell are aware of this already)
Changes:
-d now also applied with -b (it was ignored before)
user file (.B25.blend) now also loaded in bg mode. This helps for custom paths and all.
wm is also initialized (it's needed for a lot of context calls)
Ghost, however, is not initialized.
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 1d173005d85..d455c8b2bc1 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -43,6 +43,7 @@ #include "BKE_main.h" #include "BKE_screen.h" #include "BKE_report.h" +#include "BKE_global.h" #include "WM_api.h" #include "WM_types.h" @@ -196,7 +197,7 @@ void WM_keymap_init(bContext *C) WM_keyconfig_userdef(wm); } -void wm_check(bContext *C) +void WM_check(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); @@ -208,19 +209,21 @@ void wm_check(bContext *C) if(wm==NULL) return; if(wm->windows.first==NULL) return; - /* case: fileread */ - if((wm->initialized & WM_INIT_WINDOW) == 0) { - WM_keymap_init(C); - WM_autosave_init(C); - } - - /* case: no open windows at all, for old file reads */ - wm_window_add_ghostwindows(wm); - - /* case: fileread */ - if((wm->initialized & WM_INIT_WINDOW) == 0) { - ED_screens_initialize(wm); - wm->initialized |= WM_INIT_WINDOW; + if (!G.background) { + /* case: fileread */ + if((wm->initialized & WM_INIT_WINDOW) == 0) { + WM_keymap_init(C); + WM_autosave_init(C); + } + + /* case: no open windows at all, for old file reads */ + wm_window_add_ghostwindows(wm); + + /* case: fileread */ + if((wm->initialized & WM_INIT_WINDOW) == 0) { + ED_screens_initialize(wm); + wm->initialized |= WM_INIT_WINDOW; + } } } |