Added printing stats back in commandline renders. Prints now a full 'log',

using 1 line per part rendered. Might go back to 1 line again, but at this
moment I need the logs for debugging.
Same prints are active now for UI rendering. Just temporal :)
This commit is contained in:
2006-02-15 15:22:49 +00:00
parent 9ef9d66a26
commit 8d0a2c4192
3 changed files with 64 additions and 15 deletions

View File

@@ -812,6 +812,7 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
duplicatelist(&nnode->outputs, &node->outputs);
for(sock= nnode->outputs.first; sock; sock= sock->next) {
sock->own_index= 0;
sock->stack_index= 0;
sock->ns.data= NULL;
}
@@ -942,6 +943,10 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree, int internal_select)
newtree->owntype->outputs= MEM_dupallocN(ntree->owntype->outputs);
}
}
/* weird this is required... there seem to be link pointers wrong still? */
/* anyhoo, doing this solves crashes on copying entire tree (copy scene) and delete nodes */
ntreeSolveOrder(newtree);
return newtree;
}
@@ -1824,8 +1829,10 @@ static int setExecutableNodes(bNodeTree *ntree, ThreadData *thd)
/* test the inputs */
for(a=0, sock= node->inputs.first; sock; sock= sock->next, a++) {
/* skip viewer nodes in bg render */
if(node->type==CMP_NODE_VIEWER && G.background);
/* is sock in use? */
if(sock->link) {
else if(sock->link) {
if(nsin[a]->data==NULL || sock->link->fromnode->need_exec) {
node->need_exec= 1;
break;
@@ -1927,7 +1934,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview)
ntree->timecursor(totnode);
if(ntree->stats_draw) {
char str[64];
sprintf(str, "Compositing %d %s\n", totnode, node->name);
sprintf(str, "Compositing %d %s", totnode, node->name);
ntree->stats_draw(str);
}
totnode--;

View File

@@ -121,6 +121,29 @@ static void int_nothing(int val) {}
static int void_nothing(void) {return 0;}
static void print_error(const char *str) {printf("ERROR: %s\n", str);}
static void stats_background(RenderStats *rs)
{
extern int mem_in_use;
float megs_used_memory= mem_in_use/(1024.0*1024.0);
char str[400], *spos= str;
if(rs->convertdone) {
spos+= sprintf(spos, "Fra:%d Mem:%.2fM ", G.scene->r.cfra, megs_used_memory);
if(rs->infostr) {
spos+= sprintf(spos, " | %s", rs->infostr);
}
else {
if(rs->tothalo)
spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", G.scene->id.name+2, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
else
spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d La:%d", G.scene->id.name+2, rs->totvert, rs->totface, rs->totlamp);
}
printf(str); printf("\n");
}
}
static void free_render_result(RenderResult *res)
{
if(res==NULL) return;
@@ -442,6 +465,9 @@ Render *RE_NewRender(const char *name)
re->test_break= void_nothing;
re->test_return= void_nothing;
re->error= print_error;
if(G.background)
re->stats_draw= stats_background;
else
re->stats_draw= stats_nothing;
/* init some variables */
@@ -717,7 +743,7 @@ static void print_part_stats(Render *re, RenderPart *pa)
{
char str[64];
sprintf(str, "Part %d-%d\n", pa->nr, re->i.totpart);
sprintf(str, "Part %d-%d", pa->nr, re->i.totpart);
re->i.infostr= str;
re->stats_draw(&re->i);
re->i.infostr= NULL;

View File

@@ -845,7 +845,6 @@ static void printrenderinfo_cb(RenderStats *rs)
if(rs->infostr)
spos+= sprintf(spos, " | %s", rs->infostr);
if(render_win) {
if(render_win->render_text) MEM_freeN(render_win->render_text);
render_win->render_text= BLI_strdup(str);
glDrawBuffer(GL_FRONT);
@@ -853,7 +852,24 @@ static void printrenderinfo_cb(RenderStats *rs)
glFlush();
glDrawBuffer(GL_BACK);
}
/* temporal render debug printing, needed for testing orange renders atm... will be gone soon (or option) */
if(rs->convertdone) {
spos= str;
spos+= sprintf(spos, "Fra:%d Mem:%.2fM ", G.scene->r.cfra, megs_used_memory);
if(rs->infostr) {
spos+= sprintf(spos, " | %s", rs->infostr);
}
else {
if(rs->tothalo)
spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d Ha:%d La:%d", G.scene->id.name+2, rs->totvert, rs->totface, rs->tothalo, rs->totlamp);
else
spos+= sprintf(spos, "Sce: %s Ve:%d Fa:%d La:%d", G.scene->id.name+2, rs->totvert, rs->totface, rs->totlamp);
}
printf(str); printf("\n");
}
}
/* -------------- callback system to allow ESC from rendering ----------------------- */