|
Blender V4.5
|
#include "BLI_sys_types.h"Go to the source code of this file.
Macros | |
| #define | BPy_BEGIN_ALLOW_THREADS |
| #define | BPy_END_ALLOW_THREADS |
Typedefs | |
| using | BPy_ThreadStatePtr = void * |
| #define BPy_BEGIN_ALLOW_THREADS |
Our own wrappers to #Py_BEGIN_ALLOW_THREADS / #Py_END_ALLOW_THREADS
Definition at line 51 of file BPY_extern.hh.
Referenced by blender::deg::deg_evaluate_on_refresh(), and ED_view3d_stop_render_preview().
| #define BPy_END_ALLOW_THREADS |
Definition at line 55 of file BPY_extern.hh.
Referenced by blender::deg::deg_evaluate_on_refresh(), and ED_view3d_stop_render_preview().
| using BPy_ThreadStatePtr = void * |
Definition at line 39 of file BPY_extern.hh.
| void BPY_app_handlers_reset | ( | bool | do_all | ) |
Definition at line 316 of file bpy_app_handlers.cc.
References BKE_CB_EVT_TOT, BPY_app_handlers_reset(), i, PERMINENT_CB_ID, and py_cb_array.
Referenced by BPY_app_handlers_reset(), and BPY_python_reset().
| void BPY_callback_screen_free | ( | ARegionType * | art | ) |
Definition at line 484 of file bpy_rna_callback.cc.
References BPY_callback_screen_free(), cb_customdata_free(), cb_region_draw(), and ED_region_draw_cb_remove_by_type().
Referenced by BPY_callback_screen_free(), and SpaceType::~SpaceType().
| void BPY_callback_wm_free | ( | wmWindowManager * | wm | ) |
Definition at line 490 of file bpy_rna_callback.cc.
References BPY_callback_wm_free(), cb_customdata_free(), cb_wm_cursor_draw(), and WM_paint_cursor_remove_by_type().
Referenced by BPY_callback_wm_free(), and 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 #66256.
| 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 169 of file bpy_interface.cc.
References BLI_assert, BPY_context_dict_clear_members_array(), i, and PyC_IsInterpreterActive().
Referenced by BPY_context_dict_clear_members_array(), CTX_data_scene_set(), CTX_wm_area_set(), CTX_wm_region_set(), CTX_wm_screen_set(), and CTX_wm_window_set().
| int BPY_context_member_get | ( | bContext * | C, |
| const char * | member, | ||
| bContextDataResult * | result ) |
Definition at line 732 of file bpy_interface.cc.
References BPY_context_member_get(), 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(), i, len(), PyC_IsInterpreterActive(), and result.
Referenced by BPY_context_member_get(), ctx_data_get(), and ctx_wm_python_context_get().
| void BPY_context_set | ( | bContext * | C | ) |
Definition at line 240 of file bpy_interface.cc.
References bpy_context_module, BPY_context_set(), C, and BPy_StructRNA::ptr.
Referenced by bpy_context_clear(), BPY_context_set(), and BPY_context_update().
| void BPY_context_update | ( | bContext * | C | ) |
Use for updating while a python script runs - in case of file load.
Definition at line 97 of file bpy_interface.cc.
References BLI_thread_is_main(), BPY_context_set(), BPY_context_update(), BPY_modules_update(), and C.
Referenced by bpy_context_set(), BPY_context_update(), BPY_modules_load_user(), and setup_app_data().
| void BPY_DECREF | ( | void * | pyob_ptr | ) |
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 669 of file bpy_interface.cc.
References BPY_DECREF().
Referenced by BPY_DECREF(), fcurve_free_driver(), pyop_poll_message_free_fn(), and RNA_struct_free_extension().
| void BPY_DECREF_RNA_INVALIDATE | ( | void * | pyob_ptr | ) |
Definition at line 676 of file bpy_interface.cc.
References BPY_DECREF_RNA_INVALIDATE(), and pyrna_invalidate().
Referenced by BKE_libblock_free_data_py(), BPY_DECREF_RNA_INVALIDATE(), RE_engine_free(), WM_gizmo_free(), wm_gizmogroup_free(), and WM_operator_free().
| float BPY_driver_exec | ( | PathResolvedRNA * | anim_rna, |
| ChannelDriver * | driver, | ||
| ChannelDriver * | driver_orig, | ||
| const 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.
Definition at line 524 of file bpy_driver.cc.
References BLI_listbase_count(), BPY_driver_exec(), BPY_driver_secure_bytecode_test_ex(), bpy_pydriver_create_dict(), bpy_pydriver_Dict, bpy_pydriver_Dict__whitelist, bpy_pydriver_namespace_clear_self(), bpy_pydriver_namespace_update_depsgraph(), bpy_pydriver_namespace_update_frame(), bpy_pydriver_namespace_update_self(), BPY_update_rna_module(), DriverVar::curval, AnimationEvalContext::depsgraph, DRIVER_FLAG_INVALID, DRIVER_FLAG_PYTHON_BLOCKED, DRIVER_FLAG_RECOMPILE, DRIVER_FLAG_RENAMEVAR, DRIVER_FLAG_USE_SELF, driver_get_variable_value(), DVAR_TYPE_SINGLE_PROP, AnimationEvalContext::eval_time, ChannelDriver::expr_comp, ChannelDriver::expression, ListBase::first, ChannelDriver::flag, G, G_FLAG_SCRIPT_AUTOEXEC, G_FLAG_SCRIPT_AUTOEXEC_FAIL, G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET, i, DriverVar::name, DriverVar::next, printf, pydriver_error(), pyrna_driver_get_variable_value(), result, SNPRINTF, DriverVar::targets, DriverVar::type, UNLIKELY, and ChannelDriver::variables.
Referenced by BPY_driver_exec(), and evaluate_driver_python().
| void BPY_driver_exit | ( | ) |
Run on exit to free any cached data.
Definition at line 241 of file bpy_driver.cc.
References BPY_driver_exit(), bpy_pydriver_Dict, bpy_pydriver_Dict__whitelist, FLT_MAX, and g_pydriver_state_prev.
Referenced by BPY_driver_exit(), BPY_driver_reset(), and BPY_python_end().
| void BPY_driver_reset | ( | ) |
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 264 of file bpy_driver.cc.
References BPY_driver_exit(), and BPY_driver_reset().
Referenced by BPY_driver_reset(), and BPY_python_reset().
| void BPY_free_srna_pytype | ( | StructRNA * | srna | ) |
Free (actually dereference) the Python type object representing the given #StrucRNA type, if it is defined.
Definition at line 9942 of file bpy_rna.cc.
References bpy_class_free_ex(), BPY_free_srna_pytype(), RNA_struct_py_type_get(), and RNA_struct_py_type_set().
Referenced by BPY_free_srna_pytype(), RNA_bpy_exit(), and WM_operatortype_remove_ptr().
| void BPY_id_release | ( | ID * | id | ) |
Definition at line 344 of file bpy_rna.cc.
References BPY_id_release().
Referenced by BKE_libblock_free_data_py(), and BPY_id_release().
| void BPY_modules_load_user | ( | bContext * | C | ) |
Definition at line 687 of file bpy_interface.cc.
References BKE_main_blendfile_path(), bpy_context_clear(), bpy_context_set(), BPY_context_update(), BPY_modules_load_user(), 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, printf, py_call_level, RPT_, SNPRINTF, Main::texts, and TXT_ISSCRIPT.
Referenced by BPY_modules_load_user(), and BPY_python_reset().
| void BPY_modules_update | ( | ) |
Needed so the Main pointer in bpy.data doesn't become out of date.
Definition at line 221 of file bpy_interface.cc.
References BPY_modules_update(), BPY_rna_module(), BPY_rna_types(), BPY_update_rna_module(), and mod.
Referenced by BPY_context_update(), BPY_modules_update(), and pyop_call().
| bool BPY_string_is_keyword | ( | const char * | str | ) |
Avoids duplicating keyword list.
Definition at line 962 of file bpy_interface.cc.
References BPY_string_is_keyword(), i, str, and STREQ.
Referenced by BPY_string_is_keyword(), and driver_variable_name_validate().
| void BPY_text_free_code | ( | Text * | text | ) |
Definition at line 202 of file bpy_interface.cc.
References BPY_text_free_code(), Text::compiled, and PyC_IsInterpreterActive().
Referenced by BPY_text_free_code(), text_free_data(), text_reload_exec(), and txt_make_dirty().
| void BPY_thread_backtrace_print | ( | ) |
Print the Python backtrace of the current thread state.
Should be safe to call from anywhere at any point, may not output anything if there is no valid python thread state available.
Definition at line 38 of file bpy_threads.cc.
References BPY_thread_backtrace_print(), and printf.
Referenced by BPY_thread_backtrace_print().
| void BPY_thread_restore | ( | BPy_ThreadStatePtr | tstate | ) |
Analogue of #PyEval_RestoreThread()
Definition at line 31 of file bpy_threads.cc.
References BPY_thread_restore().
Referenced by BPY_thread_restore().
| BPy_ThreadStatePtr BPY_thread_save | ( | ) |
Analogue of #PyEval_SaveThread()
Definition at line 18 of file bpy_threads.cc.
References BPY_thread_save(), and PyThreadState_GetUnchecked.
Referenced by BPY_thread_save().