Blender V5.3
bpy_msgbus.cc File Reference
#include <Python.h>
#include "../generic/py_capi_rna.hh"
#include "../generic/py_capi_utils.hh"
#include "../generic/python_compat.hh"
#include "../generic/python_utildefines.hh"
#include "../mathutils/mathutils.hh"
#include "BKE_context.hh"
#include "WM_message.hh"
#include "RNA_access.hh"
#include "bpy_capi_utils.hh"
#include "bpy_rna.hh"
#include "bpy_msgbus.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Internal Utils

#define BPY_MSGBUS_RNA_MSGKEY_DOC
static int blender::py_msgbus_rna_key_from_py (PyObject *py_sub, wmMsgParams_RNA *msg_key_params, const char *error_prefix)

Internal Callbacks

#define BPY_MSGBUS_USER_DATA_LEN   2
static void blender::bpy_msgbus_notify (bContext *C, wmMsgSubscribeKey *, wmMsgSubscribeValue *msg_val)
static void blender::bpy_msgbus_subscribe_value_free_data (wmMsgSubscribeKey *, wmMsgSubscribeValue *msg_val)

Public Message Bus API

static PyMethodDef blender::BPy_msgbus_methods []
static PyModuleDef blender::_bpy_msgbus_def
 blender::PyDoc_STRVAR (bpy_msgbus_subscribe_rna_doc, ".. function:: subscribe_rna(*, key, owner, args, notify, options=set())\n" "\n" " Register a message bus subscription. It will be cleared when another blend file is\n" " loaded, or can be cleared explicitly via :func:`bpy.msgbus.clear_by_owner`.\n" "\n" BPY_MSGBUS_RNA_MSGKEY_DOC " :param owner: Handle for this subscription (compared by identity).\n" " :type owner: Any\n" " :param args: Arguments passed to the callback.\n" " :type args: tuple\n" " :param notify: The callback function.\n" " :type notify: Callable[..., None]\n" " :param options: Change the behavior of the subscriber.\n" "\n" " - ``PERSISTENT`` when set, the subscriber will be kept when remapping ID data.\n" "\n" " :type options: set[Literal['PERSISTENT']]\n" "\n" ".. note::\n" "\n" " All subscribers will be cleared on file-load. Subscribers can be re-registered on load,\n" " see :mod:`bpy.app.handlers.load_post`.\n")
static PyObject * blender::bpy_msgbus_subscribe_rna (PyObject *, PyObject *args, PyObject *kw)
 blender::PyDoc_STRVAR (bpy_msgbus_publish_rna_doc, ".. function:: publish_rna(*, key)\n" "\n" BPY_MSGBUS_RNA_MSGKEY_DOC "\n" " Notify subscribers of changes to this property\n" " (this typically doesn't need to be called explicitly since changes will automatically " "publish updates).\n" " In some cases it may be useful to publish changes explicitly using more general keys.\n")
static PyObject * blender::bpy_msgbus_publish_rna (PyObject *, PyObject *args, PyObject *kw)
 blender::PyDoc_STRVAR (bpy_msgbus_clear_by_owner_doc, ".. function:: clear_by_owner(owner)\n" "\n" " Clear all subscribers using this owner.\n" "\n" " :param owner: The owner handle passed to :func:`subscribe_rna`.\n" " :type owner: Any\n")
static PyObject * blender::bpy_msgbus_clear_by_owner (PyObject *, PyObject *py_owner)
PyObject * blender::BPY_msgbus_module ()

Detailed Description

This file defines '_bpy_msgbus' module, exposed as 'bpy.msgbus'.

Definition in file bpy_msgbus.cc.

Macro Definition Documentation

◆ BPY_MSGBUS_RNA_MSGKEY_DOC

#define BPY_MSGBUS_RNA_MSGKEY_DOC
Value:
" :param key: Represents the type of data being subscribed to\n" \
"\n" \
" Arguments include\n" \
" - A property instance.\n" \
" - A struct type.\n" \
" - A tuple representing a (struct, property name) pair.\n" \
" :type key: :class:`bpy.types.Property` | " \
":class:`bpy.types.Struct` | " \
"tuple[:class:`bpy.types.Struct`, str]\n"

Definition at line 36 of file bpy_msgbus.cc.

Referenced by blender::PyDoc_STRVAR(), and blender::PyDoc_STRVAR().

◆ BPY_MSGBUS_USER_DATA_LEN

#define BPY_MSGBUS_USER_DATA_LEN   2

Definition at line 137 of file bpy_msgbus.cc.

Referenced by blender::bpy_msgbus_notify().