diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-02 09:24:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-02 14:53:44 +0300 |
commit | 42a6b2fd06e4fefe1bdb283d9e568d7f7dca178e (patch) | |
tree | 8006ad82c7b331eccb1433f8cda10d7372f44b3a /source/blender/python/BPY_extern.h | |
parent | 17665494186816cebb9e8304199e40f9ee033990 (diff) |
Cleanup: move public doc-strings into headers for 'python'
Diffstat (limited to 'source/blender/python/BPY_extern.h')
-rw-r--r-- | source/blender/python/BPY_extern.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 43a73363c98..554d4a4541f 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -55,7 +55,13 @@ int BPY_is_pyconstraint(struct Text *text); typedef void *BPy_ThreadStatePtr; +/** + * Analogue of #PyEval_SaveThread() + */ BPy_ThreadStatePtr BPY_thread_save(void); +/** + * Analogue of #PyEval_RestoreThread() + */ void BPY_thread_restore(BPy_ThreadStatePtr tstate); /* our own wrappers to Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS */ @@ -74,7 +80,18 @@ void BPY_modules_load_user(struct bContext *C); void BPY_app_handlers_reset(const short do_all); +/** + * Update function, it gets rid of py-drivers global dictionary, forcing + * BPY_driver_exec to recreate it. This function is used to force + * reloading the Blender text module "pydrivers.py", if available, so + * updates in it reach py-driver evaluation. + */ void BPY_driver_reset(void); + +/** + * This evaluates Python driver expressions, `driver_orig->expression` + * is a Python expression that should evaluate to a float number, which is returned. + */ float BPY_driver_exec(struct PathResolvedRNA *anim_rna, struct ChannelDriver *driver, struct ChannelDriver *driver_orig, @@ -93,6 +110,16 @@ void BPY_context_update(struct bContext *C); (C)->data.py_context_orig, \ ((const char *[]){__VA_ARGS__}), \ VA_NARGS_COUNT(__VA_ARGS__)) +/** + * Use for `CTX_*_set(..)` functions need to set values which are later read back as expected. + * In this case we don't want the Python context to override the values as it causes problems + * see T66256. + * + * \param dict_p: A pointer to #bContext.data.py_context so we can assign a new value. + * \param dict_orig: The value of #bContext.data.py_context_orig to check if we need to copy. + * + * \note Typically accessed via #BPY_context_dict_clear_members macro. + */ void BPY_context_dict_clear_members_array(void **dict_p, void *dict_orig, const char *context_members[], |