blender/source
Campbell Barton fde215025e 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)
2011-08-31 10:43:22 +00:00
..
blender patch [#28218] During-render callback functionality 2011-08-31 10:43:22 +00:00
blenderplayer * Merge trunk up to r39790. 2011-08-30 08:22:03 +00:00
creator FFmpeg library update: 2011-08-22 18:49:42 +00:00
darwin set svn end of lines to native 2011-05-09 08:15:38 +00:00
gameengine BGE: Adding two new functions to bge.render to allow users to change the anisotropic filtering level used by textures: 2011-08-31 05:51:51 +00:00
icons set svn end of lines to native 2011-05-09 08:15:38 +00:00
tests use static sets rather then tuples, python optimizes this case. 2011-08-08 05:21:37 +00:00
CMakeLists.txt Code cleanup: remove source/kernel module, this wasn't really the kernel of 2011-05-06 20:18:42 +00:00
SConscript Code cleanup: remove source/kernel module, this wasn't really the kernel of 2011-05-06 20:18:42 +00:00