Revision: 46557
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46557
Author:   nazgul
Date:     2012-05-11 17:33:48 +0000 (Fri, 11 May 2012)
Log Message:
-----------
Added verbosity command line argument. Currently used for libmv only.
Usage: ./blender --verbose <level>

Also fixed some crashes when not passing number to --threads argument
or not passing file format to -F argument.

Modified Paths:
--------------
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c      2012-05-11 17:29:55 UTC (rev 
46556)
+++ trunk/blender/source/creator/creator.c      2012-05-11 17:33:48 UTC (rev 
46557)
@@ -603,7 +603,7 @@
 static int set_image_type(int argc, const char **argv, void *data)
 {
        bContext *C = data;
-       if (argc >= 1) {
+       if (argc > 1) {
                const char *imtype = argv[1];
                Scene *scene = CTX_data_scene(C);
                if (scene) {
@@ -629,7 +629,7 @@
 
 static int set_threads(int argc, const char **argv, void *UNUSED(data))
 {
-       if (argc >= 1) {
+       if (argc > 1) {
                if (G.background) {
                        RE_set_max_threads(atoi(argv[1]));
                }
@@ -644,6 +644,21 @@
        }
 }
 
+static int set_verbosity(int argc, const char **argv, void *UNUSED(data))
+{
+       if (argc > 1) {
+               int level = atoi(argv[1]);
+
+               libmv_setLoggingVerbosity(level);
+
+               return 1;
+       }
+       else {
+               printf("\nError: you must specify a verbosity level.\n");
+               return 0;
+       }
+}
+
 static int set_extension(int argc, const char **argv, void *data)
 {
        bContext *C = data;
@@ -1112,6 +1127,8 @@
        BLI_argsAdd(ba, 1, NULL, "--debug-libmv", "\n\tEnable debug messages 
from libmv library", debug_mode_libmv, NULL);
 #endif
 
+       BLI_argsAdd(ba, 1, NULL, "--verbose", "<verbose>\n\tSet logging 
verbosity level.", set_verbosity, NULL);
+
        BLI_argsAdd(ba, 1, NULL, "--factory-startup", "\n\tSkip reading the 
"STRINGIFY (BLENDER_STARTUP_FILE)" in the users home directory", 
set_factory_startup, NULL);
 
        /* TODO, add user env vars? */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to