own patch [#27752] Python Callback (Scriptlink functionality)
authorCampbell Barton <ideasman42@gmail.com>
Fri, 24 Jun 2011 16:54:30 +0000 (16:54 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 24 Jun 2011 16:54:30 +0000 (16:54 +0000)
commit12e02fd4746308746e2f9e316a3b5e8bcd5f2896
tree5d56ceb9eb0fadb020297604ca3dbce663190524
parent74520bd1ef6ab4264f5e6a24269f7ac3b85b4e23
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.
13 files changed:
source/blender/blenkernel/intern/blender.c
source/blender/blenlib/BLI_callbacks.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/callbacks.c [new file with mode: 0644]
source/blender/python/BPY_extern.h
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_app_handlers.c [new file with mode: 0644]
source/blender/python/intern/bpy_app_handlers.h [new file with mode: 0644]
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/creator/creator.c