diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-17 16:49:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-17 16:49:09 +0300 |
commit | bcc4957877e9f32601eee3ed2c27f1ef4450aca5 (patch) | |
tree | 0ce3bcc2ec3bbf112c180a341025b09dc48a9891 | |
parent | 0b79c5ed291eff8dc82e49502665829560b86f8e (diff) |
Flush stdout prior of calling render stats callback
Without this extra flush order of stat prints is undefined in the
output. which makes it rather tricky to write custom output in a
reliable way.
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 001120d883f..e2f82cb59ca 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -193,6 +193,9 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs) fprintf(stdout, IFACE_("Sce: %s Ve:%d Fa:%d La:%d"), rs->scene_name, rs->totvert, rs->totface, rs->totlamp); } + /* Flush stdout to be sure python callbacks are printing stuff after blender. */ + fflush(stdout); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS); fputc('\n', stdout); @@ -3436,7 +3439,10 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie BLI_timestr(re->i.lastframetime, name, sizeof(name)); printf(" Time: %s", name); - + + /* Flush stdout to be sure python callbacks are printing stuff after blender. */ + fflush(stdout); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS); BLI_timestr(re->i.lastframetime - render_time, name, sizeof(name)); |