diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-08-18 00:04:28 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-08-18 00:04:28 +0400 |
commit | 9f5d25748397aad6a4347f40c7ec6c025dc93129 (patch) | |
tree | d4daf6f8a4540f0620792f822e33c0efcee2b2f4 /source | |
parent | 912c48442cf661bbc06ef37dd38f52a86eb7d036 (diff) |
New command line argument to specify render engine
-E <engine>
-E help: lists all available engine and then quits. (blender window might flash open and then disappear. io python scripts need to be read for all engine, so we have to load interface and not do that before like other help options).
When run after -b, only builtin engines are available because of the python scripts not being read correctly bug.
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/creator.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 4f7a4afb5a6..5ecd95ecc21 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -177,6 +177,8 @@ static void print_help(void) printf (" When the filename has no #, The suffix #### is added to the filename\n"); printf (" The frame number will be added at the end of the filename.\n"); printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n"); + printf (" -E <engine>\tSpecify the render engine.\n"); + printf (" use -E help to list available engines.\n"); printf ("\nFormat options:\n"); printf (" -F <format>\tSet the render format, Valid options are...\n"); printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n"); @@ -692,6 +694,47 @@ int main(int argc, char **argv) printf("\nError: you must specify a path after '-o '.\n"); } break; + case 'E': + a++; + if (a < argc) + { + if (!strcmp(argv[a],"help")) + { + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + printf("\t%s\n", type->idname); + } + exit(0); + } + else + { + if (CTX_data_scene(C)==NULL) + { + printf("\nError: no blend loaded. order the arguments so '-E ' is after the blend is loaded.\n"); + } + else + { + Scene *scene= CTX_data_scene(C); + RenderData *rd = &scene->r; + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + if (!strcmp(argv[a],type->idname)) + { + BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine)); + } + } + } + } + } + else + { + printf("\nEngine not specified.\n"); + } + break; case 'F': a++; if (a < argc){ |