[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15331] trunk/blender/source: bugfix [ #14796] -t <threads> command line switch doesn' t work unless FIXED_THREADS has previously been turned on

Campbell Barton ideasman42 at gmail.com
Mon Jun 23 18:47:22 CEST 2008


Revision: 15331
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15331
Author:   campbellbarton
Date:     2008-06-23 18:47:15 +0200 (Mon, 23 Jun 2008)

Log Message:
-----------
bugfix [#14796] -t <threads> command line switch doesn't work unless FIXED_THREADS has previously been turned on
Command line threads now override blendfile setting in background mode.
Command line Threads greater then 8 are now clamped.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/pipeline.c
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/blender/render/intern/source/pipeline.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/pipeline.c	2008-06-23 16:37:51 UTC (rev 15330)
+++ trunk/blender/source/blender/render/intern/source/pipeline.c	2008-06-23 16:47:15 UTC (rev 15331)
@@ -2675,9 +2675,9 @@
 
 void RE_init_threadcount(Render *re) 
 {
-	if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
+        if(commandline_threads >= 1) { /* only set as an arg in background mode */
+		re->r.threads= MIN2(commandline_threads, BLENDER_MAX_THREADS);
+	} else if ((re->r.mode & R_FIXED_THREADS)==0 || commandline_threads == 0) { /* Automatic threads */
 		re->r.threads = BLI_system_thread_count();
-	} else if(commandline_threads >= 1 && commandline_threads<=BLENDER_MAX_THREADS) {
-		re->r.threads= commandline_threads;
 	}
 }

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2008-06-23 16:37:51 UTC (rev 15330)
+++ trunk/blender/source/creator/creator.c	2008-06-23 16:47:15 UTC (rev 15331)
@@ -195,7 +195,7 @@
 	printf ("    (formats that can be compiled into blender, not available on all systems)\n");
 	printf ("    \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
 	printf ("    -x <bool>\tSet option to add the file extension to the end of the file.\n");
-	printf ("    -t <threads>\tUse amount of <threads> for rendering.\n");
+	printf ("    -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
 	printf ("      [1-8], 0 for systems processor count.\n");
 	printf ("\nAnimation playback options:\n");
 	printf ("  -a <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
@@ -723,6 +723,8 @@
 				a++;
 				if(G.background) {
 					RE_set_max_threads(atoi(argv[a]));
+				} else {
+					printf("Warning: threads can only be set in background mode\n");
 				}
 				break;
 			case 'x': /* extension */





More information about the Bf-blender-cvs mailing list