From 5b88712ff932fcbcd0bb0fb257e8e9c2e247a82a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 31 Mar 2012 00:59:17 +0000 Subject: move debug flag into its own global var (G.debug), split up debug options. --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. --- source/blender/blenkernel/intern/anim_sys.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'source/blender/blenkernel/intern/anim_sys.c') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 552c4c4e82b..fc58799eb18 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -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) : "", 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) : "", 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; -- cgit v1.2.3