diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-27 15:42:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-27 15:42:01 +0300 |
commit | 119bd10d9519aa70c32013557f76561cd352e6b2 (patch) | |
tree | 8bf3ae0ef42df0f4c0f1d03b982f8a261b7ec397 /source | |
parent | 865ceab54540d20cb2044c00fb69386f5557e6ca (diff) |
Fix #21543: running python script from command line would lose active
scene from context for background render. Ideally this should not be
using the context to get the scene but currently the active scene is
not stored anywhere, as it's a concept we tried to get rid of.. just
did a simple fix for now.
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/creator.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 365d358b840..df09b8d26ef 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -796,6 +796,7 @@ static int run_python(int argc, char **argv, void *data) /* XXX, temp setting the WM is ugly, splash also does this :S */ wmWindowManager *wm= CTX_wm_manager(C); wmWindow *prevwin= CTX_wm_window(C); + Scene *prevscene= CTX_data_scene(C); if(wm->windows.first) { CTX_wm_window_set(C, wm->windows.first); @@ -808,6 +809,9 @@ static int run_python(int argc, char **argv, void *data) fprintf(stderr, "Python script \"%s\" running with missing context data.\n", argv[1]); BPY_run_python_script(C, filename, NULL, NULL); // use reports? } + + CTX_data_scene_set(C, prevscene); + return 1; } else { printf("\nError: you must specify a Python script after '-P '.\n"); |