/* try to insert keyframes for the channels specified by KeyingSet */
success= modify_keyframes(scene, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra);
if (G.f & G_DEBUG)
- printf("KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success);
+ BKE_reportf(op->reports, RPT_INFO, "KeyingSet '%s' - Successfully added %d Keyframes \n", ks->name, success);
/* report failure or do updates? */
if (success) {
}
}
- printf("Ob '%s' - Successfully removed %d keyframes \n", id->name+2, success);
+ BKE_reportf(op->reports, RPT_INFO, "Ob '%s' - Successfully removed %d keyframes \n", id->name+2, success);
ob->recalc |= OB_RECALC_OB;
}
if (fBone->parent==eBone)
fBone->parent= eBone->parent;
}
- printf("Warning: removed zero sized bone: %s\n", eBone->name);
+ if (G.f & G_DEBUG)
+ printf("Warning: removed zero sized bone: %s\n", eBone->name);
bone_free(arm, eBone);
}
}
}
else {
// FIXME.. figure out a method for multiple bones
- BKE_report(op->reports, RPT_ERROR, "Too many points selected");
- printf("Points selected: %d \n", count);
+ BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d \n", count);
BLI_freelistN(&points);
return OPERATOR_CANCELLED;
}
/* check if same bone */
if (start == end) {
- printf("Error: same bone! \n");
- printf("\tstart = %s, end = %s \n", start->name, end->name);
+ if (G.f & G_DEBUG) {
+ printf("Error: same bone! \n");
+ printf("\tstart = %s, end = %s \n", start->name, end->name);
+ }
}
/* step 1: add a new bone
if (pld->act->markers.first) {
/* just use first one then... */
pld->marker= pld->act->markers.first;
- if (pose_index > -2) printf("PoseLib had no active pose\n");
+ if (pose_index > -2)
+ BKE_report(op->reports, RPT_WARNING, "PoseLib had no active pose");
}
else {
BKE_report(op->reports, RPT_ERROR, "PoseLib has no poses to preview/apply");
}
}
if(newu==0 || newv==0) {
- printf("Can't duplicate Nurb\n");
+ if (G.f & G_DEBUG)
+ printf("Can't duplicate Nurb\n");
}
else {
if( (line= ui_is_a_link(from, to)) ) {
line->flag |= UI_SELECT;
ui_delete_active_linkline(from->block);
- printf("already exists, means deletion now\n");
return;
}
if (from->type==INLINK && to->type==INLINK) {
- printf("cannot link\n");
return;
}
else if (from->type==LINK && to->type==INLINK) {
if( from->link->tocode != (int)to->hardmin ) {
- printf("cannot link\n");
return;
}
}
else if(from->type==INLINK && to->type==LINK) {
if( to->link->tocode == (int)from->hardmin ) {
- printf("cannot link\n");
return;
}
}
#include "DNA_userdef_types.h"
#include "BKE_context.h"
+#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_icons.h"
#include "BKE_utildefines.h"
if (BLI_exists(iconfilestr)) {
bbuf = IMB_loadiffname(iconfilestr, IB_rect);
if(bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H) {
- printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
+ if (G.f & G_DEBUG)
+ printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
IMB_freeImBuf(bbuf);
bbuf= NULL;
}
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("UI_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
+ if (G.f & G_DEBUG)
+ printf("UI_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id);
return 0;
}
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("UI_icon_get_height: Internal error, no icon for icon ID: %d\n", icon_id);
+ if (G.f & G_DEBUG)
+ printf("UI_icon_get_height: Internal error, no icon for icon ID: %d\n", icon_id);
return 0;
}
unsigned int size = preview_render_size(miplevel);
if (!prv_img) {
- printf("Error: requested preview image does not exist");
+ if (G.f & G_DEBUG)
+ printf("Error: requested preview image does not exist");
}
if (!prv_img->rect[miplevel]) {
prv_img->w[miplevel] = size;
static void icon_set_image(bContext *C, ID *id, PreviewImage* prv_img, int miplevel)
{
if (!prv_img) {
- printf("No preview image for this ID: %s\n", id->name);
+ if (G.f & G_DEBUG)
+ printf("No preview image for this ID: %s\n", id->name);
return;
}
/* draw */
if((w<1 || h<1)) {
// XXX - TODO 2.5 verify whether this case can happen
- // and only print in debug
- printf("what the heck! - icons are %i x %i pixels?\n", w, h);
+ if (G.f & G_DEBUG)
+ printf("what the heck! - icons are %i x %i pixels?\n", w, h);
}
/* rect contains image in 'rendersize', we only scale if needed */
else if(rw!=w && rh!=h) {
if(w>2000 || h>2000) { /* something has gone wrong! */
- printf("insane icon size w=%d h=%d\n",w,h);
+ if (G.f & G_DEBUG)
+ printf("insane icon size w=%d h=%d\n",w,h);
}
else {
ImBuf *ima;
icon = BKE_icon_get(icon_id);
if (!icon) {
- printf("icon_draw_mipmap: Internal error, no icon for icon ID: %d\n", icon_id);
+ if (G.f & G_DEBUG)
+ printf("icon_draw_mipmap: Internal error, no icon for icon ID: %d\n", icon_id);
return;
}
font->blf_id= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
}
- if (font->blf_id == -1)
- printf("uiStyleInit error, no fonts available\n");
+ if (font->blf_id == -1) {
+ if (G.f & G_DEBUG)
+ printf("uiStyleInit error, no fonts available\n");
+ }
else {
BLF_set(font->blf_id);
/* ? just for speed to initialize?
height -= V2D_SCROLL_HEIGHT;
if (ELEM3(0, v2d, width, height)) {
- printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", v2d, width, height); // XXX temp debug info
+ if (G.f & G_DEBUG)
+ printf("Error: View2D totRect set exiting: v2d=%p width=%d height=%d \n", v2d, width, height); // XXX temp debug info
return;
}
else if( convex(neweve[0]->co, neweve[3]->co, neweve[1]->co, neweve[2]->co) ) {
efa= addfacelist(em, neweve[0], neweve[3], neweve[1], neweve[2], NULL, NULL);
}
- else printf("cannot find nice quad from concave set of vertices\n");
+ else BKE_report(op->reports, RPT_ERROR, "cannot find nice quad from concave set of vertices");
+
}
}
}
if(efa->e3->fgoni) index= efa->e3->fgoni;
if(efa->v4 && efa->e4->fgoni) index= efa->e4->fgoni;
- if(index==0) printf("wrong fgon select\n");
+ if((index==0) && (G.f & G_DEBUG))printf("wrong fgon select\n");
// select all ngon faces with index
for(efa= em->faces.first; efa; efa= efa->next) {
if (isect!=0.0f) eed->f2= 1;
else eed->f2=0;
eed->tmp.fp= isect;
- //printf("isect=%i\n", isect);
}
else {
eed->f2=0;
armature_rebuild_pose(ob, ob->data);
break;
default:
- printf("ERROR single_obdata_users: can't copy %s\n", id->name);
+ if (G.f & G_DEBUG)
+ printf("ERROR single_obdata_users: can't copy %s\n", id->name);
return;
}
BLI_snprintf(name, 32, "%s_copy", dg->name);
while(get_named_vertexgroup(ob, name)) {
if((strlen(name) + 6) > 32) {
- printf("Internal error: the name for the new vertex group is > 32 characters");
+ if (G.f & G_DEBUG)
+ printf("Internal error: the name for the new vertex group is > 32 characters");
return;
}
strcpy(s, name);
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
#include "BKE_cdderivedmesh.h"
+#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree);
if(nearest.index == -1) {
- printf("No nearest point found for hair root!");
+ if (G.f & G_DEBUG)
+ printf("No nearest point found for hair root!");
continue;
}
if(count!=4) {
/* let's stop adding regions */
BLI_init_rcti(remainder, 0, 0, 0, 0);
- printf("region quadsplit failed\n");
+ if (G.f & G_DEBUG)
+ printf("region quadsplit failed\n");
}
else quad= 1;
}
for(old= sc->areabase.first; old; old= old->next)
if(old->full) break;
if(old==NULL) {
- printf("something wrong in areafullscreen\n");
+ if (G.f & G_DEBUG)
+ printf("something wrong in areafullscreen\n");
return NULL;
}
// old feature described below (ton)
#endif
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
- printf("executed header region flip\n");
return OPERATOR_FINISHED;
}
/* very weak... but 512 characters is quite safe */
if(spos >= str+IMA_RW_MAXTEXT)
- printf("WARNING! renderwin text beyond limit \n");
+ if (G.f & G_DEBUG)
+ printf("WARNING! renderwin text beyond limit \n");
}
if(ibuf) {
if(BKE_imtype_is_movie(scene->r.imtype)) {
ok= oglrender->mh->append_movie(&scene->r, CFRA, (int*)ibuf->rect, oglrender->sizex, oglrender->sizey, oglrender->reports);
- if(ok)
+ if(ok) {
printf("Append frame %d", scene->r.cfra);
+ BKE_reportf(op->reports, RPT_INFO, "Appended frame: %d", scene->r.cfra);
+ }
}
else {
BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION);
ok= BKE_write_ibuf(scene, ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality);
- if(ok==0) printf("write error: cannot save %s\n", name);
- else printf("saved: %s", name);
+ if(ok==0) {
+ printf("Write error: cannot save %s\n", name);
+ BKE_reportf(op->reports, RPT_ERROR, "Write error: cannot save %s", name);
+ }
+ else {
+ printf("Saved: %s", name);
+ BKE_reportf(op->reports, RPT_INFO, "Saved file: %s", name);
+ }
}
}
if(sj->dumprect) {
if(mh) {
- if(mh->append_movie(&rd, cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy, &sj->reports))
- printf("Append frame %d\n", cfra);
- else
+ if(mh->append_movie(&rd, cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy, &sj->reports)) {
+ BKE_reportf(&sj->reports, RPT_INFO, "Appended frame: %d", cfra);
+ printf("Appended frame %d\n", cfra);
+ } else
break;
}
else {
if(ok==0) {
printf("Write error: cannot save %s\n", name);
+ BKE_reportf(&sj->reports, RPT_INFO, "Write error: cannot save %s\n", name);
break;
}
- else printf("Saved: %s\n", name);
+ else {
+ printf("Saved file: %s\n", name);
+ BKE_reportf(&sj->reports, RPT_INFO, "Saved file: %s", name);
+ }
/* imbuf knows which rects are not part of ibuf */
IMB_freeImBuf(ibuf);
if(mh)
mh->end_movie();
- printf("screencast job stopped\n");
+
+ BKE_report(&sj->reports, RPT_INFO, "Screencast job stopped");
}
static int screencast_exec(bContext *C, wmOperator *op)
break;
}
- printf("Saved: %s\n", ibuf->name);
+ BKE_reportf(op->reports, RPT_INFO, "Saved: %s\n", ibuf->name);
ibuf->userflags &= ~IB_BITMAPDIRTY;
}
}
/* but lets check it anyway */
if(ma->nodetree) {
- printf("error in shader initialize\n");
+ if (G.f & G_DEBUG)
+ printf("error in shader initialize\n");
return;
}
/* but lets check it anyway */
if(sce->nodetree) {
- printf("error in composit initialize\n");
+ if (G.f & G_DEBUG)
+ printf("error in composite initialize\n");
return;
}
/* but lets check it anyway */
if(tx->nodetree) {
- printf("error in texture initialize\n");
+ if (G.f & G_DEBUG)
+ printf("error in texture initialize\n");
return;
}
max+= BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
if(max<320) strcat(defstr, str);
}
- else printf("oh no!\n");
+
if(tfp->curdef==dvert->dw[i].def_nr) {
init= 0;
tfp->defweightp= &dvert->dw[i].weight;
if(lastop) {
int retval;
- printf("operator redo %s\n", lastop->type->name);
+ if (G.f & G_DEBUG)
+ printf("operator redo %s\n", lastop->type->name);
ED_undo_pop(C);
retval= WM_operator_repeat(C, lastop);
if((retval & OPERATOR_FINISHED)==0) {
- printf("operator redo failed %s\n", lastop->type->name);
+ if (G.f & G_DEBUG)
+ printf("operator redo failed %s\n", lastop->type->name);
ED_undo_redo(C);
}
}
if(lastop) {
int retval;
- printf("operator redo %s\n", lastop->type->name);
+ if (G.f & G_DEBUG)
+ printf("operator redo %s\n", lastop->type->name);
ED_undo_pop_op(C, lastop);
retval= WM_operator_repeat(C, lastop);
if((retval & OPERATOR_FINISHED)==0) {
- printf("operator redo failed %s\n", lastop->type->name);
+ if (G.f & G_DEBUG)
+ printf("operator redo failed %s\n", lastop->type->name);
ED_undo_redo(C);
}
}