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:
authorCampbell Barton <ideasman42@gmail.com>2011-08-31 14:43:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-31 14:43:22 +0400
commitfde215025eff7f3581435bfdb90fb9d354538d07 (patch)
tree00769a9db2b382d8ce08e6b622b450bdb5f63d3f /source/blender/blenlib
parentd0d82c69e96e96845a59ad625900a94187dac621 (diff)
patch [#28218] During-render callback functionality
from Jesse Kaukonen (gekko) --- text from the patch. Recently Campbell Barton added callback functionality for Python's usage, but this only includes pre- and post-render callbacks. There are no callbacks for the duration of the render. This patch adds the few lines required for executing a callback while Blender Render is working. The callback resides in the rendering pipeline stats function, so whenever statistics are printed, the callback is executed. This functionality is required if one wants to: 1) Observe what is happening while Blender is rendering via the command line 2) Add custom statistics that Blender prints while the renderer works 3) The user wants to continue executing his Python script without the code halting at bpy.ops.render.render() Personally I'm currently using this for printing out more detailed progress reports at Renderfarm.fi (such as CPU time, time spent rendering, total progress in regards to the entire rendering process). Tested on Windows, Linux and OS X. Example on how to use the callback: def statscall(context): print("Thanks for calling!") bpy.app.handlers.render_stats.append(statscall) bpy.ops.render.render(animation=False, write_still=True)
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_callbacks.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h
index 1735848e774..f20cef9c3ea 100644
--- a/source/blender/blenlib/BLI_callbacks.h
+++ b/source/blender/blenlib/BLI_callbacks.h
@@ -42,6 +42,7 @@ struct ID;
typedef enum {
BLI_CB_EVT_RENDER_PRE,
BLI_CB_EVT_RENDER_POST,
+ BLI_CB_EVT_RENDER_STATS,
BLI_CB_EVT_LOAD_PRE,
BLI_CB_EVT_LOAD_POST,
BLI_CB_EVT_SAVE_PRE,