[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30041] branches/soc-2010-jwilkins/source/ creator/creator.c: more merge fixes

Jason Wilkins Jason.A.Wilkins at gmail.com
Tue Jul 6 15:37:01 CEST 2010


Revision: 30041
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30041
Author:   jwilkins
Date:     2010-07-06 15:37:00 +0200 (Tue, 06 Jul 2010)

Log Message:
-----------
more merge fixes

Modified Paths:
--------------
    branches/soc-2010-jwilkins/source/creator/creator.c

Modified: branches/soc-2010-jwilkins/source/creator/creator.c
===================================================================
--- branches/soc-2010-jwilkins/source/creator/creator.c	2010-07-06 13:20:43 UTC (rev 30040)
+++ branches/soc-2010-jwilkins/source/creator/creator.c	2010-07-06 13:37:00 UTC (rev 30041)
@@ -234,11 +234,11 @@
 	BLI_argsPrintArgDoc(ba, "--window-geometry");
 
 	printf("\n");
-	printf ("Game Engine specific options:\n");
+	printf ("Game Engine Specific Options:\n");
 	BLI_argsPrintArgDoc(ba, "-g");
 
 	printf("\n");
-	printf ("Misc options:\n");
+	printf ("Misc Options:\n");
 	BLI_argsPrintArgDoc(ba, "--debug");
 	BLI_argsPrintArgDoc(ba, "--debug-fpe");
 
@@ -273,10 +273,25 @@
 	printf ("Other Options:\n");
 	BLI_argsPrintOtherDoc(ba);
 
+	printf ("Argument Parsing:\n");
+	printf ("\targuments must be separated by white space. eg\n");
+	printf ("\t\t\"blender -ba test.blend\"\n");
+	printf ("\t...will ignore the 'a'\n");
+	printf ("\t\t\"blender -b test.blend -f8\"\n");
+	printf ("\t...will ignore 8 because there is no space between the -f and the frame value\n\n");
+
+	printf ("Argument Order:\n");
+	printf ("Arguments are executed in the order they are given. eg\n");
+	printf ("\t\t\"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
+	printf ("\t...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
+	printf ("\t\t\"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
+	printf ("\t...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
+	printf ("\t\t\"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
+
 	printf ("\nEnvironment Variables:\n");
 	printf ("  $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n");
 	printf ("  $BLENDERPATH  System directory to use for data files and scripts.\n");
-	printf ("                For this build of blender the default BLENDERPATH is...\n");
+	printf ("                For this build of blender the default $BLENDERPATH is...\n");
 	printf ("                \"%s\"\n", blender_path);
 	printf ("                setting the $BLENDERPATH will override this\n");
 #ifdef WIN32
@@ -289,19 +304,6 @@
 #endif
 	printf ("  $PYTHONHOME   Path to the python directory, eg. /usr/lib/python.\n\n");
 
-	printf ("Note: Arguments must be separated by white space. eg:\n");
-	printf ("    \"blender -ba test.blend\"\n");
-	printf ("  ...will ignore the 'a'\n");
-	printf ("    \"blender -b test.blend -f8\"\n");
-	printf ("  ...will ignore 8 because there is no space between the -f and the frame value\n\n");
-
-	printf ("Note: Arguments are executed in the order they are given. eg:\n");
-	printf ("    \"blender --background test.blend --render-frame 1 --render-output /tmp\"\n");
-	printf ("  ...will not render to /tmp because '--render-frame 1' renders before the output path is set\n");
-	printf ("    \"blender --background --render-output /tmp test.blend --render-frame 1\"\n");
-	printf ("  ...will not render to /tmp because loading the blend file overwrites the render output that was set\n");
-	printf ("    \"blender --background test.blend --render-output /tmp --render-frame 1\" works as expected.\n\n");
-
 	exit(0);
 
 	return 0;
@@ -685,10 +687,22 @@
 		Scene *scene= CTX_data_scene(C);
 
 		if (argc > 1) {
-			int frame = atoi(argv[1]);
 			Render *re = RE_NewRender(scene->id.name);
+			int frame;
 			ReportList reports;
 
+			switch(*argv[1]) {
+			case '+':
+				frame= scene->r.sfra + atoi(argv[1]+1);
+				break;
+			case '-':
+				frame= (scene->r.efra - atoi(argv[1]+1)) + 1;
+				break;
+			default:
+				frame= atoi(argv[1]);
+				break;
+			}
+
 			BKE_reports_init(&reports, RPT_PRINT);
 
 			frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame));
@@ -970,6 +984,123 @@
 
 	/* fourth pass: processing arguments */
 	BLI_argsAdd(ba, 4, "-g", NULL, game_doc, set_ge_parameters, syshandle);
+	BLI_argsAdd(ba, 4, "-f", "--render-frame", "<frame>\n\tRender frame <frame> and save it.\n\t+<frame> start frame relative, -<frame> end frame relative.", render_frame, C);
+	BLI_argsAdd(ba, 4, "-a", "--render-anim", "\n\tRender frames from start to end (inclusive)", render_animation, C);
+	BLI_argsAdd(ba, 4, "-S", "--scene", "<name>\n\tSet the active scene <name> for rendering", set_scene, C);
+	BLI_argsAdd(ba, 4, "-s", "--frame-start", "<frame>\n\tSet start to frame <frame> (use before the -a argument)", set_start_frame, C);
+	BLI_argsAdd(ba, 4, "-e", "--frame-end", "<frame>\n\tSet end to frame <frame> (use before the -a argument)", set_end_frame, C);
+	BLI_argsAdd(ba, 4, "-j", "--frame-jump", "<frames>\n\tSet number of frames to step forward after each rendered frame", set_skip_frame, C);
+	BLI_argsAdd(ba, 4, "-P", "--python", "<filename>\n\tRun the given Python script (filename or Blender Text)", run_python, C);
+	BLI_argsAdd(ba, 4, NULL, "--python-console", "\n\tRun blender with an interactive console", run_python_console, C);
+
+	BLI_argsAdd(ba, 4, "-o", "--render-output", output_doc, set_output, C);
+	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-" QUOTE(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);
+
+}
+
+int main(int argc, char **argv)
+{
+	SYS_SystemHandle syshandle;
+	bContext *C= CTX_create();
+	bArgs *ba;
+
+#ifdef WITH_BINRELOC
+	br_init( NULL );
+#endif
+
+		/* happens for the UI on file reading too (huh? (ton))*/
+	// XXX			BKE_reset_undo();
+	//				BKE_write_undo("original");	/* save current state */
+	} else {
+		/* we are not running in background mode here, but start blender in UI mode with
+		   a file - this should do everything a 'load file' does */
+		WM_read_file(C, filename, NULL);
+	}
+
+	G.file_loaded = 1;
+
+	return 0;
+}
+
+void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
+{
+	static char output_doc[] = "<path>"
+		"\n\tSet the render path and file name."
+		"\n\tUse // at the start of the path to"
+		"\n\t\trender relative to the blend file."
+		"\n\tThe # characters are replaced by the frame number, and used to define zero padding."
+		"\n\t\tani_##_test.png becomes ani_01_test.png"
+		"\n\t\ttest-######.png becomes test-000001.png"
+		"\n\t\tWhen the filename does not contain #, The suffix #### is added to the filename"
+		"\n\tThe frame number will be added at the end of the filename."
+		"\n\t\teg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a"
+		"\n\t\t//render_ becomes //render_####, writing frames as //render_0001.png//";
+
+	static char format_doc[] = "<format>"
+		"\n\tSet the render format, Valid options are..."
+		"\n\t\tTGA IRIS JPEG MOVIE IRIZ RAWTGA"
+		"\n\t\tAVIRAW AVIJPEG PNG BMP FRAMESERVER"
+		"\n\t(formats that can be compiled into blender, not available on all systems)"
+		"\n\t\tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS";
+
+	static char playback_doc[] = "<options> <file(s)>"
+		"\n\tPlayback <file(s)>, only operates this way when not running in background."
+		"\n\t\t-p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>"
+		"\n\t\t-m\t\tRead from disk (Don't buffer)"
+		"\n\t\t-f <fps> <fps-base>\t\tSpecify FPS to start with"
+		"\n\t\t-j <frame>\tSet frame step to <frame>";
+
+	static char game_doc[] = "Game Engine specific options"
+		"\n\t-g fixedtime\t\tRun on 50 hertz without dropping frames"
+		"\n\t-g vertexarrays\tUse Vertex Arrays for rendering (usually faster)"
+		"\n\t-g nomipmap\t\tNo Texture Mipmapping"
+		"\n\t-g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)";
+
+	static char debug_doc[] = "\n\tTurn debugging on\n"
+		"\n\t* Prints every operator call and their arguments"
+		"\n\t* Disables mouse grab (to interact with a debugger in some cases)"
+		"\n\t* Keeps python sys.stdin rather then setting it to None";
+
+	//BLI_argsAdd(ba, pass, short_arg, long_arg, doc, cb, C);
+
+	/* end argument processing after -- */
+	BLI_argsAdd(ba, -1, "--", NULL, "\n\tEnds option processing, following arguments passed unchanged. Access via python's sys.argv", end_arguments, NULL);
+
+	/* first pass: background mode, disable python and commands that exit after usage */
+	BLI_argsAdd(ba, 1, "-h", "--help", "\n\tPrint this help text and exit", print_help, ba);
+	/* Windows only */
+	BLI_argsAdd(ba, 1, "/?", NULL, "\n\tPrint this help text and exit (windows only)", print_help, ba);
+
+	BLI_argsAdd(ba, 1, "-v", "--version", "\n\tPrint Blender version and exit", print_version, NULL);
+
+	BLI_argsAdd(ba, 1, "-y", "--enable-autoexec", "\n\tEnable automatic python script execution (default)", enable_python, NULL);
+	BLI_argsAdd(ba, 1, "-Y", "--disable-autoexec", "\n\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)", disable_python, NULL);
+
+	BLI_argsAdd(ba, 1, "-b", "--background", "<file>\n\tLoad <file> in background (often used for UI-less rendering)", background_mode, NULL);
+
+	BLI_argsAdd(ba, 1, "-a", NULL, playback_doc, playback_mode, NULL);
+
+	BLI_argsAdd(ba, 1, "-d", "--debug", debug_doc, debug_mode, ba);
+    BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
+
+	/* second pass: custom window stuff */
+	BLI_argsAdd(ba, 2, "-p", "--window-geometry", "<sx> <sy> <w> <h>\n\tOpen with lower left corner at <sx>, <sy> and width and height as <w>, <h>", prefsize, NULL);
+	BLI_argsAdd(ba, 2, "-w", "--window-border", "\n\tForce opening with borders (default)", with_borders, NULL);
+	BLI_argsAdd(ba, 2, "-W", "--window-borderless", "\n\tForce opening with without borders", without_borders, NULL);
+	BLI_argsAdd(ba, 2, "-R", NULL, "\n\tRegister .blend extension (windows only)", register_extension, ba);
+
+	/* third pass: disabling things and forcing settings */
+	BLI_argsAddCase(ba, 3, "-nojoystick", 1, NULL, 0, "\n\tDisable joystick support", no_joystick, syshandle);
+	BLI_argsAddCase(ba, 3, "-noglsl", 1, NULL, 0, "\n\tDisable GLSL shading", no_glsl, NULL);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list