Blender V4.3
bpy_app_handlers.cc File Reference
#include "BLI_utildefines.h"
#include <Python.h>
#include "BKE_callbacks.hh"
#include "RNA_access.hh"
#include "bpy_app_handlers.hh"
#include "bpy_rna.hh"
#include "../generic/python_utildefines.hh"
#include "BPY_extern.hh"

Go to the source code of this file.

Macros

#define FILEPATH_SAVE_ARG
 
#define FILEPATH_LOAD_ARG
 
#define RENDER_STATS_ARG
 
#define APP_CB_OTHER_FIELDS   1
 

Functions

void bpy_app_generic_callback (Main *main, PointerRNA **pointers, const int pointers_num, void *arg)
 
static PyObject * make_app_cb_info ()
 
PyObject * BPY_app_handlers_struct ()
 
void BPY_app_handlers_reset (const bool do_all)
 
static PyObject * choose_arguments (PyObject *func, PyObject *args_all, PyObject *args_single)
 

Variables

static PyTypeObject BlenderAppCbType
 
static PyStructSequence_Field app_cb_info_fields []
 
static PyStructSequence_Desc app_cb_info_desc
 
static PyObject * py_cb_array [BKE_CB_EVT_TOT] = {nullptr}
 

Permanent Tagging Code

#define PERMINENT_CB_ID   "_bpy_persistent"
 
static PyTypeObject BPyPersistent_Type
 
static PyObject * bpy_app_handlers_persistent_new (PyTypeObject *, PyObject *args, PyObject *)
 

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.cc.

Macro Definition Documentation

◆ APP_CB_OTHER_FIELDS

#define APP_CB_OTHER_FIELDS   1

Referenced by make_app_cb_info().

◆ FILEPATH_LOAD_ARG

#define FILEPATH_LOAD_ARG
Value:
"Accepts one argument: " \
"the file being loaded, an empty string for the startup-file."

Definition at line 37 of file bpy_app_handlers.cc.

◆ FILEPATH_SAVE_ARG

#define FILEPATH_SAVE_ARG
Value:
"Accepts one argument: " \
"the file being saved, an empty string for the startup-file."

Definition at line 34 of file bpy_app_handlers.cc.

◆ PERMINENT_CB_ID

#define PERMINENT_CB_ID   "_bpy_persistent"

Definition at line 132 of file bpy_app_handlers.cc.

Referenced by bpy_app_handlers_persistent_new(), and BPY_app_handlers_reset().

◆ RENDER_STATS_ARG

#define RENDER_STATS_ARG
Value:
"Accepts one argument: " \
"the render stats (render/saving time plus in background mode frame/used [peak] memory)."

Definition at line 40 of file bpy_app_handlers.cc.

Function Documentation

◆ bpy_app_generic_callback()

void bpy_app_generic_callback ( Main * main,
PointerRNA ** pointers,
const int pointers_num,
void * arg )

◆ bpy_app_handlers_persistent_new()

static PyObject * bpy_app_handlers_persistent_new ( PyTypeObject * ,
PyObject * args,
PyObject *  )
static

Definition at line 134 of file bpy_app_handlers.cc.

References PERMINENT_CB_ID.

◆ BPY_app_handlers_reset()

void BPY_app_handlers_reset ( const bool do_all)

Definition at line 295 of file bpy_app_handlers.cc.

References BKE_CB_EVT_TOT, PERMINENT_CB_ID, pos, and py_cb_array.

Referenced by BPY_python_reset().

◆ BPY_app_handlers_struct()

◆ choose_arguments()

static PyObject * choose_arguments ( PyObject * func,
PyObject * args_all,
PyObject * args_single )
static

Definition at line 347 of file bpy_app_handlers.cc.

Referenced by bpy_app_generic_callback().

◆ make_app_cb_info()

static PyObject * make_app_cb_info ( )
static

Variable Documentation

◆ app_cb_info_desc

PyStructSequence_Desc app_cb_info_desc
static
Initial value:
= {
"bpy.app.handlers",
"This module contains callback lists",
}
#define ARRAY_SIZE(arr)
static PyStructSequence_Field app_cb_info_fields[]

Definition at line 115 of file bpy_app_handlers.cc.

Referenced by BPY_app_handlers_struct().

◆ app_cb_info_fields

PyStructSequence_Field app_cb_info_fields[]
static

See BKE_callbacks.hh eCbEvent declaration for the policy on naming.

Definition at line 46 of file bpy_app_handlers.cc.

Referenced by bpy_app_generic_callback(), and make_app_cb_info().

◆ BlenderAppCbType

PyTypeObject BlenderAppCbType
static

Definition at line 32 of file bpy_app_handlers.cc.

Referenced by BPY_app_handlers_struct(), and make_app_cb_info().

◆ BPyPersistent_Type

PyTypeObject BPyPersistent_Type
static

Dummy type because decorators can't be a #PyCFunction.

Definition at line 169 of file bpy_app_handlers.cc.

Referenced by BPY_app_handlers_struct(), and make_app_cb_info().

◆ py_cb_array

PyObject* py_cb_array[BKE_CB_EVT_TOT] = {nullptr}
static