Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/modules/addon_utils.py6
-rw-r--r--release/scripts/modules/bpy/utils.py6
-rw-r--r--release/scripts/modules/console_python.py2
-rw-r--r--source/blender/blenfont/intern/blf_lang.c8
-rw-r--r--source/blender/blenkernel/BKE_global.h15
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c34
-rw-r--r--source/blender/blenkernel/intern/blender.c7
-rw-r--r--source/blender/blenkernel/intern/bmfont.c6
-rw-r--r--source/blender/blenkernel/intern/constraint.c6
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c28
-rw-r--r--source/blender/blenkernel/intern/fcurve.c24
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c8
-rw-r--r--source/blender/blenkernel/intern/gpencil.c4
-rw-r--r--source/blender/blenkernel/intern/ipo.c62
-rw-r--r--source/blender/blenkernel/intern/library.c13
-rw-r--r--source/blender/blenkernel/intern/nla.c8
-rw-r--r--source/blender/blenkernel/intern/object.c4
-rw-r--r--source/blender/blenkernel/intern/ocean.c12
-rw-r--r--source/blender/blenkernel/intern/particle_system.c8
-rw-r--r--source/blender/blenkernel/intern/pointcache.c18
-rw-r--r--source/blender/blenkernel/intern/softbody.c36
-rw-r--r--source/blender/blenlib/intern/path_util.c2
-rw-r--r--source/blender/blenloader/intern/readblenentry.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c14
-rw-r--r--source/blender/collada/AnimationImporter.cpp2
-rw-r--r--source/blender/collada/DocumentImporter.cpp12
-rw-r--r--source/blender/collada/ImageExporter.cpp2
-rw-r--r--source/blender/collada/MeshImporter.cpp2
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c18
-rw-r--r--source/blender/editors/animation/anim_filter.c8
-rw-r--r--source/blender/editors/animation/anim_markers.c2
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c6
-rw-r--r--source/blender/editors/animation/keyframes_draw.c4
-rw-r--r--source/blender/editors/animation/keyframing.c36
-rw-r--r--source/blender/editors/armature/editarmature.c10
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c2
-rw-r--r--source/blender/editors/armature/reeb.c4
-rw-r--r--source/blender/editors/curve/editcurve.c2
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c76
-rw-r--r--source/blender/editors/interface/interface_anim.c4
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/interface/interface_icons.c10
-rw-r--r--source/blender/editors/interface/interface_ops.c2
-rw-r--r--source/blender/editors/interface/interface_style.c2
-rw-r--r--source/blender/editors/interface/view2d.c4
-rw-r--r--source/blender/editors/object/object_constraint.c6
-rw-r--r--source/blender/editors/object/object_relations.c4
-rw-r--r--source/blender/editors/physics/particle_edit.c4
-rw-r--r--source/blender/editors/physics/particle_object.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c8
-rw-r--r--source/blender/editors/render/render_internal.c4
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/screen/screen_edit.c10
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c8
-rw-r--r--source/blender/editors/space_action/action_select.c2
-rw-r--r--source/blender/editors/space_graph/graph_edit.c2
-rw-r--r--source/blender/editors/space_nla/nla_channels.c8
-rw-r--r--source/blender/editors/space_nla/nla_edit.c2
-rw-r--r--source/blender/editors/space_nla/nla_select.c2
-rw-r--r--source/blender/editors/space_node/node_edit.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/util/editmode_undo.c4
-rw-r--r--source/blender/editors/util/undo.c10
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c6
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c4
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c4
-rw-r--r--source/blender/imbuf/intern/tiff.c2
-rw-r--r--source/blender/imbuf/intern/util.c2
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c2
-rw-r--r--source/blender/makesdna/intern/makesdna.c10
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c2
-rw-r--r--source/blender/makesrna/intern/rna_screen.c2
-rw-r--r--source/blender/nodes/composite/node_composite_tree.c2
-rw-r--r--source/blender/python/intern/bpy_app.c23
-rw-r--r--source/blender/python/intern/bpy_interface.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c6
-rw-r--r--source/blender/python/intern/bpy_rna_array.c2
-rw-r--r--source/blender/render/intern/raytrace/rayobject_octree.cpp4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_vbvh.cpp2
-rw-r--r--source/blender/render/intern/raytrace/reorganize.h2
-rw-r--r--source/blender/render/intern/raytrace/svbvh.h2
-rw-r--r--source/blender/render/intern/source/convertblender.c6
-rw-r--r--source/blender/render/intern/source/volume_precache.c10
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c34
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
-rw-r--r--source/blender/windowmanager/intern/wm_subwindow.c5
-rw-r--r--source/blender/windowmanager/intern/wm_window.c35
-rw-r--r--source/creator/creator.c27
-rw-r--r--source/gameengine/GamePlayer/common/bmfont.cpp6
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_NavMeshObject.cpp4
98 files changed, 452 insertions, 409 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 2b1616a0022..588c10eea54 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -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)
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index 63ba213f9b1..2824d6245e5 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -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
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py
index 6c49283b3e1..d4e45ece9fa 100644
--- a/release/scripts/modules/console_python.py
+++ b/release/scripts/modules/console_python.py
@@ -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
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index ee825b8179d..035aa732537 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -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
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);
}
}
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 2bbc4517da1..df711150b97 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -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;
}
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 6f138d5df23..ccf0c226570 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -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");
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d8a874872b4..0780a7b6292 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -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);
}
}
}
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 3f132eb4212..e0079fbb8a0 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -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;
}
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 18e421779cc..bc0606107ab 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -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;
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index 3775a63c71d..946effda832 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -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");
}
}
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 1c83f0c4081..5c01c31bd0d 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -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
}
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index aa15d53abe6..fb6a65a585f 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -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 */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index a17d15d144f..5729ee79cef 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -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;
}
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 86e3c8050c2..73dba91207f 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -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;
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index d19a137a6a8..d5ec98da588 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -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 */
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 146aea401ec..0e0ff0defbb 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -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 */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index ba413fda00c..47972ca2c6f 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -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);
}
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 0d93f9401a3..a09722f78b6 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -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);
}
}
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index 261018329ab..f554b7b1c50 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -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;
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c
index 30f929c9603..546bcb1f40f 100644
--- a/source/blender/editors/armature/reeb.c
+++ b/source/blender/editors/armature/reeb.c
@@ -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));
}
}
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index aeab4f27179..a5188ea769e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -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 {
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 528991e31f0..8f0ea378a2a 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -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);
}
}
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 62e2e62b880..263c842ed08 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -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);
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 20111fc66b2..c366de6fa43 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -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 {
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 955d564e111..c7f8ad521fa 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -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;
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 420cae87851..887ae250c1b 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -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);
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 24881c034f4..d028fcd93ae 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -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;
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 34116f24901..ebaef26082f 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -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);
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 91e3b99e23b..5d527667170 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -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 {
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 5c05e9d2ba1..7eac3050b97 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -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;
}
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 5b2aaf30897..ec3567454df 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -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))
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index a6fb946c83f..57d0de522a1 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -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;
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index bf3a9fff4e2..53e0e2b4056 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -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);
}
}
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 1e71cf61817..3d50ec26a40 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -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;
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 23765b03d35..6a074a542c3 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -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)) {
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 97fd80fc946..47a4c376f96 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -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");
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 8f429321fbb..43b917c2186 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -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;
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 9deb64ef60a..1b56feb09d1 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -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;
}
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index f0dbdf18826..e427e1e21cf 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -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);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index f553084cfd9..9cf8cc21996 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -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++) {
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index fbf83dd8df5..65bcfcb7024 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -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;
}
}
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 630bb75ed5d..f76f5f6523e 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -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;
}
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index c0cd2a882c8..76a2c926522 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -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;
}
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index c242a1c1323..1d323cb6a4f 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -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 */
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 0c2dc7493e2..1a94b1160be 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -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) {
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 1434bd8ddc2..b0cd59ea7ad 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -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;
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index d95947142f9..cf2b3730462 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -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;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 258debc8e60..6d76da3b0e0 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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);
}
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 8849a9af9c0..ac0f8306259 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -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);
}
}
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 62d761238e4..ac264c1a6af 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -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");
}
}
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 76291aef584..14d6428bf50 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -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;
}
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 846ee2850be..40e6a8b2a35 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -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);
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index c1222d3cea3..a7d168d42a2 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -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;
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index 3fbeb6a957d..f81fb740ff0 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -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);
}
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index c21c58a114a..9c5b39e180d 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -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 {
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 5e4c244dbc2..ef7a2746d37 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -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;
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index bd04698107c..ae6432dcbe4 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -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");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index ac199e67a1b..c7eeb633e25 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -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;
}
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index 7a43c8cb770..67a4bafb8ee 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -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;
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c
index b60e962f534..7bd0d03322d 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -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);
}
}
}
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index aab1f508e32..44979700d94 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -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},
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 61b3f7b1575..7b362e56c73 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -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);
}
}
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 1f284ae01cb..7af53b489bd 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -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;
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index 8d8219df188..5c59c1e620a 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -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;
diff --git a/source/blender/render/intern/raytrace/rayobject_octree.cpp b/source/blender/render/intern/raytrace/rayobject_octree.cpp
index 197b3f14c7a..ea1d5c2573c 100644
--- a/source/blender/render/intern/raytrace/rayobject_octree.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_octree.cpp
@@ -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)
diff --git a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
index 84395a9ad50..e82623f1da9 100644
--- a/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
+++ b/source/blender/render/intern/raytrace/rayobject_vbvh.cpp
@@ -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);
diff --git a/source/blender/render/intern/raytrace/reorganize.h b/source/blender/render/intern/raytrace/reorganize.h
index be131100021..68b2b22ecdd 100644
--- a/source/blender/render/intern/raytrace/reorganize.h
+++ b/source/blender/render/intern/raytrace/reorganize.h
@@ -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;
diff --git a/source/blender/render/intern/raytrace/svbvh.h b/source/blender/render/intern/raytrace/svbvh.h
index fba9bb9ad41..e0e96781f36 100644
--- a/source/blender/render/intern/raytrace/svbvh.h
+++ b/source/blender/render/intern/raytrace/svbvh.h
@@ -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++)
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index ff6f83cc946..b8935b5f960 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -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;
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index bd01c75ef3f..bb3ef082500 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -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;
}
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 80a25913481..f97391c0d6e 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -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;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 2327ca46862..42fb03d5d64 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -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);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index a9f17359573..39651cea3ab 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -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();
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 94de4293a6e..123cc60e4fa 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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)) {
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c
index 564fa963d6e..6ffb28ba013 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -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;
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index fd9d789ffd4..031cfe90042 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -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);
diff --git a/source/creator/creator.c b/source/creator/creator.c
index c4da823381c..353fb6425c7 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -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);
diff --git a/source/gameengine/GamePlayer/common/bmfont.cpp b/source/gameengine/GamePlayer/common/bmfont.cpp
index dd7126b2944..4c1c6ae5604 100644
--- a/source/gameengine/GamePlayer/common/bmfont.cpp
+++ b/source/gameengine/GamePlayer/common/bmfont.cpp
@@ -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);
}
}
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 641f1f8d194..b5e165a58ec 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -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;
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
index 2368ff97a14..22f96eb7297 100644
--- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp
+++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp
@@ -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;
}