Blender V2.61 - r43446
Defines | Functions | Variables

bpy_app_handlers.c File Reference

#include <Python.h>
#include "BLI_utildefines.h"
#include "BLI_callbacks.h"
#include "RNA_types.h"
#include "RNA_access.h"
#include "bpy_rna.h"
#include "bpy_app_handlers.h"

Go to the source code of this file.

Defines

#define APP_CB_OTHER_FIELDS   1
#define PERMINENT_CB_ID   "_bpy_persistent"

Functions

void bpy_app_generic_callback (struct Main *main, struct ID *id, void *arg)
static PyObject * bpy_app_handlers_persistent_new (PyTypeObject *UNUSED(type), PyObject *args, PyObject *UNUSED(kwds))
static PyObject * make_app_cb_info (void)
PyObject * BPY_app_handlers_struct (void)
void BPY_app_handlers_reset (const short do_all)
void bpy_app_generic_callback (struct Main *UNUSED(main), struct ID *id, void *arg)

Variables

static PyTypeObject BlenderAppCbType
static PyStructSequence_Field app_cb_info_fields []
static PyStructSequence_Desc app_cb_info_desc
static PyTypeObject BPyPersistent_Type
static PyObject * py_cb_array [BLI_CB_EVT_TOT] = {NULL}

Detailed Description

This file defines a 'PyStructSequence' accessed via 'bpy.app.handlers', which exposes various lists that the script author can add callback functions into (called via blenders generic BLI_cb api)

Definition in file bpy_app_handlers.c.


Define Documentation

#define APP_CB_OTHER_FIELDS   1

Referenced by make_app_cb_info().

#define PERMINENT_CB_ID   "_bpy_persistent"

Definition at line 79 of file bpy_app_handlers.c.

Referenced by bpy_app_handlers_persistent_new(), and BPY_app_handlers_reset().


Function Documentation

void bpy_app_generic_callback ( struct Main main,
struct ID id,
void *  arg 
)

Referenced by BPY_app_handlers_struct().

void bpy_app_generic_callback ( struct Main UNUSEDmain,
struct ID id,
void *  arg 
)
static PyObject* bpy_app_handlers_persistent_new ( PyTypeObject *  UNUSEDtype,
PyObject *  args,
PyObject *  UNUSEDkwds 
) [static]

Definition at line 81 of file bpy_app_handlers.c.

References NULL, and PERMINENT_CB_ID.

void BPY_app_handlers_reset ( const short  do_all)

Definition at line 233 of file bpy_app_handlers.c.

References BLI_CB_EVT_TOT, i, NULL, and PERMINENT_CB_ID.

Referenced by load_file(), WM_init(), WM_read_file(), and WM_read_homefile().

PyObject* BPY_app_handlers_struct ( void  )
static PyObject* make_app_cb_info ( void  ) [static]

Variable Documentation

PyStructSequence_Desc app_cb_info_desc [static]
Initial value:
 {
    (char *)"bpy.app.handlers",     
    (char *)"This module contains callbacks",    
    app_cb_info_fields,    
    (sizeof(app_cb_info_fields) / sizeof(PyStructSequence_Field)) - 1
}

Definition at line 64 of file bpy_app_handlers.c.

Referenced by BPY_app_handlers_struct().

PyStructSequence_Field app_cb_info_fields[] [static]
Initial value:
 {
    {(char *)"frame_change_pre",  (char *)"Callback list - on frame change for playback and rendering (before)"},
    {(char *)"frame_change_post", (char *)"Callback list - on frame change for playback and rendering (after)"},
    {(char *)"render_pre",        (char *)"Callback list - on render (before)"},
    {(char *)"render_post",       (char *)"Callback list - on render (after)"},
    {(char *)"render_stats",      (char *)"Callback list - on printing render statistics"},
    {(char *)"load_pre",          (char *)"Callback list - on loading a new blend file (before)"},
    {(char *)"load_post",         (char *)"Callback list - on loading a new blend file (after)"},
    {(char *)"save_pre",          (char *)"Callback list - on saving a blend file (before)"},
    {(char *)"save_post",         (char *)"Callback list - on saving a blend file (after)"},
    {(char *)"scene_update_pre",  (char *)"Callback list - on updating the scenes data (before)"},
    {(char *)"scene_update_post", (char *)"Callback list - on updating the scenes data (after)"},

    
#define APP_CB_OTHER_FIELDS
    {(char *)"persistent",        (char *)"Function decorator for callback functions not to be removed when loading new files"},

    {NULL}
}

Definition at line 44 of file bpy_app_handlers.c.

Referenced by make_app_cb_info().

PyTypeObject BlenderAppCbType [static]

Definition at line 42 of file bpy_app_handlers.c.

Referenced by BPY_app_handlers_struct(), and make_app_cb_info().

PyTypeObject BPyPersistent_Type [static]

Definition at line 116 of file bpy_app_handlers.c.

PyObject* py_cb_array[BLI_CB_EVT_TOT] = {NULL} [static]

Definition at line 166 of file bpy_app_handlers.c.