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:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-03-31 08:18:39 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2004-03-31 08:18:39 +0400
commitfa0196b8f920c6662cf7bc1d74161febb36787cb (patch)
tree73d9b4be486aaccd67aafc7c73f9be1be52ffedd /source/creator
parent2b27a909f022ba568a7404d5283f70f8a569ff0e (diff)
BPython:
- tentative fix for scripts with CR/LF endings and split lines: in 2.32, the ac3d and vrml2 exporters, for example, had lines split with '\\\\' and so gave syntax errors when executed on Win platforms, because the scripts bundled with Win binaries had dos line endings. - Chris Keith has written code to execute Python scripts from the command-line, with '-P ' switch: "blender -P filename": a Blender.Quit function was also added, so Blender can quit after running the script (end the script with Blender.Quit()), but there's still work to be done in this part, including adding more functions, to load / save .blend files and to run scripts. More testing and discussions are necessary. Thanks Chris, for both your contributions and your patience, since I wasn't available to check / commit this for a while.
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 6b536f8e91a..0bc922e2d04 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -182,6 +182,7 @@ static void print_help(void)
printf (" -noaudio\tDisable audio on systems that support audio\n");
printf (" -h\t\tPrint this help text\n");
printf (" -y\t\tDisable OnLoad scene scripts, use -Y to find out why its -y\n");
+ printf (" -P <filename>\tRun the given Python script\n");
#ifdef WIN32
printf (" -R\t\tRegister .blend extension\n");
#endif
@@ -546,6 +547,11 @@ int main(int argc, char **argv)
if (a < argc) (G.scene->r.efra) = atoi(argv[a]);
}
break;
+ case 'P':
+ a++;
+ if (a < argc) BPY_run_python_script (argv[a]);
+ else printf("\nError: you must specify a Python script after '-P '.\n");
+ break;
}
}
else {