diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-08 17:23:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-08 17:23:17 +0400 |
commit | a07dcd67ebf63fad08536b1e78bbb61e18fa51e6 (patch) | |
tree | 7c96f23349f005187e87d19d23248bb40d4d2e91 /source/creator | |
parent | 3e763d7e4dbbc4acb3deb7afb95e936ce950ebb5 (diff) |
Fix #35240: command line -t number of threads option did not work for cycles.
Now it works for blender internal, cycles and other multithreading code in
Blender in both background and UI mode.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 5c6f85c918d..418c05e22ce 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -821,11 +821,13 @@ static int set_image_type(int argc, const char **argv, void *data) static int set_threads(int argc, const char **argv, void *UNUSED(data)) { if (argc > 1) { - if (G.background) { - RE_set_max_threads(atoi(argv[1])); + int threads = atoi(argv[1]); + + if (threads >= 0 && threads <= BLENDER_MAX_THREADS) { + BLI_system_num_threads_override_set(threads); } else { - printf("Warning: threads can only be set in background mode\n"); + printf("Error, threads has to be in range 0-%d\n", BLENDER_MAX_THREADS); } return 1; } @@ -1406,7 +1408,7 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) BLI_argsAdd(ba, 4, "-E", "--engine", "<engine>\n\tSpecify the render engine\n\tuse -E help to list available engines", set_engine, C); BLI_argsAdd(ba, 4, "-F", "--render-format", format_doc, set_image_type, C); - BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering in background\n\t[1-" STRINGIFY(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL); + BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering and other operations\n\t[1-" STRINGIFY(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL); BLI_argsAdd(ba, 4, "-x", "--use-extension", "<bool>\n\tSet option to add the file extension to the end of the file", set_extension, C); } |