move debug flag into its own global var (G.debug), split up debug options.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 31 Mar 2012 00:59:17 +0000 (00:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 31 Mar 2012 00:59:17 +0000 (00:59 +0000)
  --debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.

98 files changed:
release/scripts/modules/addon_utils.py
release/scripts/modules/bpy/utils.py
release/scripts/modules/console_python.py
source/blender/blenfont/intern/blf_lang.c
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/bmfont.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/ocean.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenlib/intern/path_util.c
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/AnimationImporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/MeshImporter.cpp
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/reeb.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_buttons.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/view2d.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_relations.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_internal.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_undo.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_nla/nla_select.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/util/editmode_undo.c
source/blender/editors/util/undo.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/imbuf/intern/cineon/cineon_dpx.c
source/blender/imbuf/intern/tiff.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/intern/dna_genfile.c
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_screen.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_array.c
source/blender/render/intern/raytrace/rayobject_octree.cpp
source/blender/render/intern/raytrace/rayobject_vbvh.cpp
source/blender/render/intern/raytrace/reorganize.h
source/blender/render/intern/raytrace/svbvh.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/volume_precache.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_subwindow.c
source/blender/windowmanager/intern/wm_window.c
source/creator/creator.c
source/gameengine/GamePlayer/common/bmfont.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KX_NavMeshObject.cpp

index 2b1616a0022b41859380ef9cde0730a2a1c2e4fc..588c10eea540a99b2639e0c9ac6362eaf3f9c142 100644 (file)
@@ -65,7 +65,7 @@ def modules(module_cache):
     def fake_module(mod_name, mod_path, speedy=True, force_support=None):
         global error_encoding
 
-        if _bpy.app.debug:
+        if _bpy.app.debug_python:
             print("fake_module", mod_path, mod_name)
         import ast
         ModuleType = type(ast)
@@ -284,7 +284,7 @@ def enable(module_name, default_set=True):
 
     mod.__addon_enabled__ = True
 
-    if _bpy.app.debug:
+    if _bpy.app.debug_python:
         print("\taddon_utils.enable", mod.__name__)
 
     return mod
@@ -323,7 +323,7 @@ def disable(module_name, default_set=True):
             if addon:
                 addons.remove(addon)
 
-    if _bpy.app.debug:
+    if _bpy.app.debug_python:
         print("\taddon_utils.disable", module_name)
 
 
index 63ba213f9b1721885a178a582ba98e4673561ec2..2824d6245e5a820ebca2ae9ebdbbcee67652f902 100644 (file)
@@ -57,7 +57,7 @@ _script_module_dirs = "startup", "modules"
 
 
 def _test_import(module_name, loaded_modules):
-    use_time = _bpy.app.debug
+    use_time = _bpy.app.debug_python
 
     if module_name in loaded_modules:
         return None
@@ -126,7 +126,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
        as modules.
     :type refresh_scripts: bool
     """
-    use_time = _bpy.app.debug
+    use_time = _bpy.app.debug_python
 
     prefs = _bpy.context.user_preferences
 
@@ -426,7 +426,7 @@ def preset_find(name, preset_path, display_name=False, ext=".py"):
 def keyconfig_set(filepath):
     from os.path import basename, splitext
 
-    if _bpy.app.debug:
+    if _bpy.app.debug_python:
         print("loading preset:", filepath)
 
     keyconfigs = _bpy.context.window_manager.keyconfigs
index 6c49283b3e1a6dfba68f1103954864ba8a80b9e1..d4e45ece9fae6fc7cfe922171172c53c3d162b00 100644 (file)
@@ -246,7 +246,7 @@ def autocomplete(context):
                 line=line,
                 cursor=current_line.current_character,
                 namespace=console.locals,
-                private=bpy.app.debug)
+                private=bpy.app.debug_python)
 
         line_new = result[0]
         current_line.body, current_line.current_character, scrollback = result
index ee825b8179d9eea151df8cd683d7526eda6ad217..035aa7325370a49b25a4b6fce4a15a0f17a36e9a 100644 (file)
@@ -192,7 +192,7 @@ void BLF_lang_set(const char *str)
        locreturn = setlocale(LC_ALL, long_locale);
 
        if (locreturn == NULL) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("Could not change locale to %s\n", long_locale);
 
                ok = 0;
@@ -209,14 +209,14 @@ void BLF_lang_set(const char *str)
                        get_language_variable("LANGUAGE", default_language, sizeof(default_language));
 
                if (short_locale[0]) {
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
 
                        BLI_setenv("LANG", short_locale);
                        BLI_setenv("LANGUAGE", short_locale);
                }
                else {
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
 
                        BLI_setenv("LANG", default_lang);
@@ -238,7 +238,7 @@ void BLF_lang_set(const char *str)
 
                                get_language(long_locale, default_lang, language, sizeof(language));
 
-                               if (G.f & G_DEBUG) {
+                               if (G.debug & G_DEBUG) {
                                        if (short_locale[0])
                                                printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
                                        else
index 80c9244d232efbcc3fe8f8dd6fc1abb687dca8b9..5f230e5fad979b10b9579eb14d6fd696159b54ad 100644 (file)
@@ -69,6 +69,7 @@ typedef struct Global {
 
        short rt;
        int f;
+       int debug;
 
        /* Used for BMesh transformations */
        struct BME_Glob *editBMesh;
@@ -104,16 +105,26 @@ typedef struct Global {
 
 /* #define G_FACESELECT        (1 <<  8) use (mesh->editflag & ME_EDIT_PAINT_MASK) */
 
-#define G_DEBUG                        (1 << 12)
 #define G_SCRIPT_AUTOEXEC (1 << 13)
 #define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */
-#define G_DEBUG_FFMPEG         (1 << 15)
 
 /* #define G_NOFROZEN  (1 << 17) also removed */
 /* #define G_GREASEPENCIL      (1 << 17)   also removed */
 
 /* #define G_AUTOMATKEYS       (1 << 30)   also removed */
 
+/* G.debug */
+enum {
+       G_DEBUG =           (1 << 0), /* general debug flag, print more info in unexpected cases */
+       G_DEBUG_FFMPEG =    (1 << 1),
+       G_DEBUG_PYTHON =    (1 << 2), /* extra python info */
+       G_DEBUG_EVENTS =    (1 << 3), /* input/window/screen events */
+       G_DEBUG_WM =        (1 << 4)  /* operator, undo */
+};
+
+#define G_DEBUG_ALL  (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM)
+
+
 /* G.fileflags */
 
 #define G_AUTOPACK               (1 << 0)
index a03bcb1fde962041b2c8839d948dbd2e29d28f93..0041553ec44ece05cfba04e6d9f80ea8e3af56a5 100644 (file)
@@ -445,7 +445,7 @@ void DM_update_tessface_data(DerivedMesh *dm)
                                            numTex, numCol, hasPCol, hasOrigSpace);
        }
 
-       if (G.f & G_DEBUG)
+       if (G.debug & G_DEBUG)
                printf("Updated tessellated customdata of dm %p\n", dm);
 
        dm->dirty &= ~DM_DIRTY_TESS_CDLAYERS;
index 552c4c4e82be07b4dd7e8cba41e44d750d16a61b..fc58799eb184447af77b41fa84399e2b5450fad6 100644 (file)
@@ -399,7 +399,7 @@ void action_move_fcurves_by_basepath (bAction *srcAct, bAction *dstAct, const ch
        
        /* sanity checks */
        if (ELEM3(NULL, srcAct, dstAct, basepath)) {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("ERROR: action_partition_fcurves_by_basepath(%p, %p, %p) has insufficient info to work with\n",
                                        (void *)srcAct, (void *)dstAct, (void *)basepath);
                }
@@ -480,7 +480,7 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
        
        /* sanity checks */
        if (ELEM(NULL, srcID, dstID)) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("ERROR: no source or destination ID to separate AnimData with\n");
                return;
        }
@@ -490,7 +490,7 @@ void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepath
        dstAdt = BKE_id_add_animdata(dstID);
        
        if (ELEM(NULL, srcAdt, dstAdt)) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("ERROR: no AnimData for this pair of ID's\n");
                return;
        }
@@ -980,20 +980,20 @@ KS_Path *BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[],
        
        /* sanity checks */
        if (ELEM(NULL, ks, rna_path)) {
-               printf("ERROR: no Keying Set and/or RNA Path to add path with \n");
+               printf("ERROR: no Keying Set and/or RNA Path to add path with\n");
                return NULL;
        }
        
        /* ID is required for all types of KeyingSets */
        if (id == NULL) {
-               printf("ERROR: No ID provided for Keying Set Path\n");
+               printf("ERROR: No ID provided for Keying Set Path\n");
                return NULL;
        }
        
        /* don't add if there is already a matching KS_Path in the KeyingSet */
        if (BKE_keyingset_find_path(ks, id, group_name, rna_path, array_index, groupmode)) {
-               if (G.f & G_DEBUG)
-                       printf("ERROR: destination already exists in Keying Set \n");
+               if (G.debug & G_DEBUG)
+                       printf("ERROR: destination already exists in Keying Set\n");
                return NULL;
        }
        
@@ -1138,8 +1138,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                        int array_len= RNA_property_array_length(&new_ptr, prop);
                        
                        if (array_len && array_index >= array_len) {
-                               if (G.f & G_DEBUG) {
-                                       printf("Animato: Invalid array index. ID = '%s',  '%s[%d]', array length is %d \n",
+                               if (G.debug & G_DEBUG) {
+                                       printf("Animato: Invalid array index. ID = '%s',  '%s[%d]', array length is %d\n",
                                                (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>",
                                                path, array_index, array_len-1);
                                }
@@ -1211,8 +1211,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                /* failed to get path */
                // XXX don't tag as failed yet though, as there are some legit situations (Action Constraint) 
                // where some channels will not exist, but shouldn't lock up Action
-               if (G.f & G_DEBUG) {
-                       printf("Animato: Invalid path. ID = '%s',  '%s[%d]' \n",
+               if (G.debug & G_DEBUG) {
+                       printf("Animato: Invalid path. ID = '%s',  '%s[%d]'\n",
                                (ptr && ptr->id.data) ? (((ID *)ptr->id.data)->name+2) : "<No ID>", 
                                path, array_index);
                }
@@ -1326,7 +1326,7 @@ static void action_idcode_patch_check (ID *id, bAction *act)
        }
        else if (act->idroot != idcode) {
                /* only report this error if debug mode is enabled (to save performance everywhere else) */
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("AnimSys Safety Check Failed: Action '%s' is not meant to be used from ID-Blocks of type %d such as '%s'\n",
                                act->id.name+2, idcode, id->name);
                }
@@ -1592,12 +1592,12 @@ static NlaEvalChannel *nlaevalchan_verify (PointerRNA *ptr, ListBase *channels,
        
                /* a valid property must be available, and it must be animatable */
        if (RNA_path_resolve(ptr, path, &new_ptr, &prop) == 0) {
-               if (G.f & G_DEBUG) printf("NLA Strip Eval: Cannot resolve path \n");
+               if (G.debug & G_DEBUG) printf("NLA Strip Eval: Cannot resolve path\n");
                return NULL;
        }
                /* only ok if animatable */
        else if (RNA_property_animateable(&new_ptr, prop) == 0) {
-               if (G.f & G_DEBUG) printf("NLA Strip Eval: Property not animatable \n");
+               if (G.debug & G_DEBUG) printf("NLA Strip Eval: Property not animatable\n");
                return NULL;
        }
        
@@ -2252,8 +2252,8 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
 {
        ID *id;
 
-       if (G.f & G_DEBUG)
-               printf("Evaluate all animation - %f \n", ctime);
+       if (G.debug & G_DEBUG)
+               printf("Evaluate all animation - %f\n", ctime);
        
        /* macros for less typing 
         *      - only evaluate animation data for id if it has users (and not just fake ones)
@@ -2295,7 +2295,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
         * set correctly, so this optimization must be skipped in that case...
         */
        if ((main->action.first == NULL) && (main->curve.first == NULL)) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("\tNo Actions, so no animation needs to be evaluated...\n");
                        
                return;
index bb52af86e005823e40a037e0e42fb093c57911a0..f111640145fb8290a2116e2b9a13a46658cc3936 100644 (file)
@@ -281,7 +281,7 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath
 
        /* special cases, override loaded flags: */
        if (G.f != bfd->globalf) {
-               const int flags_keep= (G_DEBUG | G_DEBUG_FFMPEG | G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
+               const int flags_keep = (G_SWAP_EXCHANGE | G_SCRIPT_AUTOEXEC | G_SCRIPT_OVERRIDE_PREF);
                bfd->globalf= (bfd->globalf & ~flags_keep) | (G.f & flags_keep);
        }
 
@@ -606,20 +606,19 @@ void BKE_undo_step(bContext *C, int step)
                /* curundo should never be NULL, after restart or load file it should call undo_save */
                if (curundo==NULL || curundo->prev==NULL) ; // XXX error("No undo available");
                else {
-                       if (G.f & G_DEBUG) printf("undo %s\n", curundo->name);
+                       if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
                        curundo= curundo->prev;
                        read_undosave(C, curundo);
                }
        }
        else {
-               
                /* curundo has to remain current situation! */
                
                if (curundo==NULL || curundo->next==NULL) ; // XXX error("No redo available");
                else {
                        read_undosave(C, curundo->next);
                        curundo= curundo->next;
-                       if (G.f & G_DEBUG) printf("redo %s\n", curundo->name);
+                       if (G.debug & G_DEBUG) printf("redo %s\n", curundo->name);
                }
        }
 }
index 278dbe30a95ec8da11c0b572f51a360533459611..04ac6cbfb4cc41828fdb0c70abb4361702366784 100644 (file)
@@ -138,14 +138,14 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
                        bmfont->glyphs[i].sizey    = buffer[index++];
                        bmfont->glyphs[i].advance  = buffer[index++];
                        bmfont->glyphs[i].reserved = buffer[index++];
-                       if (G.f & G_DEBUG) {
+                       if (G.debug & G_DEBUG) {
                                printfGlyph(&bmfont->glyphs[i]);
                        }
                }
                
                MEM_freeN(buffer);
                
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("Oldy = %d Newy = %d\n", ibuf->y, ibuf->y - ysize);
                        printf("glyphcount = %d\n", glyphcount);
                        printf("bytes = %d\n", bytes);
@@ -286,7 +286,7 @@ void matrixGlyph(ImBuf * ibuf, unsigned short unicode,
                                *advance = 2.0f * bmfont->glyphs[index].advance / (float) bmfont->glyphs[0].advance;
 
                                // printfGlyph(&bmfont->glyphs[index]);
-                               // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f \n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
+                               // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f\n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
                        }
                }
        }
index 8177d09c7e3457ccc037b17aac566780f13fbae7..0a6e8a163cc28143656b28760fa138009dd06e21 100644 (file)
@@ -2182,8 +2182,8 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
                CLAMP(s, 0, 1);
                t = (s * (data->end-data->start)) + data->start;
                
-               if (G.f & G_DEBUG)
-                       printf("do Action Constraint %s - Ob %s Pchan %s \n", con->name, cob->ob->id.name+2, (cob->pchan)?cob->pchan->name:NULL);
+               if (G.debug & G_DEBUG)
+                       printf("do Action Constraint %s - Ob %s Pchan %s\n", con->name, cob->ob->id.name+2, (cob->pchan)?cob->pchan->name:NULL);
                
                /* Get the appropriate information from the action */
                if (cob->type == CONSTRAINT_OBTYPE_BONE) {
@@ -4300,7 +4300,7 @@ bConstraintTypeInfo *get_constraint_typeinfo (int type)
                return constraintsTypeInfo[type];
        }
        else {
-               printf("No valid constraint type-info data available. Type = %i \n", type);
+               printf("No valid constraint type-info data available. Type = %i\n", type);
        }
        
        return NULL;
index a1a2465ceac8ff3eb668101bb22e9a14809c2fd9..dd8471f0a1f480e7dcd9f330ec5f4c2d07250eb1 100644 (file)
@@ -156,7 +156,7 @@ void push_queue(DagNodeQueue *queue, DagNode *node)
        int i;
 
        if (node == NULL) {
-               fprintf(stderr,"pushing null node \n");
+               fprintf(stderr,"pushing null node\n");
                return;
        }
        /*fprintf(stderr,"BFS push : %s %d\n",((ID *) node->ob)->name, queue->count);*/
@@ -267,7 +267,7 @@ DagNode * pop_queue(DagNodeQueue *queue)
                return node;
        }
        else {
-               fprintf(stderr,"return null \n");
+               fprintf(stderr,"return null\n");
                return NULL;
        }
 }
@@ -398,7 +398,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                                                
                                                for (ct= targets.first; ct; ct= ct->next) {
                                                        if (ct->tar && ct->tar != ob) {
-                                                               // fprintf(stderr,"armature %s target :%s \n", ob->id.name, target->id.name);
+                                                               // fprintf(stderr,"armature %s target :%s\n", ob->id.name, target->id.name);
                                                                node3 = dag_get_node(dag, ct->tar);
                                                                
                                                                if (ct->subtarget[0]) {
@@ -1115,7 +1115,7 @@ void graph_bfs(void)
        DagAdjList *itA;
        int minheight;
        
-       /* fprintf(stderr,"starting BFS \n ------------\n"); */ 
+       /* fprintf(stderr,"starting BFS\n ------------\n"); */
        nqueue = queue_create(DAGQUEUEALLOC);
        for ( i=0; i<50; i++)
                pos[i] = 0;
@@ -1150,7 +1150,7 @@ void graph_bfs(void)
                                }
                                
                                else {
-                                       fprintf(stderr,"bfs not dag tree edge color :%i \n",itA->node->color);
+                                       fprintf(stderr,"bfs not dag tree edge color :%i\n",itA->node->color);
                                }
 
                                
@@ -1187,7 +1187,7 @@ int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_a
        DagNodeQueue *nqueue;
        DagAdjList *itA;
        int     retval = 0;
-       /* fprintf(stderr,"starting BFS \n ------------\n"); */ 
+       /* fprintf(stderr,"starting BFS\n ------------\n"); */
        
        /* Init
         * dagnode.first is always the root (scene)
@@ -1248,7 +1248,7 @@ DagNodeQueue * graph_dfs(void)
        int maxpos=0;
        /* int  is_cycle = 0; */ /* UNUSED */
        /*
-        *fprintf(stderr,"starting DFS \n ------------\n");
+        *fprintf(stderr,"starting DFS\n ------------\n");
         */     
        nqueue = queue_create(DAGQUEUEALLOC);
        retqueue = queue_create(MainDag->numNodes);
@@ -1302,7 +1302,7 @@ DagNodeQueue * graph_dfs(void)
                                }
                                else {
                                        if (itA->node->color == DAG_GRAY) { // back edge
-                                               fprintf(stderr,"dfs back edge :%15s %15s \n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
+                                               fprintf(stderr,"dfs back edge :%15s %15s\n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
                                                /* is_cycle = 1; */ /* UNUSED */
                                        }
                                        else if (itA->node->color == DAG_BLACK) {
@@ -1313,7 +1313,7 @@ DagNodeQueue * graph_dfs(void)
                                                /*if (node->DFS_dist >= itA->node->DFS_dist)
                                                        itA->node->DFS_dist = node->DFS_dist + 1;
 
-                                                       fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i \n",
+                                                       fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i\n",
                                                                ((ID *) node->ob)->name,
                                                                node->DFS_dvtm, 
                                                                node->DFS_fntm, 
@@ -1323,7 +1323,7 @@ DagNodeQueue * graph_dfs(void)
                                        */
                                        }
                                        else
-                                               fprintf(stderr,"dfs unknown edge \n");
+                                               fprintf(stderr,"dfs unknown edge\n");
                                }
                                itA = itA->next;
                        }                       
@@ -1354,7 +1354,7 @@ DagNodeQueue * graph_dfs(void)
        }
                node = node->next;
        } while (node);
-//     fprintf(stderr,"i size : %i \n", maxpos);
+//     fprintf(stderr,"i size : %i\n", maxpos);
 
        queue_delete(nqueue);
        return(retqueue);
@@ -1378,7 +1378,7 @@ int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_a
        int skip = 0;
        int retval = 0;
        /*
-        *fprintf(stderr,"starting DFS \n ------------\n");
+        *fprintf(stderr,"starting DFS\n ------------\n");
         */     
        nqueue = queue_create(DAGQUEUEALLOC);
        
@@ -1800,7 +1800,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
        while (base) {
                BLI_remlink(&sce->base,base);
                BLI_addhead(&tempbase,base);
-               //if(G.f & G_DEBUG) 
+               //if(G.debug & G_DEBUG)
                        printf("cyclic %s\n", base->object->id.name);
                base = sce->base.first;
        }
@@ -1811,7 +1811,7 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
        /* all groups with objects in this scene gets resorted too */
        scene_sort_groups(bmain, sce);
        
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG) {
                printf("\nordered\n");
                for (base = sce->base.first; base; base= base->next) {
                        printf(" %s\n", base->object->id.name);
index 5f1201ec378af944563ead97183032ef1e218cd8..bb8cfe37a88ba437bb33fb0b9a1e27a14d68c46e 100644 (file)
@@ -370,7 +370,7 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short
         *      - keyframe to be added would replace one of the existing ones on bounds
         */
        if ((arraylen <= 0) || (array == NULL)) {
-               printf("Warning: binarysearch_bezt_index() encountered invalid array \n");
+               printf("Warning: binarysearch_bezt_index() encountered invalid array\n");
                return 0;
        }
        else {
@@ -420,10 +420,10 @@ int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen, short
        
        /* print error if loop-limit exceeded */
        if (loopbreaker == (maxloop-1)) {
-               printf("Error: binarysearch_bezt_index() was taking too long \n");
+               printf("Error: binarysearch_bezt_index() was taking too long\n");
                
                // include debug info 
-               printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);
+               printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
        }
        
        /* not found, so return where to place it */
@@ -546,7 +546,7 @@ void calc_fcurve_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
                if (ymax) *ymax= ymaxv;
        }
        else {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("F-Curve calc bounds didn't find anything, so assuming minimum bounds of 1.0\n");
                        
                if (xmin) *xmin= 0.0f;
@@ -743,7 +743,7 @@ void fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampl
                return;
        }
        if (start >= end) {
-               printf("Error: Frame range for Sampled F-Curve creation is inappropriate \n");
+               printf("Error: Frame range for Sampled F-Curve creation is inappropriate\n");
                return;
        }
        
@@ -1009,8 +1009,8 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
        /* error check for missing pointer... */
        // TODO: tag the specific target too as having issues
        if (id == NULL) {
-               printf("Error: driver has an invalid target to use \n");
-               if (G.f & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path);
+               printf("Error: driver has an invalid target to use\n");
+               if (G.debug & G_DEBUG) printf("\tpath = %s\n", dtar->rna_path);
                driver->flag |= DRIVER_FLAG_INVALID;
                return 0.0f;
        }
@@ -1060,8 +1060,8 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
 
        }
        else {
-               if (G.f & G_DEBUG)
-                       printf("Driver Evaluation Error: cannot resolve target for %s -> %s \n", id->name, dtar->rna_path);
+               if (G.debug & G_DEBUG)
+                       printf("Driver Evaluation Error: cannot resolve target for %s -> %s\n", id->name, dtar->rna_path);
                
                driver->flag |= DRIVER_FLAG_INVALID;
                return 0.0f;
@@ -1118,11 +1118,11 @@ static float dvar_eval_rotDiff (ChannelDriver *driver, DriverVar *dvar)
                
                /* check what the error was */
                if ((pchan == NULL) && (pchan2 == NULL))
-                       printf("Driver Evaluation Error: Rotational difference failed - first 2 targets invalid \n");
+                       printf("Driver Evaluation Error: Rotational difference failed - first 2 targets invalid\n");
                else if (pchan == NULL)
-                       printf("Driver Evaluation Error: Rotational difference failed - first target not valid PoseChannel \n");
+                       printf("Driver Evaluation Error: Rotational difference failed - first target not valid PoseChannel\n");
                else if (pchan2 == NULL)
-                       printf("Driver Evaluation Error: Rotational difference failed - second target not valid PoseChannel \n");
+                       printf("Driver Evaluation Error: Rotational difference failed - second target not valid PoseChannel\n");
                        
                /* stop here... */
                return 0.0f;
index 693c036d1245fea887a17ed102697ab903ae5b0f..bbd07693cea80bf0e3809f18a411548db856461f 100644 (file)
@@ -369,7 +369,7 @@ static void fcm_fn_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, floa
                        break;
                
                default:
-                       printf("Invalid Function-Generator for F-Modifier - %d \n", data->type);
+                       printf("Invalid Function-Generator for F-Modifier - %d\n", data->type);
        }
        
        /* execute function callback to set value if appropriate */
@@ -973,7 +973,7 @@ FModifierTypeInfo *get_fmodifier_typeinfo (int type)
                return fmodifiersTypeInfo[type];
        }
        else {
-               printf("No valid F-Curve Modifier type-info data available. Type = %i \n", type);
+               printf("No valid F-Curve Modifier type-info data available. Type = %i\n", type);
        }
        
        return NULL;
@@ -1007,7 +1007,7 @@ FModifier *add_fmodifier (ListBase *modifiers, int type)
        if ((modifiers->first) && (type == FMODIFIER_TYPE_CYCLES)) {
                /* cycles modifier must be first in stack, so for now, don't add if it can't be */
                // TODO: perhaps there is some better way, but for now, 
-               printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack. \n");
+               printf("Error: Cannot add 'Cycles' modifier to F-Curve, as 'Cycles' modifier can only be first in stack.\n");
                return NULL;
        }
        
@@ -1106,7 +1106,7 @@ int remove_fmodifier (ListBase *modifiers, FModifier *fcm)
        } 
        else {
                // XXX this case can probably be removed some day, as it shouldn't happen...
-               printf("remove_fmodifier() - no modifier stack given \n");
+               printf("remove_fmodifier() - no modifier stack given\n");
                MEM_freeN(fcm);
                return 0;
        }
index adbc0f035281e77e857eda7fe4bb72e2e1805ce3..811cb881f6e9b9475b799f912b4e8a77f390563e 100644 (file)
@@ -151,7 +151,7 @@ bGPDframe *gpencil_frame_addnew (bGPDlayer *gpl, int cframe)
        /* check whether frame was added successfully */
        if (state == -1) {
                MEM_freeN(gpf);
-               printf("Error: frame (%d) existed already for this layer \n", cframe);
+               printf("Error: frame (%d) existed already for this layer\n", cframe);
        }
        else if (state == 0) {
                /* add to end then! */
@@ -428,7 +428,7 @@ bGPDframe *gpencil_layer_getframe (bGPDlayer *gpl, int cframe, short addnew)
                        gpl->actframe= gpf;
                else {
                        /* unresolved errogenous situation! */
-                       printf("Error: cannot find appropriate gp-frame \n");
+                       printf("Error: cannot find appropriate gp-frame\n");
                        /* gpl->actframe should still be NULL */
                }
        }
index c454acd7c819075ebcce9beb88423ce85db25de1..51c4caa1cf4a97ace606dacf672c1a72e36b329b 100644 (file)
@@ -97,8 +97,8 @@ void free_ipo (Ipo *ipo)
                BLI_freelinkN(&ipo->curve, icu);
        }
        
-       if (G.f & G_DEBUG)
-               printf("Freed %d (Unconverted) Ipo-Curves from IPO '%s' \n", n, ipo->id.name+2);
+       if (G.debug & G_DEBUG)
+               printf("Freed %d (Unconverted) Ipo-Curves from IPO '%s'\n", n, ipo->id.name+2);
 }
 
 /* *************************************************** */
@@ -296,7 +296,7 @@ static const char *pchan_adrcodes_to_paths (int adrcode, int *array_index)
        }
        
        /* for debugging only */
-       printf("ERROR: unmatched PoseChannel setting (code %d) \n", adrcode);
+       printf("ERROR: unmatched PoseChannel setting (code %d)\n", adrcode);
        return NULL;
 }
 
@@ -893,7 +893,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
                        
                // TODO... add other blocktypes...
                default:
-                       printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet \n", blocktype, adrcode);
+                       printf("IPO2ANIMATO WARNING: No path for blocktype %d, adrcode %d yet\n", blocktype, adrcode);
                        break;
        }
        
@@ -1199,7 +1199,7 @@ static void icu_to_fcurves (ID *id, ListBase *groups, ListBase *list, IpoCurve *
                FCurve *fcurve;
                int b;
                
-               if (G.f & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d \n", totbits);
+               if (G.debug & G_DEBUG) printf("\tconvert bitflag ipocurve, totbits = %d\n", totbits);
                
                /* add the 'only int values' flag */
                fcu->flag |= (FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES);                
@@ -1396,7 +1396,7 @@ static void ipo_to_animato (ID *id, Ipo *ipo, char actname[], char constname[],
        if (ELEM3(NULL, ipo, anim, drivers))
                return;
                
-       if (G.f & G_DEBUG) printf("ipo_to_animato \n");
+       if (G.debug & G_DEBUG) printf("ipo_to_animato\n");
                
        /* validate actname and constname 
         *      - clear actname if it was one of the generic <builtin> ones (i.e. 'Object', or 'Shapes')
@@ -1521,12 +1521,12 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
        if (ELEM(NULL, id, ipo))
                return;
        if (adt == NULL) {
-               printf("ERROR ipo_to_animdata(): adt invalid \n");
+               printf("ERROR ipo_to_animdata(): adt invalid\n");
                return;
        }
        
-       if (G.f & G_DEBUG) {
-               printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s  curves:%d \n", 
+       if (G.debug & G_DEBUG) {
+               printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s  curves:%d\n",
                       id->name+2, ipo->id.name+2, (actname)?actname:"<None>", (constname)?constname:"<None>", (seq)?(seq->name+2):"<None>",
                        BLI_countlist(&ipo->curve));
        }
@@ -1539,7 +1539,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
        
        /* deal with animation first */
        if (anim.first) {
-               if (G.f & G_DEBUG) printf("\thas anim \n");
+               if (G.debug & G_DEBUG) printf("\thas anim\n");
                /* try to get action */
                if (adt->action == NULL) {
                        char nameBuf[MAX_ID_NAME];
@@ -1547,7 +1547,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
                        BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name+2);
                        
                        adt->action= add_empty_action(nameBuf);
-                       if (G.f & G_DEBUG) printf("\t\tadded new action - '%s' \n", nameBuf);
+                       if (G.debug & G_DEBUG) printf("\t\tadded new action - '%s'\n", nameBuf);
                }
                
                /* add F-Curves to action */
@@ -1556,7 +1556,7 @@ static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[],
        
        /* deal with drivers */
        if (drivers.first) {
-               if (G.f & G_DEBUG) printf("\thas drivers \n");
+               if (G.debug & G_DEBUG) printf("\thas drivers\n");
                /* add drivers to end of driver stack */
                BLI_movelisttolist(&adt->drivers, &drivers);
        }
@@ -1576,7 +1576,7 @@ static void action_to_animdata (ID *id, bAction *act)
        /* check if we need to set this Action as the AnimData's action */
        if (adt->action == NULL) {
                /* set this Action as AnimData's Action */
-               if (G.f & G_DEBUG) printf("act_to_adt - set adt action to act \n");
+               if (G.debug & G_DEBUG) printf("act_to_adt - set adt action to act\n");
                adt->action= act;
        }
        
@@ -1685,17 +1685,17 @@ void do_versions_ipos_to_animato(Main *main)
        ID *id;
        
        if (main == NULL) {
-               printf("Argh! Main is NULL in do_versions_ipos_to_animato() \n");
+               printf("Argh! Main is NULL in do_versions_ipos_to_animato()\n");
                return;
        }
                
        /* only convert if version is right */
        if (main->versionfile >= 250) {
-               printf("WARNING: Animation data too new to convert (Version %d) \n", main->versionfile);
+               printf("WARNING: Animation data too new to convert (Version %d)\n", main->versionfile);
                return;
        }
-       else if (G.f & G_DEBUG)
-               printf("INFO: Converting to Animato... \n");
+       else if (G.debug & G_DEBUG)
+               printf("INFO: Converting to Animato...\n");
                
        /* ----------- Animation Attached to Data -------------- */
        
@@ -1706,7 +1706,7 @@ void do_versions_ipos_to_animato(Main *main)
                bConstraint *con;
                bConstraintChannel *conchan, *conchann;
                
-               if (G.f & G_DEBUG) printf("\tconverting ob %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting ob %s\n", id->name+2);
                
                /* check if object has any animation data */
                if (ob->nlastrips.first) {
@@ -1831,7 +1831,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->key.first; id; id= id->next) {
                Key *key= (Key *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting key %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting key %s\n", id->name+2);
                
                /* we're only interested in the IPO 
                 * NOTE: for later, it might be good to port these over to Object instead, as many of these
@@ -1856,7 +1856,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->mat.first; id; id= id->next) {
                Material *ma= (Material *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting material %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting material %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (ma->ipo) {
@@ -1878,7 +1878,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->world.first; id; id= id->next) {
                World *wo= (World *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting world %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting world %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (wo->ipo) {
@@ -1909,8 +1909,8 @@ void do_versions_ipos_to_animato(Main *main)
                                IpoCurve *icu = (seq->ipo) ? seq->ipo->curve.first : NULL;
                                short adrcode = SEQ_FAC1;
                                
-                               if (G.f & G_DEBUG) 
-                                       printf("\tconverting sequence strip %s \n", seq->name+2);
+                               if (G.debug & G_DEBUG)
+                                       printf("\tconverting sequence strip %s\n", seq->name+2);
                                
                                if (ELEM(NULL, seq->ipo, icu)) {
                                        seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
@@ -1953,7 +1953,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->tex.first; id; id= id->next) {
                Tex *te= (Tex *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting texture %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting texture %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (te->ipo) {
@@ -1975,7 +1975,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->camera.first; id; id= id->next) {
                Camera *ca= (Camera *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting camera %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting camera %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (ca->ipo) {
@@ -1997,7 +1997,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->lamp.first; id; id= id->next) {
                Lamp *la= (Lamp *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting lamp %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting lamp %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (la->ipo) {
@@ -2019,7 +2019,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->curve.first; id; id= id->next) {
                Curve *cu= (Curve *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting curve %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting curve %s\n", id->name+2);
                
                /* we're only interested in the IPO */
                if (cu->ipo) {
@@ -2052,7 +2052,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->action.first; id; id= id->next) {
                bAction *act= (bAction *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting action %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting action %s\n", id->name+2);
                
                /* if old action, it will be object-only... */
                if (act->chanbase.first)
@@ -2066,7 +2066,7 @@ void do_versions_ipos_to_animato(Main *main)
        for (id= main->ipo.first; id; id= id->next) {
                Ipo *ipo= (Ipo *)id;
                
-               if (G.f & G_DEBUG) printf("\tconverting ipo %s \n", id->name+2);
+               if (G.debug & G_DEBUG) printf("\tconverting ipo %s\n", id->name+2);
                
                /* most likely this IPO has already been processed, so check if any curves left to convert */
                if (ipo->curve.first) {
@@ -2086,7 +2086,7 @@ void do_versions_ipos_to_animato(Main *main)
        /* free unused drivers from actions + ipos */
        free_fcurves(&drivers);
        
-       if (G.f & G_DEBUG)
-               printf("INFO: Animato convert done \n");
+       if (G.debug & G_DEBUG)
+               printf("INFO: Animato convert done\n");
 }
 
index 2dcfb744cd21eaf1c13417fc30a5e7f4b7d8e1bd..3c6c3f8c2325b8d30b6f865885f7c22f636096ba 100644 (file)
@@ -165,12 +165,15 @@ void id_us_plus(ID *id)
 void id_us_min(ID *id)
 {
        if (id) {
-               if (id->us<2 && (id->flag & LIB_FAKEUSER))
-                  id->us= 1;
-               else if (id->us<=0)
-                       printf("ID user decrement error: %s \n", id->name);
-               else
+               if (id->us < 2 && (id->flag & LIB_FAKEUSER)) {
+                       id->us= 1;
+               }
+               else if (id->us <= 0) {
+                       printf("ID user decrement error: %s\n", id->name);
+               }
+               else {
                        id->us--;
+               }
        }
 }
 
index 9c8bda974352d2c6f55dc7eae520c16653592029..56fec119cce40f884ccbebf5f87d8f006f7ccaac 100644 (file)
@@ -1484,7 +1484,7 @@ void BKE_nla_action_pushdown (AnimData *adt)
         */
        // TODO: what about modifiers?
        if (action_has_motion(adt->action) == 0) {
-               printf("BKE_nla_action_pushdown(): action has no data \n");
+               printf("BKE_nla_action_pushdown(): action has no data\n");
                return;
        }
        
@@ -1576,9 +1576,9 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
        }
        
        if (ELEM3(NULL, activeTrack, activeStrip, activeStrip->act)) {
-               if (G.f & G_DEBUG) {
-                       printf("NLA tweakmode enter - neither active requirement found \n");
-                       printf("\tactiveTrack = %p, activeStrip = %p \n", (void *)activeTrack, (void *)activeStrip);
+               if (G.debug & G_DEBUG) {
+                       printf("NLA tweakmode enter - neither active requirement found\n");
+                       printf("\tactiveTrack = %p, activeStrip = %p\n", (void *)activeTrack, (void *)activeStrip);
                }
                return 0;
        }
index cc5e59a6e926a43444b9ca8be43717a7eb5c8033..c62653b29e77c5ba82153f75aff4399cd8fcb8d0 100644 (file)
@@ -2530,7 +2530,7 @@ void object_handle_update(Scene *scene, Object *ob)
                // XXX: should this case be OB_RECALC_OB instead?
                if (ob->recalc & OB_RECALC_ALL) {
                        
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("recalcob %s\n", ob->id.name+2);
                        
                        /* handle proxy copy for target */
@@ -2558,7 +2558,7 @@ void object_handle_update(Scene *scene, Object *ob)
                        ListBase pidlist;
                        PTCacheID *pid;
                        
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("recalcdata %s\n", ob->id.name+2);
 
                        if (adt) {
index ae13613fc14b94fc4f243538c6c955aedf02be67..907de7888cb0c6f88cd18388ef4261821ba5cdae 100644 (file)
@@ -1173,18 +1173,18 @@ void BKE_simulate_ocean_cache(struct OceanCache *och, int frame)
 
        cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_DISPLACE);
        och->ibufs_disp[f] = IMB_loadiffname(string, 0);
-       //if (och->ibufs_disp[f] == NULL) printf("error loading %s \n", string);
-       //else printf("loaded cache %s \n", string);
+       //if (och->ibufs_disp[f] == NULL) printf("error loading %s\n", string);
+       //else printf("loaded cache %s\n", string);
 
        cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_FOAM);
        och->ibufs_foam[f] = IMB_loadiffname(string, 0);
-       //if (och->ibufs_foam[f] == NULL) printf("error loading %s \n", string);
-       //else printf("loaded cache %s \n", string);
+       //if (och->ibufs_foam[f] == NULL) printf("error loading %s\n", string);
+       //else printf("loaded cache %s\n", string);
 
        cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_NORMAL);
        och->ibufs_norm[f] = IMB_loadiffname(string, 0);
-       //if (och->ibufs_norm[f] == NULL) printf("error loading %s \n", string);
-       //else printf("loaded cache %s \n", string);
+       //if (och->ibufs_norm[f] == NULL) printf("error loading %s\n", string);
+       //else printf("loaded cache %s\n", string);
 }
 
 
index 445e34e43c76731bc47a342a9696530416997982..aadd9d675b0478607a23b6a9045fb56e2aebef03 100644 (file)
@@ -1131,7 +1131,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
        if (totelem == 0) {
                distribute_invalid(scene, psys, children ? PART_FROM_CHILD : 0);
 
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        fprintf(stderr,"Particle distribution error: Nothing to emit from!\n");
 
                if (dm != finaldm) dm->release(dm);
@@ -4076,7 +4076,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
 
                        gzf = BLI_gzopen(filename, "rb");
                        if (!gzf) {
-                               BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s' \n", filename); 
+                               BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s'\n", filename);
                                // XXX bad level call elbeemDebugOut(debugStrBuffer);
                                return;
                        }
@@ -4125,7 +4125,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
                                        pa->dietime = sim->scene->r.efra + 1;
                                        pa->lifetime = sim->scene->r.efra;
                                        pa->alive = PARS_ALIVE;
-                                       //if(a<25) fprintf(stderr,"FSPARTICLE debug set %s , a%d = %f,%f,%f , life=%f \n", filename, a, pa->co[0],pa->co[1],pa->co[2], pa->lifetime );
+                                       //if(a<25) fprintf(stderr,"FSPARTICLE debug set %s , a%d = %f,%f,%f , life=%f\n", filename, a, pa->co[0],pa->co[1],pa->co[2], pa->lifetime );
                                }
                                else {
                                        // skip...
@@ -4138,7 +4138,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
                        gzclose(gzf);
        
                        totpart = psys->totpart = activeParts;
-                       BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d  \n", psys->totpart,activeParts,fileParts,readMask);
+                       BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d\n", psys->totpart,activeParts,fileParts,readMask);
                        // bad level call
                        // XXX elbeemDebugOut(debugStrBuffer);
                        
index 76195c29fb3a172f900ffade3b861345c1263109..a383fac07c99a36c6b582a071413cea230c5fb69 100644 (file)
@@ -1623,7 +1623,7 @@ static PTCacheMem *ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
 
        ptcache_file_close(pf);
 
-       if (error && G.f & G_DEBUG) 
+       if (error && G.debug & G_DEBUG)
                printf("Error reading from disk cache\n");
        
        return pm;
@@ -1638,7 +1638,7 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
        pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame);
 
        if (pf==NULL) {
-               if (G.f & G_DEBUG) 
+               if (G.debug & G_DEBUG)
                        printf("Error opening disk cache file for writing\n");
                return 0;
        }
@@ -1707,7 +1707,7 @@ static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
 
        ptcache_file_close(pf);
        
-       if (error && G.f & G_DEBUG) 
+       if (error && G.debug & G_DEBUG)
                printf("Error writing to disk cache\n");
 
        return error==0;
@@ -1722,7 +1722,7 @@ static int ptcache_read_stream(PTCacheID *pid, int cfra)
                return 0;
 
        if (pf == NULL) {
-               if (G.f & G_DEBUG) 
+               if (G.debug & G_DEBUG)
                        printf("Error opening disk cache file for reading\n");
                return 0;
        }
@@ -1933,7 +1933,7 @@ static int ptcache_write_stream(PTCacheID *pid, int cfra, int totpoint)
        pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, cfra);
 
        if (pf==NULL) {
-               if (G.f & G_DEBUG) 
+               if (G.debug & G_DEBUG)
                        printf("Error opening disk cache file for writing\n");
                return 0;
        }
@@ -1951,7 +1951,7 @@ static int ptcache_write_stream(PTCacheID *pid, int cfra, int totpoint)
 
        ptcache_file_close(pf);
 
-       if (error && G.f & G_DEBUG) 
+       if (error && G.debug & G_DEBUG)
                printf("Error writing to disk cache\n");
 
        return error == 0;
@@ -2750,7 +2750,7 @@ static void *ptcache_bake_thread(void *ptr)
                                ptcache_dt_to_str(run, ctime-stime);
                                ptcache_dt_to_str(etd, fetd);
 
-                               printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s          \r", run, *data->cfra_ptr-sfra+1, efra-sfra+1, ctime-ptime, etd);
+                               printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s\r", run, *data->cfra_ptr-sfra+1, efra-sfra+1, ctime-ptime, etd);
                        }
                        ptime = ctime;
                }
@@ -2758,7 +2758,7 @@ static void *ptcache_bake_thread(void *ptr)
 
        if (usetimer) {
                ptcache_dt_to_str(run, PIL_check_seconds_timer()-stime);
-               printf("Bake %s %s (%i frames simulated).                       \n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
+               printf("Bake %s %s (%i frames simulated).\n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
        }
 
        data->thread_ended = TRUE;
@@ -3034,7 +3034,7 @@ void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
 
        if (!G.relbase_valid) {
                cache->flag &= ~PTCACHE_DISK_CACHE;
-               if (G.f & G_DEBUG) 
+               if (G.debug & G_DEBUG)
                        printf("File must be saved before using disk cache!\n");
                return;
        }
index 4206c9921dfff6d053be37c895e0de525e69f1f7..dc7a211a3c1836c8bddbcdb666d570ff4179e133 100644 (file)
@@ -236,7 +236,7 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */
                        return (f);
                }
        }
-       printf("_final_goal failed! sb or bp ==NULL \n" );
+       printf("_final_goal failed! sb or bp ==NULL\n" );
        return f; /*using crude but spot able values some times helps debuggin */
 }
 
@@ -248,7 +248,7 @@ static float _final_mass(Object *ob,BodyPoint *bp)
                        return(bp->mass*sb->nodemass);
                }
        }
-       printf("_final_mass failed! sb or bp ==NULL \n" );
+       printf("_final_mass failed! sb or bp ==NULL\n" );
        return 1.0f;
 }
 /* helper functions for everything is animateble jow_go_for2_5 ------*/
@@ -1067,7 +1067,7 @@ static int sb_detect_aabb_collisionCached(        float UNUSED(force[3]), unsigned int
                                }
                                else {
                                        /*aye that should be cached*/
-                                       printf("missing cache error \n");
+                                       printf("missing cache error\n");
                                        BLI_ghashIterator_step(ihash);
                                        continue;
                                }
@@ -1134,7 +1134,7 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
                                }
                                else {
                                        /*aye that should be cached*/
-                                       printf("missing cache error \n");
+                                       printf("missing cache error\n");
                                        BLI_ghashIterator_step(ihash);
                                        continue;
                                }
@@ -1229,7 +1229,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
                                }
                                else {
                                        /*aye that should be cached*/
-                                       printf("missing cache error \n");
+                                       printf("missing cache error\n");
                                        BLI_ghashIterator_step(ihash);
                                        continue;
                                }
@@ -1457,7 +1457,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
                                }
                                else {
                                        /*aye that should be cached*/
-                                       printf("missing cache error \n");
+                                       printf("missing cache error\n");
                                        BLI_ghashIterator_step(ihash);
                                        continue;
                                }
@@ -1794,7 +1794,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                }
                                else {
                                        /*aye that should be cached*/
-                                       printf("missing cache error \n");
+                                       printf("missing cache error\n");
                                                BLI_ghashIterator_step(ihash);
                                        continue;
                                }
@@ -2185,7 +2185,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
        /* --- could be done on object level to squeeze out the last bits of it */
        }
        else {
-               printf("Error expected a SB here \n");
+               printf("Error expected a SB here\n");
                return (999);
        }
 
@@ -2395,7 +2395,7 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
                totthread--;
        }
 
-       /* printf("sb_cf_threads_run spawning %d threads \n",totthread); */
+       /* printf("sb_cf_threads_run spawning %d threads\n",totthread); */
 
        sb_threads= MEM_callocN(sizeof(SB_thread_context)*totthread, "SBThread");
        memset(sb_threads, 0, sizeof(SB_thread_context)*totthread);
@@ -2874,7 +2874,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                                        */
                        }
                        else {
-                               printf("Matrix inversion failed \n");
+                               printf("Matrix inversion failed\n");
                                for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
                                        copy_v3_v3(bp->impdv,bp->force);
                                }
@@ -3017,7 +3017,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
                *err = MAX2(maxerrpos,maxerrvel);
                else
                *err = maxerrpos;
-               //printf("EP %f EV %f \n",maxerrpos,maxerrvel);
+               //printf("EP %f EV %f\n",maxerrpos,maxerrvel);
                if (fuzzy) {
                        *err /= sb->fuzzyness;
                }
@@ -3308,11 +3308,11 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
                if (sb->namedVG_Mass[0])
                {
                        int grp= defgroup_name_index (ob,sb->namedVG_Mass);
-                       /* printf("VGN  %s %d \n",sb->namedVG_Mass,grp); */
+                       /* printf("VGN  %s %d\n",sb->namedVG_Mass,grp); */
                        if (grp > -1) {
                                get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->mass);
                                /* 2.5  bp->mass = bp->mass * sb->nodemass; */
-                               /* printf("bp->mass  %f \n",bp->mass); */
+                               /* printf("bp->mass  %f\n",bp->mass); */
 
                        }
                }
@@ -3322,10 +3322,10 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
                if (sb->namedVG_Spring_K[0])
                {
                        int grp= defgroup_name_index (ob,sb->namedVG_Spring_K);
-                       //printf("VGN  %s %d \n",sb->namedVG_Spring_K,grp);
+                       //printf("VGN  %s %d\n",sb->namedVG_Spring_K,grp);
                        if (grp > -1) {
                                get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight);
-                               //printf("bp->springweight  %f \n",bp->springweight);
+                               //printf("bp->springweight  %f\n",bp->springweight);
 
                        }
                }
@@ -3405,7 +3405,7 @@ static void reference_to_scratch(Object *ob)
        }
        mul_v3_fl(accu_pos,1.0f/accu_mass);
        copy_v3_v3(sb->scratch->Ref.com,accu_pos);
-       /* printf("reference_to_scratch \n"); */
+       /* printf("reference_to_scratch\n"); */
 }
 
 /*
@@ -4012,7 +4012,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
                interpolate_exciter(ob, 2, 2);
                softbody_apply_goalsnap(ob);
 
-               //                              if (G.f & G_DEBUG) {
+               //                              if (G.debug & G_DEBUG) {
                if (sb->solverflags & SBSO_MONITOR ) {
                        if (loops > HEUNWARNLIMIT) /* monitor high loop counts */
                                printf("\r needed %d steps/frame",loops);
@@ -4039,7 +4039,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
 
        if (sb->solverflags & SBSO_MONITOR ) {
                sct=PIL_check_seconds_timer();
-               if ((sct-sst > 0.5f) || (G.f & G_DEBUG)) printf(" solver time %f sec %s \n",sct-sst,ob->id.name);
+               if ((sct-sst > 0.5f) || (G.debug & G_DEBUG)) printf(" solver time %f sec %s\n",sct-sst,ob->id.name);
        }
 }
 
index 2bbc4517da1bb788fff5b3c82243b949c7a41a39..df711150b97cfc083689ed5a47e67df4edabc81a 100644 (file)
@@ -1657,7 +1657,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const
 
        /* return 2 if src=dest */
        if (BLI_path_cmp(path, dest_path) == 0) {
-               // if (G.f & G_DEBUG) printf("%s and %s are the same file\n", path, dest_path);
+               // if (G.debug & G_DEBUG) printf("%s and %s are the same file\n", path, dest_path);
                return 2;
        }
 
index 6f138d5df232d3a70574dbaa7ab4cff1c5c38d52..ccf0c2265703fd28f73971333ef7fa5effbc8d9d 100644 (file)
@@ -115,7 +115,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
                        buf[2]= buf[2]?buf[2]:' ';
                        buf[3]= buf[3]?buf[3]:' ';
                        
-                       fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
+                       fprintf(fp, "['%.4s', '%s', %d, %ld ],\n", buf, name, bhead->nr, (long int)(bhead->len+sizeof(BHead)));
                }
        }
        fprintf(fp, "]\n");
index d8a874872b4462f4f0b2ba9d283fbef743918d1a..0780a7b62923fcb293d8f1ef0f6543067e51dfbe 100644 (file)
@@ -544,7 +544,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
                char *libname= (m->curlib)?m->curlib->filepath:m->name;
                
                if (BLI_path_cmp(name1, libname) == 0) {
-                       if (G.f & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
+                       if (G.debug & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
                        return m;
                }
        }
@@ -560,7 +560,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
        
        read_file_version(fd, m);
        
-       if (G.f & G_DEBUG) printf("blo_find_main: added new lib %s\n", filepath);
+       if (G.debug & G_DEBUG) printf("blo_find_main: added new lib %s\n", filepath);
        return m;
 }
 
@@ -7253,7 +7253,7 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name)
        new_id(lb, id, name);
        /* alphabetic insterion: is in new_id */
        
-       if (G.f & G_DEBUG)
+       if (G.debug & G_DEBUG)
                printf("Converted GPencil to ID: %s\n", id->name+2);
 }
 
@@ -7810,7 +7810,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 {
        /* WATCH IT!!!: pointers from libdata have not been converted */
 
-       if (G.f & G_DEBUG)
+       if (G.debug & G_DEBUG)
                printf("read file %s\n  Version %d sub %d svn r%d\n", fd->relabase, main->versionfile, main->subversionfile, main->revision);
        
        if (main->versionfile == 100) {
@@ -13671,7 +13671,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                if (id==NULL) {
                                        read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL);
                                        // commented because this can print way too much
-                                       // if (G.f & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
+                                       // if (G.debug & G_DEBUG) printf("expand_doit: other lib %s\n", lib->name);
                                        
                                        /* for outliner dependency only */
                                        ptr->curlib->parent= mainvar->curlib;
@@ -13691,7 +13691,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                        
                                        change_idid_adr_fd(fd, bhead->old, id);
                                        // commented because this can print way too much
-                                       // if (G.f & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
+                                       // if (G.debug & G_DEBUG) printf("expand_doit: already linked: %s lib: %s\n", id->name, lib->name);
                                }
                                
                                MEM_freeN(lib);
@@ -13707,7 +13707,7 @@ static void expand_doit(FileData *fd, Main *mainvar, void *old)
                                   happens which invokes same ID... in that case the lookup table needs this entry */
                                oldnewmap_insert(fd->libmap, bhead->old, id, 1);
                                // commented because this can print way too much
-                               // if (G.f & G_DEBUG) printf("expand: already read %s\n", id->name);
+                               // if (G.debug & G_DEBUG) printf("expand: already read %s\n", id->name);
                        }
                }
        }
index 3f132eb421281f92c952dfb476674ab6b0ddf88e..e0079fbb8a013e3ea7a90dd11d8064722af4c1e4 100644 (file)
@@ -261,7 +261,7 @@ bool AnimationImporter::write_animation(const COLLADAFW::Animation* anim)
                // XXX Don't know if it's necessary
                // Should we check outPhysicalDimension?
                if (curve->getInPhysicalDimension() != COLLADAFW::PHYSICAL_DIMENSION_TIME) {
-                       fprintf(stderr, "Inputs physical dimension is not time. \n");
+                       fprintf(stderr, "Inputs physical dimension is not time.\n");
                        return true;
                }
 
index 18e421779cccb62def0f32285fcda706348f300b..bc0606107abe44950fdf5dafe13da70bc7ebf472 100644 (file)
@@ -312,7 +312,7 @@ Object* DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
 {
        const COLLADAFW::UniqueId& lamp_uid = lamp->getInstanciatedObjectId();
        if (uid_lamp_map.find(lamp_uid) == uid_lamp_map.end()) {        
-               fprintf(stderr, "Couldn't find lamp by UID. \n");
+               fprintf(stderr, "Couldn't find lamp by UID.\n");
                return NULL;
        }
        Object *ob = add_object(sce, OB_LAMP);
@@ -782,7 +782,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
        else cam = (Camera*)add_camera((char*)cam_id.c_str());
        
        if (!cam) {
-               fprintf(stderr, "Cannot create camera. \n");
+               fprintf(stderr, "Cannot create camera.\n");
                return true;
        }
        cam->clipsta = camera->getNearClippingPlane().getValue();
@@ -802,7 +802,7 @@ bool DocumentImporter::writeCamera( const COLLADAFW::Camera* camera )
                break;
        case COLLADAFW::Camera::UNDEFINED_CAMERATYPE:
                {
-                       fprintf(stderr, "Current camera type is not supported. \n");
+                       fprintf(stderr, "Current camera type is not supported.\n");
                        cam->type = CAM_PERSP;
                }
                break;
@@ -899,7 +899,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
        BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
        Image *ima = BKE_add_image_file(full_path);
        if (!ima) {
-               fprintf(stderr, "Cannot create image. \n");
+               fprintf(stderr, "Cannot create image.\n");
                return true;
        }
        this->uid_image_map[image->getUniqueId()] = ima;
@@ -929,7 +929,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
        else lamp = (Lamp*)add_lamp((char*)la_id.c_str());
 
        if (!lamp) {
-               fprintf(stderr, "Cannot create lamp. \n");
+               fprintf(stderr, "Cannot create lamp.\n");
                return true;
        }
 
@@ -1069,7 +1069,7 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light )
                                break;
                        case COLLADAFW::Light::UNDEFINED:
                                {
-                                       fprintf(stderr, "Current lamp type is not supported. \n");
+                                       fprintf(stderr, "Current lamp type is not supported.\n");
                                        lamp->type = LA_LOCAL;
                                }
                                break;
index 3775a63c71d8ab30f1e3328bf809c497bbe221d1..946effda8325a71875a186b4bd3ddff08dfd19d3 100644 (file)
@@ -109,7 +109,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob)
                                BLI_make_existing_file(abs);
                        
                                if (BLI_copy(src, abs) != 0) {
-                                       fprintf(stderr, "Cannot copy image to file's directory. \n");
+                                       fprintf(stderr, "Cannot copy image to file's directory.\n");
                                }
                        } 
                        
index 1c83f0c40810fefae4554ea2b272e91139811bcc..5c01c31bd0d7aaea4ff56c8edf11e4fb2cc7a0f0 100644 (file)
@@ -180,7 +180,7 @@ void MeshImporter::set_face_indices(MFace *mface, unsigned int *indices, bool qu
        if (quad) mface->v4 = indices[3];
        else mface->v4 = 0;
 #ifdef COLLADA_DEBUG
-       // fprintf(stderr, "%u, %u, %u \n", indices[0], indices[1], indices[2]);
+       // fprintf(stderr, "%u, %u, %u\n", indices[0], indices[1], indices[2]);
 #endif
 }
 
index aa15d53abe677ed60d61fdca92b8bda37ee351df..fb6a65a585f79fc6c5a0b1029c9351f9c1532399 100644 (file)
@@ -394,14 +394,14 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
                }
        }
        if (match == NULL) {
-               printf("ERROR: no channel matching the one changed was found \n");
+               printf("ERROR: no channel matching the one changed was found\n");
                return;
        }
        else {
                bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale_setting);
                
                if (acf == NULL) {
-                       printf("ERROR: no channel info for the changed channel \n");
+                       printf("ERROR: no channel info for the changed channel\n");
                        return;
                }
                
@@ -1085,7 +1085,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
                                default: /* some collection of actions */
                                        if (adt->action)
                                                rearrange_action_channels(&ac, adt->action, mode);
-                                       else if (G.f & G_DEBUG)
+                                       else if (G.debug & G_DEBUG)
                                                printf("Animdata has no action\n");
                                        break;
                        }
@@ -1967,8 +1967,8 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
        ale= BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
-               if (G.f & G_DEBUG)
-                       printf("Error: animation channel (index = %d) not found in rename_anim_channels() \n", channel_index);
+               if (G.debug & G_DEBUG)
+                       printf("Error: animation channel (index = %d) not found in rename_anim_channels()\n", channel_index);
                
                BLI_freelistN(&anim_data);
                return;
@@ -2068,8 +2068,8 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
        ale= BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
-               if (G.f & G_DEBUG)
-                       printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index);
+               if (G.debug & G_DEBUG)
+                       printf("Error: animation channel (index = %d) not found in mouse_anim_channels()\n", channel_index);
                
                BLI_freelistN(&anim_data);
                return 0;
@@ -2288,8 +2288,8 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                }
                        break;
                default:
-                       if (G.f & G_DEBUG)
-                               printf("Error: Invalid channel type in mouse_anim_channels() \n");
+                       if (G.debug & G_DEBUG)
+                               printf("Error: Invalid channel type in mouse_anim_channels()\n");
        }
        
        /* free channels */
index a17d15d144f8130e76edabd3bed42d8ef8c613b1..5729ee79cef9238d3a71120d17ff28fc79b514f2 100644 (file)
@@ -1396,8 +1396,8 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
                default: 
                {
                        /* invalid/unsupported option */
-                       if (G.f & G_DEBUG)
-                               printf("ERROR: unsupported owner_id (i.e. texture stack) for filter textures - %s \n", owner_id->name);
+                       if (G.debug & G_DEBUG)
+                               printf("ERROR: unsupported owner_id (i.e. texture stack) for filter textures - %s\n", owner_id->name);
                        return 0;
                }
        }
@@ -1994,8 +1994,8 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
        /* check that we do indeed have a scene */
        if ((ads->source == NULL) || (GS(ads->source->name)!=ID_SCE)) {
                printf("DopeSheet Error: Not scene!\n");
-               if (G.f & G_DEBUG)
-                       printf("\tPointer = %p, Name = '%s' \n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
+               if (G.debug & G_DEBUG)
+                       printf("\tPointer = %p, Name = '%s'\n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
                return 0;
        }
        
index 86e3c8050c24c65c7a06675fd0266b1eb3de3033..73dba91207ffe33a93d2e1e29da0f7865331335d 100644 (file)
@@ -201,7 +201,7 @@ void ED_markers_get_minmax (ListBase *markers, short sel, float *first, float *l
        int selcount = 0;
        
        /* sanity check */
-       //printf("markers = %p -  %p, %p \n", markers, markers->first, markers->last);
+       //printf("markers = %p -  %p, %p\n", markers, markers->first, markers->last);
        if (markers == NULL) {
                *first = 0.0f;
                *last = 0.0f;
index d19a137a6a847529ec4ed4194db5152aa4354f8a..d5ec98da5888ef216bbe894f1cbe1de7fd8d3a5f 100644 (file)
@@ -341,7 +341,7 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float
         *      - keyframe to be added would replace one of the existing ones on bounds
         */
        if ((arraylen <= 0) || (array == NULL)) {
-               printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array \n");
+               printf("Warning: binarysearch_fcm_envelopedata_index() encountered invalid array\n");
                return 0;
        }
        else {
@@ -391,10 +391,10 @@ static int binarysearch_fcm_envelopedata_index (FCM_EnvelopeData array[], float
        
        /* print error if loop-limit exceeded */
        if (loopbreaker == (maxloop-1)) {
-               printf("Error: binarysearch_fcm_envelopedata_index() was taking too long \n");
+               printf("Error: binarysearch_fcm_envelopedata_index() was taking too long\n");
                
                // include debug info 
-               printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);
+               printf("\tround = %d: start = %d, end = %d, arraylen = %d\n", loopbreaker, start, end, arraylen);
        }
        
        /* not found, so return where to place it */
index 146aea401ecec9b7037c50746f9c389f6e126141..0e0ff0defbb816a3a2a68a1a7b75387563cb9736 100644 (file)
@@ -269,8 +269,8 @@ static void nupdate_abk_bezt (void *node, void *data)
        if (abk->numBezts >= MAX_ABK_BUFSIZE) {
                // TODO: need to allocate new array to cater...
                //bezts_extra= MEM_callocN(...);
-               if (G.f & G_DEBUG)
-                       printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples \n");
+               if (G.debug & G_DEBUG)
+                       printf("FIXME: nupdate_abk_bezt() missing case for too many overlapping BezTriples\n");
        }
        else {
                /* just store an extra one */
index ba413fda00c5c4a27ec39de517e0ce0ed905af74..47972ca2c6fd4e1701a9bee03f3b7266f004fffd 100644 (file)
@@ -131,7 +131,7 @@ bAction *verify_adt_action (ID *id, short add)
                adt= BKE_id_add_animdata(id);
        if (adt == NULL) { 
                /* if still none (as not allowed to add, or ID doesn't have animdata for some reason) */
-               printf("ERROR: Couldn't add AnimData (ID = %s) \n", (id) ? (id->name) : "<None>");
+               printf("ERROR: Couldn't add AnimData (ID = %s)\n", (id) ? (id->name) : "<None>");
                return NULL;
        }
                
@@ -584,7 +584,7 @@ static short visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
                searchtype= VISUALKEY_ROT;
        }
        else {
-               printf("%s failed: identifier - '%s' \n", __func__, identifier);
+               printf("%s failed: identifier - '%s'\n", __func__, identifier);
                return 0;
        }
        
@@ -1007,7 +1007,7 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
                        cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); 
                }
                else {
-                       BKE_reportf(reports, RPT_ERROR, "No Action to delete keyframes from for ID = %s \n", id->name);
+                       BKE_reportf(reports, RPT_ERROR, "No Action to delete keyframes from for ID = %s\n", id->name);
                        return 0;
                }
        }
@@ -1036,8 +1036,8 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
                        continue;
                        
                if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) {
-                       if (G.f & G_DEBUG)
-                               printf("WARNING: not deleting keyframe for locked F-Curve \n");
+                       if (G.debug & G_DEBUG)
+                               printf("WARNING: not deleting keyframe for locked F-Curve\n");
                        continue;
                }
                
@@ -1128,8 +1128,8 @@ static int insert_key_exec (bContext *C, wmOperator *op)
        
        /* try to insert keyframes for the channels specified by KeyingSet */
        success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, cfra);
-       if (G.f & G_DEBUG)
-               BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success);
+       if (G.debug & G_DEBUG)
+               BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes\n", ks->name, success);
        
        /* report failure or do updates? */
        if (success == MODIFYKEY_INVALID_CONTEXT) {
@@ -1284,8 +1284,8 @@ static int delete_key_exec (bContext *C, wmOperator *op)
        
        /* try to delete keyframes for the channels specified by KeyingSet */
        success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_DELETE, cfra);
-       if (G.f & G_DEBUG)
-               printf("KeyingSet '%s' - Successfully removed %d Keyframes \n", ks->name, success);
+       if (G.debug & G_DEBUG)
+               printf("KeyingSet '%s' - Successfully removed %d Keyframes\n", ks->name, success);
        
        /* report failure or do updates? */
        if (success == MODIFYKEY_INVALID_CONTEXT) {
@@ -1448,17 +1448,17 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
                        success+= insert_keyframe_direct(op->reports, ptr, prop, fcu, cfra, 0);
                }
                else {
-                       if (G.f & G_DEBUG)
-                               printf("Button Insert-Key: no path to property \n");
+                       if (G.debug & G_DEBUG)
+                               printf("Button Insert-Key: no path to property\n");
                        BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead");
                }
        }
-       else if (G.f & G_DEBUG) {
+       else if (G.debug & G_DEBUG) {
                printf("ptr.data = %p, prop = %p,", (void *)ptr.data, (void *)prop);
                if (prop)
-                       printf("animatable = %d \n", RNA_property_animateable(&ptr, prop));
+                       printf("animatable = %d\n", RNA_property_animateable(&ptr, prop));
                else
-                       printf("animatable = NULL \n");
+                       printf("animatable = NULL\n");
        }
        
        if (success) {
@@ -1525,11 +1525,11 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
                        
                        MEM_freeN(path);
                }
-               else if (G.f & G_DEBUG)
-                       printf("Button Delete-Key: no path to property \n");
+               else if (G.debug & G_DEBUG)
+                       printf("Button Delete-Key: no path to property\n");
        }
-       else if (G.f & G_DEBUG) {
-               printf("ptr.data = %p, prop = %p \n", (void *)ptr.data, (void *)prop);
+       else if (G.debug & G_DEBUG) {
+               printf("ptr.data = %p, prop = %p\n", (void *)ptr.data, (void *)prop);
        }
        
        
index 0d93f9401a322c8ea7fd5d5f17011e812fa04bf3..a09722f78b6fe543afd117ef64ff711fe6ef53c1 100644 (file)
@@ -395,7 +395,7 @@ void ED_armature_from_edit(Object *obedit)
                                if (fBone->parent==eBone)
                                        fBone->parent= eBone->parent;
                        }
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("Warning: removed zero sized bone: %s\n", eBone->name);
                        bone_free(arm, eBone);
                }
@@ -2933,7 +2933,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op)
        }
        else {
                // FIXME.. figure out a method for multiple bones
-               BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d \n", count); 
+               BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d\n", count);
                BLI_freelistN(&points);
                return OPERATOR_CANCELLED;
        }
@@ -2976,9 +2976,9 @@ static void bones_merge(Object *obedit, EditBone *start, EditBone *end, EditBone
        
        /* check if same bone */
        if (start == end) {
-               if (G.f & G_DEBUG) {
-                       printf("Error: same bone! \n");
-                       printf("\tstart = %s, end = %s \n", start->name, end->name);
+               if (G.debug & G_DEBUG) {
+                       printf("Error: same bone!\n");
+                       printf("\tstart = %s, end = %s\n", start->name, end->name);
                }
        }
        
index 261018329ab75f5a4421eaaa6a2b0ca3296bd0e0..f554b7b1c5059880157eaca120c2287beacb2005 100644 (file)
@@ -2657,7 +2657,7 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
                        
                        if (next_earc->flag == ARC_FREE && next_earc->symmetry_level == symmetry_level)
                        {
-//                             printf("USING: \n");
+//                             printf("USING:\n");
 //                             printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
                                matchMultiResolutionArc(rigg, start_node, next_iarc, next_earc);
                                break;
index 30f929c960338dee81b73c4a9336e2e8ce294723..546bcb1f40f3415d55eb10d1ec6dd570cee858ab 100644 (file)
@@ -554,12 +554,12 @@ static void verifyBucketsArc(ReebGraph *UNUSED(rg), ReebArc *arc)
                if (ceilf(head->weight) != arc->buckets[0].val)
                {
                        printArc(arc);
-                       printf("alloc error in first bucket: %f should be %f \n", arc->buckets[0].val, ceil(head->weight));
+                       printf("alloc error in first bucket: %f should be %f\n", arc->buckets[0].val, ceil(head->weight));
                }
                if (floorf(tail->weight) != arc->buckets[arc->bcount - 1].val)
                {
                        printArc(arc);
-                       printf("alloc error in last bucket: %f should be %f \n", arc->buckets[arc->bcount - 1].val, floor(tail->weight));
+                       printf("alloc error in last bucket: %f should be %f\n", arc->buckets[arc->bcount - 1].val, floor(tail->weight));
                }
        }
 }
index aeab4f271793b3dfc703c19c1c2c6052388679e3..a5188ea769ecaa1bb2c463484a89552b0bd1cba0 100644 (file)
@@ -1944,7 +1944,7 @@ static void adduplicateflagNurb(Object *obedit, short flag)
                                        }
                                }
                                if (newu==0 || newv==0) {
-                                       if (G.f & G_DEBUG)
+                                       if (G.debug & G_DEBUG)
                                                printf("Can't duplicate Nurb\n");
                                }
                                else {
index 528991e31f0a01151dbdc2c37a8fb86a6e80c18d..8f0ea378a2afa7c266ec1be71fd0dbeb8285ff6a 100644 (file)
@@ -117,7 +117,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
                float oldpressure = points[0].pressure;
                
                /* draw stroke curve */
-               if (G.f & G_DEBUG) setlinestyle(2);
+               if (G.debug & G_DEBUG) setlinestyle(2);
 
                glLineWidth(oldpressure * thickness);
                glBegin(GL_LINE_STRIP);
@@ -147,7 +147,7 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick
                /* reset for predictable OpenGL context */
                glLineWidth(1.0f);
                
-               if (G.f & G_DEBUG) setlinestyle(0);
+               if (G.debug & G_DEBUG) setlinestyle(0);
        }
 }
 
index 62e2e62b8807c9b2e0dca461f2844bfb8987a76c..263c842ed08742548e81f7c4024b1056e9bf2d6c 100644 (file)
@@ -204,7 +204,7 @@ static void gp_drawui_layer(uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, cons
                uiItemR(col, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
                
                /* debugging options */
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        uiItemR(col, &ptr, "show_points", 0, NULL, ICON_NONE);
                }
                
index 20111fc66b259b0219c68cc3dd28999d67bd0df4..c366de6fa43eb4de93e75b1b1694fa507e7dc727 100644 (file)
@@ -569,8 +569,8 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
        
        /* exit with error if no valid points from this stroke */
        if (totelem == 0) {
-               if (G.f & G_DEBUG) 
-                       printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size);
+               if (G.debug & G_DEBUG)
+                       printf("Error: No valid points in stroke buffer to convert (tot=%d)\n", gpd->sbuffer_size);
                return;
        }
        
@@ -987,8 +987,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
        /* make sure the active view (at the starting time) is a 3d-view */
        if (curarea == NULL) {
                p->status= GP_STATUS_ERROR;
-               if (G.f & G_DEBUG) 
-                       printf("Error: No active view for painting \n");
+               if (G.debug & G_DEBUG)
+                       printf("Error: No active view for painting\n");
                return 0;
        }
        
@@ -1013,8 +1013,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        
                        if (ar->regiondata == NULL) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG)
-                                       printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable\n");
                                return 0;
                        }
 
@@ -1022,8 +1022,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        /* check that gpencil data is allowed to be drawn */
                        if ((v3d->flag2 & V3D_DISPGP)==0) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG) 
-                                       printf("Error: In active view, Grease Pencil not shown \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: In active view, Grease Pencil not shown\n");
                                return 0;
                        }
 #endif
@@ -1043,8 +1043,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        /* check that gpencil data is allowed to be drawn */
                        if ((snode->flag & SNODE_DISPGP)==0) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG) 
-                                       printf("Error: In active view, Grease Pencil not shown \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: In active view, Grease Pencil not shown\n");
                                return 0;
                        }
 #endif
@@ -1063,14 +1063,14 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        /* check that gpencil data is allowed to be drawn */
                        if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG) 
-                                       printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil\n");
                                return 0;
                        }
                        if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG) 
-                                       printf("Error: In active view, Grease Pencil not shown \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: In active view, Grease Pencil not shown\n");
                                return 0;
                        }
                }
@@ -1090,8 +1090,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                        /* check that gpencil data is allowed to be drawn */
                        if ((sima->flag & SI_DISPGP)==0) {
                                p->status= GP_STATUS_ERROR;
-                               if (G.f & G_DEBUG)
-                                       printf("Error: In active view, Grease Pencil not shown \n");
+                               if (G.debug & G_DEBUG)
+                                       printf("Error: In active view, Grease Pencil not shown\n");
                                return 0;
                        }
 #endif
@@ -1121,8 +1121,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
                default:
                {
                        p->status= GP_STATUS_ERROR;
-                       if (G.f & G_DEBUG) 
-                               printf("Error: Active view not appropriate for Grease Pencil drawing \n");
+                       if (G.debug & G_DEBUG)
+                               printf("Error: Active view not appropriate for Grease Pencil drawing\n");
                        return 0;
                }
                        break;
@@ -1132,8 +1132,8 @@ static int gp_session_initdata (bContext *C, tGPsdata *p)
        gpd_ptr= gpencil_data_get_pointers(C, &p->ownerPtr);
        if (gpd_ptr == NULL) {
                p->status= GP_STATUS_ERROR;
-               if (G.f & G_DEBUG)
-                       printf("Error: Current context doesn't allow for any Grease Pencil data \n");
+               if (G.debug & G_DEBUG)
+                       printf("Error: Current context doesn't allow for any Grease Pencil data\n");
                return 0;
        }
        else {
@@ -1209,8 +1209,8 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
        }
        if (p->gpl->flag & GP_LAYER_LOCKED) {
                p->status= GP_STATUS_ERROR;
-               if (G.f & G_DEBUG)
-                       printf("Error: Cannot paint on locked layer \n");
+               if (G.debug & G_DEBUG)
+                       printf("Error: Cannot paint on locked layer\n");
                return;
        }
                
@@ -1218,8 +1218,8 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
        p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1);
        if (p->gpf == NULL) {
                p->status= GP_STATUS_ERROR;
-               if (G.f & G_DEBUG) 
-                       printf("Error: No frame created (gpencil_paint_init) \n");
+               if (G.debug & G_DEBUG)
+                       printf("Error: No frame created (gpencil_paint_init)\n");
                return;
        }
        else
@@ -1519,8 +1519,8 @@ static void gpencil_draw_apply (wmOperator *op, tGPsdata *p)
                        BKE_report(op->reports, RPT_ERROR, "Cannot paint stroke");
                        p->status = GP_STATUS_ERROR;
                        
-                       if (G.f & G_DEBUG) 
-                               printf("Error: Grease-Pencil Paint - Add Point Invalid \n");
+                       if (G.debug & G_DEBUG)
+                               printf("Error: Grease-Pencil Paint - Add Point Invalid\n");
                        return;
                }
                
@@ -1595,18 +1595,18 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
 {
        tGPsdata *p = NULL;
        
-       //printf("GPencil - Starting Re-Drawing \n");
+       //printf("GPencil - Starting Re-Drawing\n");
        
        /* try to initialize context data needed while drawing */
        if (!gpencil_draw_init(C, op)) {
                if (op->customdata) MEM_freeN(op->customdata);
-               //printf("\tGP - no valid data \n");
+               //printf("\tGP - no valid data\n");
                return OPERATOR_CANCELLED;
        }
        else
                p= op->customdata;
        
-       //printf("\tGP - Start redrawing stroke \n");
+       //printf("\tGP - Start redrawing stroke\n");
        
        /* loop over the stroke RNA elements recorded (i.e. progress of mouse movement),
         * setting the relevant values in context at each step, then applying
@@ -1614,7 +1614,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
        RNA_BEGIN(op->ptr, itemptr, "stroke") {
                float mousef[2];
                
-               //printf("\t\tGP - stroke elem \n");
+               //printf("\t\tGP - stroke elem\n");
                
                /* get relevant data for this point from stroke */
                RNA_float_get_array(&itemptr, "mouse", mousef);
@@ -1647,7 +1647,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op)
        }
        RNA_END;
        
-       //printf("\tGP - done \n");
+       //printf("\tGP - done\n");
        
        /* cleanup */
        gpencil_draw_exit(C, op);
@@ -1667,15 +1667,15 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event)
        tGPsdata *p = NULL;
        wmWindow *win= CTX_wm_window(C);
        
-       if (G.f & G_DEBUG)
-               printf("GPencil - Starting Drawing \n");
+       if (G.debug & G_DEBUG)
+               printf("GPencil - Starting Drawing\n");
        
        /* try to initialize context data needed while drawing */
        if (!gpencil_draw_init(C, op)) {
                if (op->customdata) 
                        MEM_freeN(op->customdata);
-               if (G.f & G_DEBUG)
-                       printf("\tGP - no valid data \n");
+               if (G.debug & G_DEBUG)
+                       printf("\tGP - no valid data\n");
                return OPERATOR_CANCELLED;
        }
        else
@@ -1742,11 +1742,11 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
         * otherwise we could crash (see bug #20586)
         */
        if (CTX_wm_area(C) != p->sa) {
-               printf("\t\t\tGP - wrong area execution abort! \n");
+               printf("\t\t\tGP - wrong area execution abort!\n");
                p->status= GP_STATUS_ERROR;
        }
 
-       //printf("\t\tGP - start stroke \n");
+       //printf("\t\tGP - start stroke\n");
 
        /* we may need to set up paint env again if we're resuming */
        // XXX: watch it with the paintmode! in future, it'd be nice to allow changing paint-mode when in sketching-sessions
@@ -1858,7 +1858,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
                        
                        /* finish painting operation if anything went wrong just now */
                        if (p->status == GP_STATUS_ERROR) {
-                               printf("\t\t\t\tGP - add error done! \n");
+                               printf("\t\t\t\tGP - add error done!\n");
                                estate = OPERATOR_CANCELLED;
                        }
                        else {
index 955d564e111a5246b07b5a08f6d0421bf577db8f..c7f8ad521fae259edff42b28a97856354b029df2 100644 (file)
@@ -135,7 +135,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
        
        /* button must have RNA-pointer to a numeric-capable property */
        if (ELEM(NULL, but->rnapoin.data, but->rnaprop)) {
-               if (G.f & G_DEBUG) 
+               if (G.debug & G_DEBUG)
                        printf("ERROR: create expression failed - button has no RNA info attached\n");
                return 0;
        }
@@ -144,7 +144,7 @@ int ui_but_anim_expression_create(uiBut *but, const char *str)
        // FIXME: until materials can be handled by depsgraph, don't allow drivers to be created for them
        id = (ID *)but->rnapoin.id.data;
        if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("ERROR: create expression failed - invalid id-datablock for adding drivers (%p)\n", id);
                return 0;
        }
index 420cae8785115c2e9400aae961ff495c82ce2542..887ae250c1b82c8752145641b2018c615a49bb5d 100644 (file)
@@ -4585,7 +4585,7 @@ static int ui_but_menu(bContext *C, uiBut *but)
                }
        }
 
-       /* perhaps we should move this into (G.f & G_DEBUG) - campbell */
+       /* perhaps we should move this into (G.debug & G_DEBUG) - campbell */
        uiItemFullO(layout, "UI_OT_editsource", "Edit Source", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0);
 
        uiPupMenuEnd(C, pup);
index 24881c034f46b98e80a53137d962b33642744cd3..d028fcd93ae764322ddf773b24144ed479913c45 100644 (file)
@@ -757,7 +757,7 @@ int UI_icon_get_width(int icon_id)
        icon = BKE_icon_get(icon_id);
        
        if (icon == NULL) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
                return 0;
        }
@@ -782,7 +782,7 @@ int UI_icon_get_height(int icon_id)
        icon = BKE_icon_get(icon_id);
        
        if (icon == NULL) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
                return 0;
        }
@@ -830,7 +830,7 @@ static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size)
        unsigned int render_size = preview_render_size(size);
 
        if (!prv_img) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("%s, error: requested preview image does not exist", __func__);
        }
        if (!prv_img->rect[size]) {
@@ -847,7 +847,7 @@ static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size)
 static void icon_set_image(bContext *C, ID *id, PreviewImage *prv_img, enum eIconSizes size)
 {
        if (!prv_img) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("%s: no preview image for this ID: %s\n", __func__, id->name);
                return;
        }       
@@ -967,7 +967,7 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
        alpha *= btheme->tui.icon_alpha;
        
        if (icon == NULL) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id);
                return;
        }
index 34116f24901df4a896e828a2741917f8627b0d97..ebaef26082f7184e735f370e83976dd37d6d3e5a 100644 (file)
@@ -460,7 +460,7 @@ static int reports_to_text_exec(bContext *C, wmOperator *UNUSED(op))
         *      - if commandline debug option enabled, show debug reports too
         *      - otherwise, up to info (which is what users normally see)
         */
-       str = BKE_reports_string(reports, (G.f & G_DEBUG) ? RPT_DEBUG : RPT_INFO);
+       str = BKE_reports_string(reports, (G.debug & G_DEBUG) ? RPT_DEBUG : RPT_INFO);
 
        if (str) {
                write_text(txt, str);
index 91e3b99e23bf3f6f546ee0bf2a4e69705fe8cdb1..5d52766717070c682d6ec744325bee8105b85e16 100644 (file)
@@ -356,7 +356,7 @@ void uiStyleInit(void)
                }
 
                if (font->blf_id == -1) {
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("%s: error, no fonts available\n", __func__);
                }
                else {
index 5c05e9d2ba153fddfe997a63ea4bd652da851263..7eac3050b97e96315466f1e71caf76184892682c 100644 (file)
@@ -852,8 +852,8 @@ void UI_view2d_totRect_set_resize(View2D *v2d, int width, int height, int resize
                height -= V2D_SCROLL_HEIGHT;
        
        if (ELEM3(0, v2d, width, height)) {
-               if (G.f & G_DEBUG)
-                       printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", (void *)v2d, width, height);  // XXX temp debug info
+               if (G.debug & G_DEBUG)
+                       printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d\n", (void *)v2d, width, height);  // XXX temp debug info
                return;
        }
        
index 5b2aaf30897bc6d6a41238cb1aff0e24c7235c16..ec3567454dfb393031e5e86a89d1d456f830386e 100644 (file)
@@ -589,19 +589,19 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
                if (pchan)
                        list = &pchan->constraints;
                else {
-                       //if (G.f & G_DEBUG)
+                       //if (G.debug & G_DEBUG)
                        //printf("edit_constraint_property_get: No active bone for object '%s'\n", (ob)? ob->id.name+2 : "<None>");
                        return NULL;
                }
        }
        else {
-               //if (G.f & G_DEBUG)
+               //if (G.debug & G_DEBUG)
                //printf("edit_constraint_property_get: defaulting to getting list in the standard way\n");
                list = get_active_constraints(ob);
        }
        
        con = constraints_findByName(list, constraint_name);
-       //if (G.f & G_DEBUG)
+       //if (G.debug & G_DEBUG)
        //printf("constraint found = %p, %s\n", (void *)con, (con)?con->name:"<Not found>");
 
        if (con && (type != 0) && (con->type != type))
index a6fb946c83f0a07288b5364c5b1e965994049c8c..57d0de522a1a2f6fd378f8eadbbd2f03868243bb 100644 (file)
@@ -1504,8 +1504,8 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
                                        ob->data= copy_speaker(ob->data);
                                        break;
                                default:
-                                       if (G.f & G_DEBUG)
-                                               printf("ERROR single_obdata_users: can't copy %s\n", id->name);
+                                       if (G.debug & G_DEBUG)
+                                               printf("ERROR %s: can't copy %s\n", __func__, id->name);
                                        return;
                                }
                                
index bf3a9fff4e2e8062183b87b47b305ce4daefe979..53e0e2b4056359e104cbd509f37c7084f33cec64 100644 (file)
@@ -3937,7 +3937,7 @@ void PE_undo_step(Scene *scene, int step)
                
                if (edit->curundo==NULL || edit->curundo->prev==NULL);
                else {
-                       if (G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name);
+                       if (G.debug & G_DEBUG) printf("undo %s\n", edit->curundo->name);
                        edit->curundo= edit->curundo->prev;
                        get_PTCacheUndo(edit, edit->curundo);
                }
@@ -3949,7 +3949,7 @@ void PE_undo_step(Scene *scene, int step)
                else {
                        get_PTCacheUndo(edit, edit->curundo->next);
                        edit->curundo= edit->curundo->next;
-                       if (G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name);
+                       if (G.debug & G_DEBUG) printf("redo %s\n", edit->curundo->name);
                }
        }
 
index 1e71cf61817b8d6328eb786b114511132d3c61d5..3d50ec26a4043706e6be33968c0bdd95512d1ab9 100644 (file)
@@ -670,7 +670,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
                BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree);
 
                if (nearest.index == -1) {
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("No nearest point found for hair root!");
                        continue;
                }
index 23765b03d353e97bf165591fa5c8cfcf87209bf5..6a074a542c35202e77a3007ffd5d3ab53f611bf9 100644 (file)
@@ -224,17 +224,17 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char
                // invalid, cant happen?
        }
 
-       fprintf(file, "      CHANNEL %s = \n", str); 
+       fprintf(file, "      CHANNEL %s =\n", str);
        for (i=0; i<channelSize;i++) { 
                fprintf(file,"        ");  
                for (j=0;j<=entries;j++) {  // also print time value
                        fprintf(file," %f ", channel[i*(entries+1)+j] ); 
                        if (j==entries-1) { fprintf(file,"  "); }
                } 
-               fprintf(file," \n");  
+               fprintf(file,"\n");
        } 
 
-       fprintf(file,  "      ; \n" ); 
+       fprintf(file,  "      ;\n" );
 }
 #endif
 
@@ -805,7 +805,7 @@ int runSimulationCallback(void *data, int status, int frame)
        
        if (status == FLUIDSIM_CBSTATUS_NEWFRAME) {
                fluidbake_updatejob(fb, frame / (float)settings->noOfFrames);
-               //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d \n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
+               //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG
        }
        
        if (fluidbake_breakjob(fb)) {
index 97fd80fc946968e5c6e5284601efa1d5fb7b33f1..47a4c376f963ed75804bbb271d725c06c1c73cbd 100644 (file)
@@ -317,8 +317,8 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
 
        /* very weak... but 512 characters is quite safe */
        if (spos >= str + IMA_MAX_RENDER_TEXT)
-               if (G.f & G_DEBUG)
-                       printf("WARNING! renderwin text beyond limit \n");
+               if (G.debug & G_DEBUG)
+                       printf("WARNING! renderwin text beyond limit\n");
 
 }
 
index 8f429321fbb640dff6bd69bd4a0f64137a7a3529..43b917c21862d4df80b821d8c4d9743484a17c02 100644 (file)
@@ -1037,7 +1037,7 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int
                        if (count!=4) {
                                /* let's stop adding regions */
                                BLI_init_rcti(remainder, 0, 0, 0, 0);
-                               if (G.f & G_DEBUG)
+                               if (G.debug & G_DEBUG)
                                        printf("region quadsplit failed\n");
                        }
                        else quad= 1;
index 9deb64ef60a3568c9e9227d72d95f0458d45b349..1b56feb09d1fb7da400ab8c3519e0c9abb611de2 100644 (file)
@@ -531,7 +531,7 @@ int screen_area_join(bContext *C, bScreen* scr, ScrArea *sa1, ScrArea *sa2)
        int dir;
        
        dir = area_getorientation(sa1, sa2);
-       /*printf("dir is : %i \n", dir);*/
+       /*printf("dir is : %i\n", dir);*/
        
        if (dir < 0) {
                if (sa1 ) sa1->flag &= ~AREA_FLAG_DRAWJOINFROM;
@@ -1101,7 +1101,9 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win)
                        WM_event_timer_sleep(wm, win, win->screen->animtimer, 0);
        }
 
-       if (G.f & G_DEBUG) printf("set screen\n");
+       if (G.debug & G_DEBUG_EVENTS) {
+               printf("%s: set screen\n", __func__);
+       }
        win->screen->do_refresh= 0;
 
        win->screen->context= ed_screen_context;
@@ -1634,8 +1636,8 @@ ScrArea *ED_screen_full_toggle(bContext *C, wmWindow *win, ScrArea *sa)
                for (old= sc->areabase.first; old; old= old->next)
                        if (old->full) break;
                if (old==NULL) {
-                       if (G.f & G_DEBUG)
-                               printf("something wrong in areafullscreen\n");
+                       if (G.debug & G_DEBUG)
+                               printf("%s: something wrong in areafullscreen\n", __func__);
                        return NULL;
                }
 
index f0dbdf18826342e962860ca38e50e57e81d59c3f..e427e1e21cf2673a27c3473f601b921b827d5948 100644 (file)
@@ -3374,7 +3374,7 @@ static int scene_delete_exec(bContext *C, wmOperator *UNUSED(op))
 
        ED_screen_delete_scene(C, scene);
 
-       if (G.f & G_DEBUG)
+       if (G.debug & G_DEBUG)
                printf("scene delete %p\n", scene);
 
        WM_event_add_notifier(C, NC_SCENE|NA_REMOVED, scene);
index f553084cfd9083d3882da0c37853dd023ba574c4..9cf8cc2199665c9977f2efd7b68191a70dd1b34f 100644 (file)
@@ -1037,7 +1037,7 @@ static int pixel_bounds_uv(
        bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1;
        bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1;
        
-       /*printf("%d %d %d %d \n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
+       /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
        
        /* face uses no UV area when quantized to pixels? */
        return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? 0 : 1;
@@ -1065,7 +1065,7 @@ static int pixel_bounds_array(float (*uv)[2], rcti *bounds_px, const int ibuf_x,
        bounds_px->xmax = (int)(ibuf_x * max_uv[0]) + 1;
        bounds_px->ymax = (int)(ibuf_y * max_uv[1]) + 1;
        
-       /*printf("%d %d %d %d \n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
+       /*printf("%d %d %d %d\n", min_px[0], min_px[1], max_px[0], max_px[1]);*/
        
        /* face uses no UV area when quantized to pixels? */
        return (bounds_px->xmin == bounds_px->xmax || bounds_px->ymin == bounds_px->ymax) ? 0 : 1;
@@ -3643,7 +3643,7 @@ static int project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf
        if (ps->thread_tot > 1)
                BLI_lock_thread(LOCK_CUSTOM1);
        
-       //printf("%d %d \n", ps->context_bucket_x, ps->context_bucket_y);
+       //printf("%d %d\n", ps->context_bucket_x, ps->context_bucket_y);
        
        for (; ps->context_bucket_y < ps->bucketMax[1]; ps->context_bucket_y++) {
                for (; ps->context_bucket_x < ps->bucketMax[0]; ps->context_bucket_x++) {
index fbf83dd8df5d801fe5d727d6a61c826e1f6bac9b..65bcfcb70245eee495a7a6750ea1813c53931da6 100644 (file)
@@ -160,7 +160,9 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char *
                if (stack->current == NULL) ;
                else {
                        if (!name || strcmp(stack->current->name, name) == 0) {
-                               if (G.f & G_DEBUG) printf("undo %s\n", stack->current->name);
+                               if (G.debug & G_DEBUG_WM) {
+                                       printf("%s: undo '%s'\n", __func__, stack->current->name);
+                               }
                                undo_restore(C, stack, stack->current);
                                stack->current = stack->current->prev;
                                return 1;
@@ -174,7 +176,9 @@ static int undo_stack_step(bContext *C, UndoStack *stack, int step, const char *
                                undo = (stack->current && stack->current->next) ? stack->current->next : stack->elems.first;
                                undo_restore(C, stack, undo);
                                stack->current = undo;
-                               if (G.f & G_DEBUG) printf("redo %s\n", undo->name);
+                               if (G.debug & G_DEBUG_WM) {
+                                       printf("%s: redo %s\n", __func__, undo->name);
+                               }
                                return 1;
                        }
                }
index 630bb75ed5d5bd791142d61315a39bbc496b37f7..f76f5f6523ed7a0c3a79565f7d25a0e984b7d0a7 100644 (file)
@@ -997,7 +997,7 @@ static void mouse_action_keys (bAnimContext *ac, const int mval[2], short select
        ale= BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
-               printf("Error: animation channel (index = %d) not found in mouse_action_keys() \n", channel_index);
+               printf("Error: animation channel (index = %d) not found in mouse_action_keys()\n", channel_index);
                BLI_freelistN(&anim_data);
                return;
        }
index c0cd2a882c83a54edd02fdab13ced01212cc77fb..76a2c92652224b4eee25c8c6cc4b0e2747137bdd 100644 (file)
@@ -291,7 +291,7 @@ static void create_ghost_curves (bAnimContext *ac, int start, int end)
        
        /* sanity check */
        if (start >= end) {
-               printf("Error: Frame range for Ghost F-Curve creation is inappropriate \n");
+               printf("Error: Frame range for Ghost F-Curve creation is inappropriate\n");
                return;
        }
        
index c242a1c1323d33c64881b863f935084224f1adf0..1d323cb6a4f33cee427b7586149d11c2f7165e1e 100644 (file)
@@ -92,8 +92,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
        ale= BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
-               if (G.f & G_DEBUG)
-                       printf("Error: animation channel (index = %d) not found in mouse_anim_channels() \n", channel_index);
+               if (G.debug & G_DEBUG)
+                       printf("Error: animation channel (index = %d) not found in mouse_anim_channels()\n", channel_index);
                
                BLI_freelistN(&anim_data);
                return 0;
@@ -284,8 +284,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
                        break;
                        
                default:
-                       if (G.f & G_DEBUG)
-                               printf("Error: Invalid channel type in mouse_nla_channels() \n");
+                       if (G.debug & G_DEBUG)
+                               printf("Error: Invalid channel type in mouse_nla_channels()\n");
        }
        
        /* free channels */
index 0c2dc7493e2573c925117f0de5fd404b490224fe..1a94b1160be2f11db41e5cfbd2ba824cef040979 100644 (file)
@@ -399,7 +399,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
        
        if (act == NULL) {
                BKE_report(op->reports, RPT_ERROR, "No valid Action to add");
-               //printf("Add strip - actname = '%s' \n", actname);
+               //printf("Add strip - actname = '%s'\n", actname);
                return OPERATOR_CANCELLED;
        }
        else if (act->idroot == 0) {
index 1434bd8ddc201f91eed565c666d1b0385813a900..b0cd59ea7adcca3f2ee11945a4ae46b599f26621 100644 (file)
@@ -538,7 +538,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, const int mval[2],
        ale= BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
-               printf("Error: animation channel (index = %d) not found in mouse_nla_strips() \n", channel_index);
+               printf("Error: animation channel (index = %d) not found in mouse_nla_strips()\n", channel_index);
                BLI_freelistN(&anim_data);
                return;
        }
index d95947142f9efae4661ee267d6a8ad50fc06973c..cf2b37304623d3b639285ed388ccf605eff22097 100644 (file)
@@ -370,7 +370,7 @@ void ED_node_composit_default(Scene *sce)
        
        /* but lets check it anyway */
        if (sce->nodetree) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("error in composite initialize\n");
                return;
        }
@@ -410,7 +410,7 @@ void ED_node_texture_default(Tex *tx)
        
        /* but lets check it anyway */
        if (tx->nodetree) {
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("error in texture initialize\n");
                return;
        }
index 258debc8e60f306c4e4cc3f02f90fe8c7a659f80..6d76da3b0e04a12c1fae649ca1eb5a2ff83f5b49 100644 (file)
@@ -3167,7 +3167,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                        draw_em_measure_stats(v3d, ob, em, &scene->unit);
                }
 
-               if ((G.f & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
+               if ((G.debug & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
                    !(v3d->flag2 & V3D_RENDER_OVERRIDE)) {
                        draw_em_indices(em);
                }
index 8849a9af9c064efdc1a82acc36ddffcb99d1f2ed..ac0f8306259a4e22bf24bb130bee4ed60e1ee867 100644 (file)
@@ -252,7 +252,7 @@ void undo_editmode_step(bContext *C, int step)
                
                if (curundo == NULL || curundo->prev == NULL) error("No more steps to undo");
                else {
-                       if (G.f & G_DEBUG) printf("undo %s\n", curundo->name);
+                       if (G.debug & G_DEBUG) printf("undo %s\n", curundo->name);
                        curundo = curundo->prev;
                        undo_restore(curundo, curundo->getdata(C), obedit->data);
                }
@@ -264,7 +264,7 @@ void undo_editmode_step(bContext *C, int step)
                else {
                        undo_restore(curundo->next, curundo->getdata(C), obedit->data);
                        curundo = curundo->next;
-                       if (G.f & G_DEBUG) printf("redo %s\n", curundo->name);
+                       if (G.debug & G_DEBUG) printf("redo %s\n", curundo->name);
                }
        }
        
index 62d761238e4e4773cfc88dfe1369a8ef38abe174..ac264c1a6af1ff82160d7a90e9ed2982bb58f726 100644 (file)
@@ -82,7 +82,7 @@ void ED_undo_push(bContext *C, const char *str)
        Object *obedit = CTX_data_edit_object(C);
        Object *obact = CTX_data_active_object(C);
 
-       if (G.f & G_DEBUG)
+       if (G.debug & G_DEBUG)
                printf("undo push %s\n", str);
        
        if (obedit) {
@@ -361,7 +361,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
                {
                        int retval;
 
-                       if (G.f & G_DEBUG)
+                       if (G.debug & G_DEBUG)
                                printf("redo_cb: operator redo %s\n", op->type->name);
                        ED_undo_pop_op(C, op);
 
@@ -371,7 +371,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
 
                        retval = WM_operator_repeat(C, op);
                        if ((retval & OPERATOR_FINISHED) == 0) {
-                               if (G.f & G_DEBUG)
+                               if (G.debug & G_DEBUG)
                                        printf("redo_cb: operator redo failed: %s, return %d\n", op->type->name, retval);
                                ED_undo_redo(C);
                        }
@@ -380,7 +380,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
                        }
                }
                else {
-                       if (G.f & G_DEBUG) {
+                       if (G.debug & G_DEBUG) {
                                printf("redo_cb: WM_operator_repeat_check returned false %s\n", op->type->name);
                        }
                }
@@ -389,7 +389,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
                CTX_wm_region_set(C, ar);
        }
        else {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("redo_cb: ED_undo_operator_repeat called with NULL 'op'\n");
                }
        }
index 76291aef5846be63e83b959e2ff1894143b8095b..14d6428bf505de3c805d42c6736fb5d759070823 100644 (file)
@@ -587,7 +587,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
        codegen_set_unique_ids(nodes);
        codegen_print_uniforms_functions(ds, nodes);
 
-       //if(G.f & G_DEBUG)
+       //if(G.debug & G_DEBUG)
        //      BLI_dynstr_appendf(ds, "/* %s */\n", name);
 
        BLI_dynstr_append(ds, "void main(void)\n");
@@ -602,7 +602,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
        code = BLI_dynstr_get_cstring(ds);
        BLI_dynstr_free(ds);
 
-       //if(G.f & G_DEBUG) printf("%s\n", code);
+       //if(G.debug & G_DEBUG) printf("%s\n", code);
 
        return code;
 }
@@ -645,7 +645,7 @@ static char *code_generate_vertex(ListBase *nodes)
 
        BLI_dynstr_free(ds);
 
-       //if(G.f & G_DEBUG) printf("%s\n", code);
+       //if(G.debug & G_DEBUG) printf("%s\n", code);
 
        return code;
 }
index 846ee2850bea2d37b07aa9a4958a005ab39ae227..40e6a8b2a35dff1a6922a40713ff49577faf1a92 100644 (file)
@@ -220,7 +220,7 @@ int GPU_print_error(const char *str)
 {
        GLenum errCode;
 
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG) {
                if ((errCode = glGetError()) != GL_NO_ERROR) {
                        fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
                        return 1;
@@ -942,7 +942,7 @@ static void shader_print_errors(const char *task, char *log, const char *code)
 
        fprintf(stderr, "GPUShader: %s error:\n", task);
 
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG) {
                c = code;
                while ((c < end) && (pos = strchr(c, '\n'))) {
                        fprintf(stderr, "%2d  ", line);
index c1222d3cea367fdc3fa93fbca3ef16626fdbbd3f..a7d168d42a29261d9254dd5e8d22a5dde1ead43b 100644 (file)
@@ -72,7 +72,7 @@ static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int
        int width, height, depth;
        float *frow;
 
-       logImageSetVerbose((G.f & G_DEBUG) ? 1:0);
+       logImageSetVerbose((G.debug & G_DEBUG) ? 1:0);
        
        image = logImageOpenFromMem(mem, size, use_cineon);
        
@@ -149,7 +149,7 @@ static int imb_save_dpx_cineon(ImBuf *ibuf, const char *filename, int use_cineon
                return 0;
        }
        
-       logImageSetVerbose((G.f & G_DEBUG) ? 1:0);
+       logImageSetVerbose((G.debug & G_DEBUG) ? 1:0);
        logImage = logImageCreate(filename, use_cineon, width, height, depth);
 
        if (!logImage) return 0;
index 3fbeb6a957d98e2e47cc440e9d85447fdb917a81..f81fb740ff09da782f2547b262d330fd2df353f1 100644 (file)
@@ -492,7 +492,7 @@ static int imb_read_tiff_pixels(ImBuf *ibuf, TIFF *image, int premul)
 
 void imb_inittiff(void)
 {
-       if (!(G.f & G_DEBUG))
+       if (!(G.debug & G_DEBUG))
                TIFFSetErrorHandler(NULL);
 }
 
index c21c58a114accf11f891bd4616b5cd8d0c1718b9..9c5b39e180d487ccfd8c67a383006d3aa4605874 100644 (file)
@@ -231,7 +231,7 @@ void do_init_ffmpeg(void)
                ffmpeg_init = 1;
                av_register_all();
                avdevice_register_all();
-               if ((G.f & G_DEBUG_FFMPEG) == 0) {
+               if ((G.debug & G_DEBUG_FFMPEG) == 0) {
                        silence_log_ffmpeg(1);
                }
                else {
index 5e4c244dbc2be43d95c637df3091b0771f3f242c..ef7a2746d37de7727c8cc76558b837c526ed6cb9 100644 (file)
@@ -783,7 +783,7 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata
                }
                else {
                        /* for debug */
-                       printf("errpr: illegal pointersize! \n");
+                       printf("errpr: illegal pointersize!\n");
                }
                
                olddata+= oldlen;
index bd04698107cd8713b3809b924dca483386ffaa09..ae6432dcbe403368d98c15ffca4a94c4d204fe33 100644 (file)
@@ -312,10 +312,10 @@ static int add_name(const char *str)
 
                j++; /* j beyond closing brace ? */
                while ((str[j] != 0) && (str[j] != ')' )) {
-                       if (debugSDNA > 3) printf("seen %c ( %d) \n", str[j], str[j]);
+                       if (debugSDNA > 3) printf("seen %c ( %d)\n", str[j], str[j]);
                        j++;
                }
-               if (debugSDNA > 3) printf("seen %c ( %d) \n"
+               if (debugSDNA > 3) printf("seen %c ( %d)\n"
                                          "special after offset%d\n",
                                          str[j], str[j], j);
                                
@@ -848,7 +848,7 @@ static int calculate_structlens(int firststruct)
                printf("ERROR: still %d structs unknown\n", unknown);
 
                if (debugSDNA) {
-                       printf("*** Known structs : \n");
+                       printf("*** Known structs :\n");
                        
                        for (a=0; a<nr_structs; a++) {
                                structpoin= structs[a];
@@ -862,7 +862,7 @@ static int calculate_structlens(int firststruct)
                }
 
                        
-               printf("*** Unknown structs : \n");
+               printf("*** Unknown structs :\n");
                        
                for (a=0; a<nr_structs; a++) {
                        structpoin= structs[a];
@@ -995,7 +995,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
 
                printf("nr_names %d nr_types %d nr_structs %d\n", nr_names, nr_types, nr_structs);
                for (a=0; a<nr_names; a++) { 
-                       printf(" %s \n", names[a]);
+                       printf(" %s\n", names[a]);
                }
                printf("\n");
                
index ac199e67a1bc75a4d97017c9023be940e0b4c1ad..c7eeb633e2574e76cca948c0afbb02f72847c9e4 100644 (file)
@@ -351,7 +351,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value)
        }
        else if (value.data && (pid != vid)) {
                /* id's differ, cant do this, should raise an error */
-               printf("ERROR: ID's differ - ptr=%p vs value=%p \n", pid, vid);
+               printf("ERROR: ID's differ - ptr=%p vs value=%p\n", pid, vid);
                return;
        }
        
index 7a43c8cb770f67e2b8e18663361ff14ab1d0ecf7..67a4bafb8eef30b7b535aaf7c4c5c8329270c743 100644 (file)
@@ -75,7 +75,7 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
                ED_screen_set_scene(C, sc, sc->newscene);
                WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene);
 
-               if (G.f & G_DEBUG)
+               if (G.debug & G_DEBUG)
                        printf("scene set %p\n", sc->newscene);
 
                sc->newscene = NULL;
index b60e962f53427c5bfa0a52403905026f922dbe1f..7bd0d03322ddbd74a2e3c4a93e0e60af915e3bba 100644 (file)
@@ -523,7 +523,7 @@ static void freeExecutableNode(bNodeTreeExec *exec)
                                if (ns && ns->data) {
                                        free_compbuf(ns->data);
                                        ns->data= NULL;
-                                       // printf("freed buf node %s \n", node->name);
+                                       // printf("freed buf node %s\n", node->name);
                                }
                        }
                }
index aab1f508e324d103f1f4ae9dfe217fec3723c3c7..44979700d943a5d5d7042771a794afd301cda36c 100644 (file)
@@ -166,24 +166,26 @@ static PyObject *make_app_info(void)
  * they are not static */
 
 PyDoc_STRVAR(bpy_app_debug_doc,
-"Boolean, set when blender is running in debug mode (started with --debug)"
+"Boolean, for debug info (started with --debug / --debug_* matching this attribute name)"
 );
-static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure))
+static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *closure)
 {
-       return PyBool_FromLong(G.f & G_DEBUG);
+       const int flag = GET_INT_FROM_POINTER(closure);
+       return PyBool_FromLong(G.debug & flag);
 }
 
-static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
+static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *closure)
 {
-       int param = PyObject_IsTrue(value);
+       const int flag = GET_INT_FROM_POINTER(closure);
+       const int param = PyObject_IsTrue(value);
 
        if (param < 0) {
                PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False");
                return -1;
        }
        
-       if (param)  G.f |=  G_DEBUG;
-       else        G.f &= ~G_DEBUG;
+       if (param)  G.debug |=  flag;
+       else        G.debug &= ~flag;
        
        return 0;
 }
@@ -236,7 +238,12 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl
 
 
 static PyGetSetDef bpy_app_getsets[] = {
-       {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, NULL},
+       {(char *)"debug",        bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG},
+       {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG},
+       {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON},
+       {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS},
+       {(char *)"debug_wm",     bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM},
+
        {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
        {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL},
        {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL},
index 61b3f7b157595284a6a13fb0df3fd8637b205c4a..7b362e56c739c847665491adeb33dd2ae74e042a 100644 (file)
@@ -696,7 +696,7 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
                else      printf("PyContext '%s' not found\n", member);
        }
        else {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG_PYTHON) {
                        printf("PyContext '%s' found\n", member);
                }
        }
index 1f284ae01cbf4dcc7a59cd9679e09725b6b8ee10..7af53b489bda8520b21bed93b8c80a5ed02e2090 100644 (file)
@@ -6033,7 +6033,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna)
                                newclass = NULL;
                        }
                        else {
-                               if (G.f & G_DEBUG)
+                               if (G.debug & G_DEBUG_PYTHON)
                                        fprintf(stderr, "SRNA Subclassed: '%s'\n", idname);
                        }
                }
@@ -7145,7 +7145,7 @@ static void bpy_class_free(void *pyob_ptr)
                PyErr_Clear();
 
 #if 0 /* needs further investigation, too annoying so quiet for now */
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG_PYTHON) {
                if (self->ob_refcnt > 1) {
                        PyC_ObSpit("zombie class - ref should be 1", self);
                }
@@ -7444,7 +7444,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
        }
 
        /* should happen all the time but very slow */
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG_PYTHON) {
                /* remove all properties using this class */
                StructRNA *srna_iter;
                PointerRNA ptr_rna;
index 8d8219df188746ae4ffd7c282cc360f615609a80..5c59c1e620a4d00ce65572398160e27761c5dad0 100644 (file)
@@ -664,7 +664,7 @@ PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, PointerRNA *ptr,
        len = RNA_property_multi_array_length(ptr, prop, arraydim);
        if (index >= len || index < 0) {
                /* this shouldn't happen because higher level funcs must check for invalid index */
-               if (G.f & G_DEBUG) printf("pyrna_py_from_array_index: invalid index %d for array with length=%d\n", index, len);
+               if (G.debug & G_DEBUG_PYTHON) printf("pyrna_py_from_array_index: invalid index %d for array with length=%d\n", index, len);
 
                PyErr_SetString(PyExc_IndexError, "out of range");
                return NULL;
index 197b3f14c7ac6f92e16a85316812f6785a2878ca..ea1d5c2573c76e6909e65cb936bdff5e2e845358 100644 (file)
@@ -440,8 +440,8 @@ static void RE_rayobject_octree_free(RayObject *tree)
 
 #if 0
        printf("branches %d nodes %d\n", oc->branchcount, oc->nodecount);
-       printf("raycount %d \n", raycount);     
-       printf("ray coherent %d \n", coherent_ray);
+       printf("raycount %d\n", raycount);
+       printf("ray coherent %d\n", coherent_ray);
        printf("accepted %d rejected %d\n", accepted, rejected);
 #endif
        if (oc->ocface)
index 84395a9ad50844195be60fa097622d97a8f84ff0..e82623f1da95682d352a6174a4eb53ce6dc03209 100644 (file)
@@ -161,7 +161,7 @@ void bfree(VBVHTree *tree)
 {
        if (tot_pushup + tot_pushdown + tot_hints + tot_moves)
        {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("tot pushups: %d\n", tot_pushup);
                        printf("tot pushdowns: %d\n", tot_pushdown);
                        printf("tot moves: %d\n", tot_moves);
index be131100021fecdc0d09d296ff339f2c70159757..68b2b22ecddf4af075231767947f41712134c027 100644 (file)
@@ -529,7 +529,7 @@ struct VBVH_optimalPackSIMD
                        if(num == 0) { num++; first = true; }
                        
                        calc_costs(node);
-                       if((G.f & G_DEBUG) && first) printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize );
+                       if((G.debug & G_DEBUG) && first) printf("expected cost = %f (%d)\n", node->cut_cost[0], node->best_cutsize );
                        node->optimize();
                }
                return node;            
index fba9bb9ad411a2ffe5ffd85625728ce4b98a84ff..e0e96781f361ccf2ff3cb0919ea34a214eaafec7 100644 (file)
@@ -224,7 +224,7 @@ struct Reorganize_SVBVH
        
        ~Reorganize_SVBVH()
        {
-               if(G.f & G_DEBUG) {
+               if(G.debug & G_DEBUG) {
                        printf("%f childs per node\n", childs_per_node / nodes);
                        printf("%d childs BB are useless\n", useless_bb);
                        for(int i=0; i<16; i++)
index ff6f83cc946e520fe3aa7aadaa3fa9a811f7afc1..b8935b5f9601e6a5224076a1a63af027f46da61d 100644 (file)
@@ -3231,7 +3231,7 @@ static void init_camera_inside_volumes(Render *re)
        /* debug {
        MatInside *m;
        for (m=re->render_volumes_inside.first; m; m=m->next) {
-               printf("matinside: ma: %s \n", m->ma->id.name+2);
+               printf("matinside: ma: %s\n", m->ma->id.name+2);
        }
        }*/
 }
@@ -4649,7 +4649,7 @@ void RE_Database_Free(Render *re)
        LampRen *lar;
        
        /* statistics for debugging render memory usage */
-       if ((G.f & G_DEBUG) && (G.rendering)) {
+       if ((G.debug & G_DEBUG) && (G.rendering)) {
                if ((re->r.scemode & R_PREVIEWBUTS)==0) {
                        BKE_image_print_memlist();
                        MEM_printmemlist_stats();
@@ -5516,7 +5516,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
                // set both to the same value
                speed[0]= speed[2]= zco[0];
                speed[1]= speed[3]= zco[1];
-               //if(a<20) fprintf(stderr,"speed %d %f,%f | camco %f,%f,%f | hoco %f,%f,%f,%f  \n", a, speed[0], speed[1], camco[0],camco[1], camco[2], hoco[0],hoco[1], hoco[2],hoco[3]); // NT DEBUG
+               //if(a<20) fprintf(stderr,"speed %d %f,%f | camco %f,%f,%f | hoco %f,%f,%f,%f\n", a, speed[0], speed[1], camco[0],camco[1], camco[2], hoco[0],hoco[1], hoco[2],hoco[3]); // NT DEBUG
        }
 
        return 1;
index bd01c75ef3fbb96a8e2152b707ad0c1a311d586b..bb3ef082500c9bdd19857fc58170106777ac9501 100644 (file)
@@ -485,11 +485,11 @@ static void *vol_precache_part_test(void *data)
 {
        VolPrecachePart *pa = data;
 
-       printf("part number: %d \n", pa->num);
-       printf("done: %d \n", pa->done);
-       printf("x min: %d   x max: %d \n", pa->minx, pa->maxx);
-       printf("y min: %d   y max: %d \n", pa->miny, pa->maxy);
-       printf("z min: %d   z max: %d \n", pa->minz, pa->maxz);
+       printf("part number: %d\n", pa->num);
+       printf("done: %d\n", pa->done);
+       printf("x min: %d   x max: %d\n", pa->minx, pa->maxx);
+       printf("y min: %d   y max: %d\n", pa->miny, pa->maxy);
+       printf("z min: %d   z max: %d\n", pa->minz, pa->maxz);
 
        return NULL;
 }
index 80a2591348103c0e4c6efe51f4d39a688185004d..f97391c0d6ee368fcf9b4cd1564a84977728b2d3 100644 (file)
@@ -188,7 +188,7 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
 
        if (hide) mode = GHOST_kGrabHide;
        else if (wrap) mode = GHOST_kGrabWrap;
-       if ((G.f & G_DEBUG) == 0) {
+       if ((G.debug & G_DEBUG) == 0) {
                if (win && win->ghostwin) {
                        const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
                        // Note: There is no tabletdata on Windows if no tablet device is connected.
@@ -204,7 +204,7 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
 
 void WM_cursor_ungrab(wmWindow *win)
 {
-       if ((G.f & G_DEBUG) == 0) {
+       if ((G.debug & G_DEBUG) == 0) {
                if (win && win->ghostwin) {
                        GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL);
                        win->grabcursor = GHOST_kGrabDisable;
index 2327ca46862dd556c9631ad42db8e8abce1e8641..42fb03d5d6480aec0fe9629074f58952737af4df 100644 (file)
@@ -213,13 +213,13 @@ void wm_event_do_notifiers(bContext *C)
                                if (note->category == NC_SCREEN) {
                                        if (note->data == ND_SCREENBROWSE) {
                                                ED_screen_set(C, note->reference);  // XXX hrms, think this over!
-                                               if (G.f & G_DEBUG)
-                                                       printf("screen set %p\n", note->reference);
+                                               if (G.debug & G_DEBUG_EVENTS)
+                                                       printf("%s: screen set %p\n", __func__, note->reference);
                                        }
                                        else if (note->data == ND_SCREENDELETE) {
                                                ED_screen_delete(C, note->reference);   // XXX hrms, think this over!
-                                               if (G.f & G_DEBUG)
-                                                       printf("screen delete %p\n", note->reference);
+                                               if (G.debug & G_DEBUG_EVENTS)
+                                                       printf("%s: screen delete %p\n", __func__, note->reference);
                                        }
                                }
                        }
@@ -482,7 +482,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int cal
        }
        
        if (retval & OPERATOR_FINISHED) {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG_WM) {
                        /* todo - this print may double up, might want to check more flags then the FINISHED */
                        wm_operator_print(C, op);
                }
@@ -544,7 +544,7 @@ static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
                        ED_undo_push_op(C, op);
        
        if (repeat == 0) {
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG_WM) {
                        char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
                        BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
                        MEM_freeN(buf);
@@ -754,7 +754,9 @@ int WM_operator_last_properties_init(wmOperator *op)
        if (op->type->last_properties) {
                PropertyRNA *iterprop;
 
-               if (G.f & G_DEBUG) printf("%s: loading previous properties for '%s'\n", __func__, op->type->idname);
+               if (G.debug & G_DEBUG_WM) {
+                       printf("%s: loading previous properties for '%s'\n", __func__, op->type->idname);
+               }
 
                iterprop = RNA_struct_iterator_property(op->type->srna);
 
@@ -792,7 +794,9 @@ int WM_operator_last_properties_store(wmOperator *op)
        }
 
        if (op->properties) {
-               if (G.f & G_DEBUG) printf("%s: storing properties for '%s'\n", __func__, op->type->idname);
+               if (G.debug & G_DEBUG_WM) {
+                       printf("%s: storing properties for '%s'\n", __func__, op->type->idname);
+               }
                op->type->last_properties = IDP_CopyProperty(op->properties);
                return TRUE;
        }
@@ -819,8 +823,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
                        WM_operator_last_properties_init(op);
                }
 
-               if ((G.f & G_DEBUG) && event && event->type != MOUSEMOVE)
-                       printf("handle evt %d win %d op %s\n", event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
+               if ((G.debug & G_DEBUG_EVENTS) && event && event->type != MOUSEMOVE) {
+                       printf("%s: handle evt %d win %d op %s\n", __func__, event ? event->type : 0, CTX_wm_screen(C)->subwinactive, ot->idname);
+               }
                
                if (op->type->invoke && event) {
                        wm_region_mouse_co(C, event);
@@ -1540,7 +1545,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa
                                                wm->op_undo_depth--;
 
                                        if (retval & OPERATOR_FINISHED)
-                                               if (G.f & G_DEBUG)
+                                               if (G.debug & G_DEBUG_WM)
                                                        wm_operator_print(C, handler->op);
 
                                        /* XXX check this carefully, CTX_wm_manager(C) == wm is a bit hackish */
@@ -1965,9 +1970,10 @@ void wm_event_do_handlers(bContext *C)
                while ( (event = win->queue.first) ) {
                        int action = WM_HANDLER_CONTINUE;
 
-                       if ((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))
-                               printf("pass on evt %d val %d\n", event->type, event->val); 
-                       
+                       if ((G.debug & G_DEBUG_EVENTS) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
+                               printf("%s: pass on evt %d val %d\n", __func__, event->type, event->val);
+                       }
+
                        wm_eventemulation(event);
 
                        CTX_wm_window_set(C, win);
index a9f17359573bc26b4f1609be4c2f4d7d0eca9143..39651cea3ab4b094a56f5fe3b73db677ab851045 100644 (file)
@@ -448,7 +448,7 @@ void WM_exit_ext(bContext *C, const short do_python)
        
 #ifdef WIN32   
        /* ask user to press enter when in debug mode */
-       if (G.f & G_DEBUG) {
+       if (G.debug & G_DEBUG) {
                printf("press enter key to exit...\n\n");
                getchar();
        }
index 94de4293a6eee2e0642545d3688c3e333d1acc18..123cc60e4fa0146ccc5ca9b102074fa145a75e0b 100644 (file)
@@ -1371,7 +1371,7 @@ static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), cons
        for (; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
                wmOperatorType *ot = BLI_ghashIterator_getValue(iter);
 
-               if ((ot->flag & OPTYPE_INTERNAL) && (G.f & G_DEBUG) == 0)
+               if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0)
                        continue;
 
                if (BLI_strcasestr(ot->name, str)) {
index 564fa963d6e9e058f30419fc2fc4e15b6a69b519..6ffb28ba0130ddf063d4590e47c786e9c211638c 100644 (file)
@@ -163,7 +163,10 @@ int wm_subwindow_open(wmWindow *win, rcti *winrct)
        win->curswin = swin = MEM_callocN(sizeof(wmSubWindow), "swinopen");
        BLI_addtail(&win->subwindows, swin);
        
-       if (G.f & G_DEBUG) printf("swin %d added\n", freewinid);
+       if (G.debug & G_DEBUG_EVENTS) {
+               printf("%s: swin %d added\n", __func__, freewinid);
+       }
+
        swin->swinid = freewinid;
        swin->winrct = *winrct;
 
index fd9d789ffd433bac1b286ab8374a8c48cbb5038c..031cfe90042a6e74fd095cb93410cea31e1e8c5e 100644 (file)
@@ -625,7 +625,9 @@ void wm_window_make_drawable(bContext *C, wmWindow *win)
 //             win->lmbut= 0;  /* keeps hanging when mousepressed while other window opened */
                
                wm->windrawable = win;
-               if (G.f & G_DEBUG) printf("set drawable %d\n", win->winid);
+               if (G.debug & G_DEBUG_EVENTS) {
+                       printf("%s: set drawable %d\n", __func__, win->winid);
+               }
                GHOST_ActivateWindowDrawingContext(win->ghostwin);
        }
 }
@@ -716,7 +718,9 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                break;
                        }
                        case GHOST_kEventWindowUpdate: {
-                               if (G.f & G_DEBUG) printf("ghost redraw\n");
+                               if (G.debug & G_DEBUG_EVENTS) {
+                                       printf("%s: ghost redraw %d\n", __func__, win->winid);
+                               }
                                
                                wm_window_make_drawable(C, win);
                                WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -765,29 +769,32 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                                win->posy = posy;
 
                                                /* debug prints */
-                                               if (0) {
+                                               if (G.debug & G_DEBUG_EVENTS) {
+                                                       const char *state_str;
                                                        state = GHOST_GetWindowState(win->ghostwin);
-       
+
                                                        if (state == GHOST_kWindowStateNormal) {
-                                                               if (G.f & G_DEBUG) printf("window state: normal\n");
+                                                               state_str = "normal";
                                                        }
                                                        else if (state == GHOST_kWindowStateMinimized) {
-                                                               if (G.f & G_DEBUG) printf("window state: minimized\n");
+                                                               state_str = "minimized";
                                                        }
                                                        else if (state == GHOST_kWindowStateMaximized) {
-                                                               if (G.f & G_DEBUG) printf("window state: maximized\n");
+                                                               state_str = "maximized";
                                                        }
                                                        else if (state == GHOST_kWindowStateFullScreen) {
-                                                               if (G.f & G_DEBUG) printf("window state: fullscreen\n");
+                                                               state_str = "fullscreen";
                                                        }
-                                                       
+                                                       else {
+                                                               state_str = "<unknown>";
+                                                       }
+
+                                                       printf("%s: window %d state = %s\n", __func__, win->winid, state_str);
+
                                                        if (type != GHOST_kEventWindowSize) {
-                                                               if (G.f & G_DEBUG) {
-                                                                       printf("win move event pos %d %d size %d %d\n",
-                                                                              win->posx, win->posy, win->sizex, win->sizey);
-                                                               }
+                                                               printf("win move event pos %d %d size %d %d\n",
+                                                                      win->posx, win->posy, win->sizex, win->sizey);
                                                        }
-                                                       
                                                }
                                        
                                                wm_window_make_drawable(C, win);
index c4da823381c319d40ab368ca9c6b2356a7d9794d..353fb6425c703133d1bf05a5f6c77e1423478bcf 100644 (file)
@@ -360,7 +360,7 @@ static int background_mode(int UNUSED(argc), const char **UNUSED(argv), void *UN
 
 static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
 {
-       G.f |= G_DEBUG;  /* std output printf's */
+       G.debug |= G_DEBUG;  /* std output printf's */
        printf(BLEND_VERSION_STRING_FMT);
        MEM_set_memory_debug();
 
@@ -372,19 +372,16 @@ static int debug_mode(int UNUSED(argc), const char **UNUSED(argv), void *data)
        return 0;
 }
 
-#ifdef WITH_LIBMV
-static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+static int debug_mode_generic(int UNUSED(argc), const char **UNUSED(argv), void *data)
 {
-       libmv_startDebugLogging();
-
+       G.debug |= GET_INT_FROM_POINTER(data);
        return 0;
 }
-#endif
 
-#ifdef WITH_FFMPEG
-static int debug_mode_ffmpeg(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
+#ifdef WITH_LIBMV
+static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
 {
-       G.f |= G_DEBUG_FFMPEG;
+       libmv_startDebugLogging();
 
        return 0;
 }
@@ -520,7 +517,7 @@ static int no_joystick(int UNUSED(argc), const char **UNUSED(argv), void *data)
         * failed joystick initialization delays over 5 seconds, before game engine start
         */
        SYS_WriteCommandLineInt(*syshandle, "nojoystick", 1);
-       if (G.f & G_DEBUG) printf("disabling nojoystick\n");
+       if (G.debug & G_DEBUG) printf("disabling nojoystick\n");
 #endif
 
        return 0;
@@ -1100,11 +1097,15 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
        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);
-
 #ifdef WITH_FFMPEG
-       BLI_argsAdd(ba, 1, NULL, "--debug-ffmpeg", "\n\tEnable debug messages from FFmpeg library", debug_mode_ffmpeg, NULL);
+       BLI_argsAdd(ba, 1, NULL, "--debug-ffmpeg", "\n\tEnable debug messages from FFmpeg library", debug_mode_generic, (void *)G_DEBUG_FFMPEG);
 #endif
+       BLI_argsAdd(ba, 1, NULL, "--debug-python", "\n\tEnable debug messages for python", debug_mode_generic, (void *)G_DEBUG_FFMPEG);
+       BLI_argsAdd(ba, 1, NULL, "--debug-events", "\n\tEnable debug messages for the event system", debug_mode_generic, (void *)G_DEBUG_EVENTS);
+       BLI_argsAdd(ba, 1, NULL, "--debug-wm",     "\n\tEnable debug messages for the window manager", debug_mode_generic, (void *)G_DEBUG_WM);
+       BLI_argsAdd(ba, 1, NULL, "--debug-all",    "\n\tEnable all debug messages (excludes libmv)", debug_mode_generic, (void *)G_DEBUG_ALL);
+
+       BLI_argsAdd(ba, 1, NULL, "--debug-fpe", "\n\tEnable floating point exceptions", set_fpe, NULL);
 
 #ifdef WITH_LIBMV
        BLI_argsAdd(ba, 1, NULL, "--debug-libmv", "\n\tEnable debug messages from libmv library", debug_mode_libmv, NULL);
index dd7126b294445dba82e692160280537e8a8d498f..4c1c6ae560443b7ca26f56f314add1f077150a0d 100644 (file)
@@ -147,7 +147,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
                        bmfont->glyphs[i].advance  = buffer[index++];
                        bmfont->glyphs[i].reserved = buffer[index++];
                        /* MAART:
-                       if (G.f & G_DEBUG) {
+                       if (G.debug & G_DEBUG) {
                                printfGlyph(&bmfont->glyphs[i]);
                        }
                        */
@@ -156,7 +156,7 @@ void readBitmapFontVersion0(ImBuf * ibuf, unsigned char * rect, int step)
                MEM_freeN(buffer);
                
                /* MAART:
-               if (G.f & G_DEBUG) {
+               if (G.debug & G_DEBUG) {
                        printf("Oldy = %d Newy = %d\n", ibuf->y, ibuf->y - ysize);
                        printf("glyphcount = %d\n", glyphcount);
                        printf("bytes = %d\n", bytes);
@@ -295,7 +295,7 @@ void matrixGlyph(ImBuf * ibuf, unsigned short unicode,
                                *advance = (float)(2.0 * bmfont->glyphs[index].advance / (float) bmfont->glyphs[0].advance);
 
                                // printfGlyph(&bmfont->glyphs[index]);
-                               // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f \n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
+                               // printf("%c %d %0.5f %0.5f %0.5f %0.5f %0.5f\n", unicode, index, *sizex, *sizey, *transx, *transy, *advance);
                        }
                }
        }
index 641f1f8d194624ae2c7a22b30535a2b1ff46f579..b5e165a58ec2b7ae484cc7211c16b95cb3c96676 100644 (file)
@@ -232,7 +232,7 @@ void usage(const char* program, bool isBlenderPlayer)
        printf("             sphericalpanoramic     (Spherical Panoramic)\n");
        printf("                             depending on the type of dome you are using\n\n");
        printf("  -m: maximum anti-aliasing (eg. 2,4,8,16)\n\n");
-       printf("  -i: parent windows ID \n\n");
+       printf("  -i: parent windows ID\n\n");
 #ifdef _WIN32
        printf("  -c: keep console window open\n\n");
 #endif
@@ -527,7 +527,7 @@ int main(int argc, char** argv)
 
                        case 'd':
                                i++;
-                               G.f |= G_DEBUG;     /* std output printf's */
+                               G.debug |= G_DEBUG;     /* std output printf's */
                                MEM_set_memory_debug();
                                break;
 
index 2368ff97a149bfacb86c15252969fa3ac4755265..22f96eb72979121ec05fc722c6929405242efeff 100644 (file)
@@ -287,7 +287,7 @@ bool KX_NavMeshObject::BuildNavMesh()
 
        if (GetMeshCount()==0)
        {
-               printf("Can't find mesh for navmesh object: %s \n", m_name.ReadPtr());
+               printf("Can't find mesh for navmesh object: %s\n", m_name.ReadPtr());
                return false;
        }
 
@@ -299,7 +299,7 @@ bool KX_NavMeshObject::BuildNavMesh()
                                                        dmeshes, dvertices, ndvertsuniq, dtris, ndtris, vertsPerPoly ) 
                        || vertsPerPoly<3)
        {
-               printf("Can't build navigation mesh data for object:%s \n", m_name.ReadPtr());
+               printf("Can't build navigation mesh data for object:%s\n", m_name.ReadPtr());
                return false;
        }