Blender
V3.3
|
#include "BLI_utildefines.h"
Go to the source code of this file.
Macros | |
#define | BPy_BEGIN_ALLOW_THREADS |
#define | BPy_END_ALLOW_THREADS |
#define | BPY_context_dict_clear_members(C, ...) |
Typedefs | |
typedef void * | BPy_ThreadStatePtr |
#define BPy_BEGIN_ALLOW_THREADS |
Our own wrappers to #Py_BEGIN_ALLOW_THREADS / #Py_END_ALLOW_THREADS
Definition at line 54 of file BPY_extern.h.
Definition at line 109 of file BPY_extern.h.
#define BPy_END_ALLOW_THREADS |
Definition at line 58 of file BPY_extern.h.
typedef void* BPy_ThreadStatePtr |
Definition at line 42 of file BPY_extern.h.
Definition at line 253 of file bpy_app_handlers.c.
References BKE_CB_EVT_TOT, NULL, PERMINENT_CB_ID, pos, and py_cb_array.
Referenced by BPY_python_reset().
void BPY_callback_screen_free | ( | struct ARegionType * | art | ) |
Definition at line 487 of file bpy_rna_callback.c.
References cb_customdata_free(), cb_region_draw(), and ED_region_draw_cb_remove_by_type().
Referenced by spacetype_free().
void BPY_callback_wm_free | ( | struct wmWindowManager * | wm | ) |
Definition at line 492 of file bpy_rna_callback.c.
References cb_customdata_free(), cb_wm_cursor_draw(), and WM_paint_cursor_remove_by_type().
Referenced by wm_close_and_free().
void BPY_context_dict_clear_members_array | ( | void ** | dict_p, |
void * | dict_orig, | ||
const char * | context_members[], | ||
uint | context_members_len | ||
) |
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.
dict_p | A pointer to #bContext.data.py_context so we can assign a new value. |
dict_orig | The value of #bContext.data.py_context_orig to check if we need to copy. |
Definition at line 161 of file bpy_interface.c.
References BLI_assert, and PyC_IsInterpreterActive().
int BPY_context_member_get | ( | struct bContext * | C, |
const char * | member, | ||
struct bContextDataResult * | result | ||
) |
Definition at line 668 of file bpy_interface.c.
References BLI_addtail(), BPY_LOG_CONTEXT, BPy_StructRNA_Check, C, CLOG_INFO, CTX_data_list_add_ptr(), CTX_data_pointer_set_ptr(), CTX_DATA_TYPE_COLLECTION, CTX_DATA_TYPE_POINTER, CTX_data_type_set(), CTX_py_dict_get(), len, MEM_callocN, NULL, CollectionPointerLink::ptr, ptr, PyC_IsInterpreterActive(), and result.
Referenced by ctx_data_get(), and ctx_wm_python_context_get().
Definition at line 231 of file bpy_interface.c.
References bpy_context_module, C, PointerRNA::data, and BPy_StructRNA::ptr.
Referenced by bpy_context_clear(), and BPY_context_update().
Use for updating while a python script runs - in case of file load.
Definition at line 91 of file bpy_interface.c.
References BLI_thread_is_main(), BPY_context_set(), BPY_modules_update(), and C.
Referenced by bpy_context_set(), BPY_modules_load_user(), and setup_app_data().
Acquire the global-interpreter-lock (GIL) and wrap Py_DECREF
. as there are some cases when this needs to be called outside the Python API code.
Definition at line 606 of file bpy_interface.c.
Referenced by fcurve_free_driver(), and pyop_poll_message_free_fn().
Definition at line 613 of file bpy_interface.c.
References pyrna_invalidate().
Referenced by BKE_libblock_free_data_py(), RE_engine_free(), WM_gizmo_free(), wm_gizmogroup_free(), and WM_operator_free().
float BPY_driver_exec | ( | struct PathResolvedRNA * | anim_rna, |
struct ChannelDriver * | driver, | ||
struct ChannelDriver * | driver_orig, | ||
const struct AnimationEvalContext * | anim_eval_context | ||
) |
This evaluates Python driver expressions, driver_orig->expression
is a Python expression that should evaluate to a float number, which is returned.
Referenced by evaluate_driver_python().
Run on exit to free any cached data.
Definition at line 237 of file bpy_driver.c.
References bpy_pydriver_Dict, bpy_pydriver_Dict__whitelist, g_pydriver_state_prev, and NULL.
Referenced by BPY_driver_reset(), and BPY_python_end().
Update function, it gets rid of python-drivers global dictionary: bpy.app.driver_namespace
, forcing BPY_driver_exec to recreate it. Use this when loading a new .blend
file so any variables setup by the previous blend file are cleared.
Definition at line 260 of file bpy_driver.c.
References BPY_driver_exit().
Referenced by BPY_python_reset().
Definition at line 287 of file bpy_rna.c.
Referenced by BKE_libblock_free_data_py().
int BPY_is_pyconstraint | ( | struct Text * | text | ) |
Definition at line 28 of file source/blender/python/intern/stubs.c.
Definition at line 624 of file bpy_interface.c.
References BKE_main_blendfile_path(), BLI_snprintf(), bpy_context_clear(), bpy_context_set(), BPY_context_update(), BPY_run_text(), C, CTX_data_main(), ListBase::first, Text::flags, G, G_FLAG_SCRIPT_AUTOEXEC, G_FLAG_SCRIPT_AUTOEXEC_FAIL, G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET, Text::id, ID::name, ID::next, NULL, py_call_level, Main::texts, and TXT_ISSCRIPT.
Referenced by BPY_python_reset().
Needed so the Main pointer in bpy.data
doesn't become out of date.
Definition at line 214 of file bpy_interface.c.
References BPY_rna_module(), BPY_rna_types(), BPY_update_rna_module(), mod(), and NULL.
Referenced by BPY_context_update(), and pyop_call().
void BPY_pyconstraint_exec | ( | struct bPythonConstraint * | con, |
struct bConstraintOb * | cob, | ||
struct ListBase * | targets | ||
) |
Definition at line 20 of file source/blender/python/intern/stubs.c.
Referenced by pycon_evaluate().
void BPY_pyconstraint_target | ( | struct bPythonConstraint * | con, |
struct bConstraintTarget * | ct | ||
) |
Definition at line 25 of file source/blender/python/intern/stubs.c.
Referenced by pycon_get_tarmat().
void BPY_pyconstraint_update | ( | struct Object * | owner, |
struct bConstraint * | con | ||
) |
Definition at line 32 of file source/blender/python/intern/stubs.c.
Referenced by constraint_add_exec(), and text_refresh_pyconstraints_exec().
bool BPY_string_is_keyword | ( | const char * | str | ) |
Avoids duplicating keyword list.
Definition at line 870 of file bpy_interface.c.
References NULL, str, and STREQ.
Referenced by driver_variable_name_validate().
Definition at line 195 of file bpy_interface.c.
References Text::compiled, NULL, and PyC_IsInterpreterActive().
Referenced by python_script_exec(), text_free_data(), text_reload_exec(), and txt_make_dirty().
void BPY_thread_restore | ( | BPy_ThreadStatePtr | tstate | ) |
Analogue of #PyEval_RestoreThread()
Definition at line 28 of file bpy_threads.c.
BPy_ThreadStatePtr BPY_thread_save | ( | void | ) |