Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-11-11 07:08:09 +0300
committerMartin Poirier <theeth@yahoo.com>2009-11-11 07:08:09 +0300
commite776ecfddec846b50b6bbd86f2ea56d159b6f237 (patch)
tree2f52be68814102c174e77c2d080061eaa43e2038 /source/creator
parentf7d71499369fabc19ebc46ca723b6437943005de (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/creator')
-rw-r--r--source/creator/creator.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 84e6eed9278..b4c962cbfc8 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -508,6 +508,27 @@ int main(int argc, char **argv)
#endif
}
else {
+ for(a=1; a<argc; a++) {
+ if(argv[a][0] == '-') {
+ switch(argv[a][1]) {
+ case 'd':
+ G.f |= G_DEBUG; /* std output printf's */
+ printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
+ MEM_set_memory_debug();
+#ifdef NAN_BUILDINFO
+ printf("Build: %s %s %s %s\n", build_date, build_time, build_platform, build_type);
+
+#endif // NAN_BUILDINFO
+ for (i = 0; i < argc; i++) {
+ printf("argv[%d] = %s\n", i, argv[i]);
+ }
+ break;
+ }
+ }
+ }
+
+ WM_init(C);
+
#ifndef DISABLE_PYTHON
BPY_start_python(argc, argv);
#endif
@@ -524,13 +545,11 @@ int main(int argc, char **argv)
*/
BPY_post_start_python();
- if(!G.background)
- BPY_run_ui_scripts(C, 0); /* dont need to reload the first time */
+ BPY_run_ui_scripts(C, 0); /* dont need to reload the first time */
#endif
CTX_py_init_set(C, 1);
- if(!G.background)
- WM_keymap_init(C); /* after BPY_run_ui_scripts() */
+ WM_keymap_init(C); /* after BPY_run_ui_scripts() */
#ifdef WITH_QUICKTIME
@@ -843,7 +862,11 @@ int main(int argc, char **argv)
/*we successfully loaded a blend file, get sure that
pointcache works */
- if (retval!=0) G.relbase_valid = 1;
+ if (retval!=0) {
+ CTX_wm_manager_set(C, NULL); /* remove wm to force check */
+ WM_check(C);
+ G.relbase_valid = 1;
+ }
/* happens for the UI on file reading too (huh? (ton))*/
// XXX BKE_reset_undo();