diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-09 11:25:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-11 11:43:27 +0300 |
commit | a650258158dd7ad8fa9b6cb1b7da749e30ae15c1 (patch) | |
tree | 840b324fbf9739dce8ac50da1acde80e2fb4f140 /source/blender/blenkernel/BKE_callbacks.h | |
parent | 022de797f1773f512f21cf9038787dd77e0fd5de (diff) |
Python handlers: Pass depsgraph to events where it makes sense
The goal is to make it possible to access evaluated datablocks at a
corresponding context. For example, be able to check evaluated state
if an object used for rendering.
Allows to write scripts in a safe manner for T63548 and T60094.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5726
Diffstat (limited to 'source/blender/blenkernel/BKE_callbacks.h')
-rw-r--r-- | source/blender/blenkernel/BKE_callbacks.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_callbacks.h b/source/blender/blenkernel/BKE_callbacks.h index 380ce30668d..e15cf7fed18 100644 --- a/source/blender/blenkernel/BKE_callbacks.h +++ b/source/blender/blenkernel/BKE_callbacks.h @@ -21,8 +21,10 @@ #ifndef __BKE_CALLBACKS_H__ #define __BKE_CALLBACKS_H__ +struct Depsgraph; struct ID; struct Main; +struct PointerRNA; /** * Common suffix uses: @@ -59,12 +61,21 @@ typedef enum { typedef struct bCallbackFuncStore { struct bCallbackFuncStore *next, *prev; - void (*func)(struct Main *, struct ID *, void *arg); + void (*func)(struct Main *, struct PointerRNA **, const int num_pointers, void *arg); void *arg; short alloc; } bCallbackFuncStore; -void BKE_callback_exec(struct Main *bmain, struct ID *self, eCbEvent evt); +void BKE_callback_exec(struct Main *bmain, + struct PointerRNA **pointers, + const int num_pointers, + eCbEvent evt); +void BKE_callback_exec_null(struct Main *bmain, eCbEvent evt); +void BKE_callback_exec_id(struct Main *bmain, struct ID *id, eCbEvent evt); +void BKE_callback_exec_id_depsgraph(struct Main *bmain, + struct ID *id, + struct Depsgraph *depsgraph, + eCbEvent evt); void BKE_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt); void BKE_callback_global_init(void); |