diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-31 04:59:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-31 04:59:17 +0400 |
commit | 5b88712ff932fcbcd0bb0fb257e8e9c2e247a82a (patch) | |
tree | ca0f15ee78fee5aef80ebf5c0f9f46529b65a9e2 /source/blender/blenkernel | |
parent | ebb229110e4af5d2df5613b6345da2f602b90092 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 15 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 34 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/bmfont.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 28 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 24 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fmodifier.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 62 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 13 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ocean.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 36 |
18 files changed, 154 insertions, 141 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 80c9244d232..5f230e5fad9 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -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) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index a03bcb1fde9..0041553ec44 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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; 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) : "<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; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index bb52af86e00..f111640145f 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -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); } } } diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index 278dbe30a95..04ac6cbfb4c 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -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); } } } diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 8177d09c7e3..0a6e8a163cc 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -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; diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index a1a2465ceac..dd8471f0a1f 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -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); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 5f1201ec378..bb8cfe37a88 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -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; diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index 693c036d124..bbd07693cea 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -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; } diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index adbc0f03528..811cb881f6e 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -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 */ } } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index c454acd7c81..51c4caa1cf4 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -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"); } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 2dcfb744cd2..3c6c3f8c232 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -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--; + } } } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 9c8bda97435..56fec119cce 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -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; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index cc5e59a6e92..c62653b29e7 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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) { diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index ae13613fc14..907de7888cb 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -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); } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 445e34e43c7..aadd9d675b0 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -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); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 76195c29fb3..a383fac07c9 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -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; } diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 4206c9921df..dc7a211a3c1 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -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); } } |