Blender Git Commit Log

Git Commits -> Revision 12e02fd

Revision 12e02fd by Campbell Barton (master)
June 24, 2011, 16:54 (GMT)
own patch [#27752] Python Callback (Scriptlink functionality)

Python:
* adds bpy.app.handlers which contains lists, each for an event type:
render_pre, render_post, load_pre, load_post, save_pre, save_post
* each list item needs to be a callable object which takes 1 argument (the ID).
* callbacks are cleared on file load.

Example:
def MyFunc(scene): print("Callback:", data)
bpy.app.handlers.render_post.append(MyFunc)

C:
* This patch adds a generic C callback api which is currently only used by python.
* Unlike python callbacks these are not cleared on file load.

Commit Details:

Full Hash: 12e02fd4746308746e2f9e316a3b5e8bcd5f2896
SVN Revision: 37795
Parent Commit: 74520bd
Lines Changed: +362, -8

3 Added Paths:

/source/blender/blenlib/intern/callbacks.c (+70, -0) (View)
/source/blender/python/intern/bpy_app_handlers.c (+170, -0) (View)
/source/blender/python/intern/bpy_app_handlers.h (+35, -0) (View)

10 Modified Paths:

/source/blender/blenkernel/intern/blender.c (+4, -0) (Diff)
/source/blender/blenlib/BLI_callbacks.h (+33, -5) (Diff)
/source/blender/blenlib/CMakeLists.txt (+1, -0) (Diff)
/source/blender/python/BPY_extern.h (+2, -0) (Diff)
/source/blender/python/intern/bpy_app.c (+6, -0) (Diff)
/source/blender/python/intern/CMakeLists.txt (+2, -0) (Diff)
/source/blender/render/intern/source/pipeline.c (+23, -2) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+11, -1) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+1, -0) (Diff)
/source/creator/creator.c (+4, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021