Blender  V2.93
Macros | Typedefs | Functions
BPY_extern.h File Reference
#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
 

Functions

void BPY_pyconstraint_exec (struct bPythonConstraint *con, struct bConstraintOb *cob, struct ListBase *targets)
 
void BPY_pyconstraint_target (struct bPythonConstraint *con, struct bConstraintTarget *ct)
 
void BPY_pyconstraint_update (struct Object *owner, struct bConstraint *con)
 
int BPY_is_pyconstraint (struct Text *text)
 
BPy_ThreadStatePtr BPY_thread_save (void)
 
void BPY_thread_restore (BPy_ThreadStatePtr tstate)
 
void BPY_text_free_code (struct Text *text)
 
void BPY_modules_update (void)
 
void BPY_modules_load_user (struct bContext *C)
 
void BPY_app_handlers_reset (const short do_all)
 
void BPY_driver_reset (void)
 
float BPY_driver_exec (struct PathResolvedRNA *anim_rna, struct ChannelDriver *driver, struct ChannelDriver *driver_orig, const struct AnimationEvalContext *anim_eval_context)
 
void BPY_DECREF (void *pyob_ptr)
 
void BPY_DECREF_RNA_INVALIDATE (void *pyob_ptr)
 
int BPY_context_member_get (struct bContext *C, const char *member, struct bContextDataResult *result)
 
void BPY_context_set (struct bContext *C)
 
void BPY_context_update (struct bContext *C)
 
void BPY_context_dict_clear_members_array (void **dict_p, void *dict_orig, const char *context_members[], uint context_members_len)
 
void BPY_id_release (struct ID *id)
 
bool BPY_string_is_keyword (const char *str)
 
void BPY_callback_screen_free (struct ARegionType *art)
 
void BPY_callback_wm_free (struct wmWindowManager *wm)
 

Macro Definition Documentation

◆ BPy_BEGIN_ALLOW_THREADS

#define BPy_BEGIN_ALLOW_THREADS
Value:
{ \
BPy_ThreadStatePtr _bpy_saved_tstate = BPY_thread_save(); \
(void)0
BPy_ThreadStatePtr BPY_thread_save(void)
Definition: bpy_threads.c:30

Definition at line 62 of file BPY_extern.h.

◆ BPY_context_dict_clear_members

#define BPY_context_dict_clear_members (   C,
  ... 
)
Value:
(C)->data.py_context_orig, \
((const char *[]){__VA_ARGS__}), \
VA_NARGS_COUNT(__VA_ARGS__))
#define VA_NARGS_COUNT(...)
void BPY_context_dict_clear_members_array(void **dict_p, void *dict_orig, const char *context_members[], uint context_members_len)
#define C
Definition: RandGen.cpp:39

Definition at line 91 of file BPY_extern.h.

◆ BPy_END_ALLOW_THREADS

#define BPy_END_ALLOW_THREADS
Value:
BPY_thread_restore(_bpy_saved_tstate); \
} \
(void)0
void BPY_thread_restore(BPy_ThreadStatePtr tstate)
Definition: bpy_threads.c:40

Definition at line 66 of file BPY_extern.h.

Typedef Documentation

◆ BPy_ThreadStatePtr

typedef void* BPy_ThreadStatePtr

Definition at line 56 of file BPY_extern.h.

Function Documentation

◆ BPY_app_handlers_reset()

void BPY_app_handlers_reset ( const short  do_all)

Definition at line 255 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().

◆ BPY_callback_screen_free()

void BPY_callback_screen_free ( struct ARegionType art)

◆ BPY_callback_wm_free()

void BPY_callback_wm_free ( struct wmWindowManager wm)

◆ BPY_context_dict_clear_members_array()

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.

Parameters
dict_pA pointer to #bContext.data.py_context so we can assign a new value.
dict_origThe value of #bContext.data.py_context_orig to check if we need to copy.
Note
Typically accessed via BPY_context_dict_clear_members macro.

Definition at line 180 of file bpy_interface.c.

References BLI_assert, and PyC_IsInterpreterActive().

◆ BPY_context_member_get()

int BPY_context_member_get ( struct bContext C,
const char *  member,
struct bContextDataResult result 
)

◆ BPY_context_set()

void BPY_context_set ( struct bContext C)

Definition at line 253 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().

◆ BPY_context_update()

void BPY_context_update ( struct bContext C)

◆ BPY_DECREF()

void BPY_DECREF ( void *  pyob_ptr)

Definition at line 604 of file bpy_interface.c.

Referenced by fcurve_free_driver().

◆ BPY_DECREF_RNA_INVALIDATE()

void BPY_DECREF_RNA_INVALIDATE ( void *  pyob_ptr)

◆ BPY_driver_exec()

float BPY_driver_exec ( struct PathResolvedRNA anim_rna,
struct ChannelDriver driver,
struct ChannelDriver driver_orig,
const struct AnimationEvalContext anim_eval_context 
)

Referenced by evaluate_driver_python().

◆ BPY_driver_reset()

void BPY_driver_reset ( void  )

Definition at line 228 of file bpy_driver.c.

References bpy_pydriver_Dict, bpy_pydriver_Dict__whitelist, g_pydriver_state_prev, and NULL.

Referenced by BPY_python_reset().

◆ BPY_id_release()

void BPY_id_release ( struct ID id)

Definition at line 306 of file bpy_rna.c.

Referenced by BKE_libblock_free_data_py().

◆ BPY_is_pyconstraint()

int BPY_is_pyconstraint ( struct Text text)

Definition at line 44 of file source/blender/python/intern/stubs.c.

◆ BPY_modules_load_user()

void BPY_modules_load_user ( struct bContext C)

◆ BPY_modules_update()

void BPY_modules_update ( void  )

Needed so the Main pointer in bpy.data doesn't become out of date.

Definition at line 236 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().

◆ BPY_pyconstraint_exec()

void BPY_pyconstraint_exec ( struct bPythonConstraint con,
struct bConstraintOb cob,
struct ListBase targets 
)

Definition at line 36 of file source/blender/python/intern/stubs.c.

Referenced by pycon_evaluate().

◆ BPY_pyconstraint_target()

void BPY_pyconstraint_target ( struct bPythonConstraint con,
struct bConstraintTarget ct 
)

Definition at line 41 of file source/blender/python/intern/stubs.c.

Referenced by pycon_get_tarmat().

◆ BPY_pyconstraint_update()

void BPY_pyconstraint_update ( struct Object owner,
struct bConstraint con 
)

◆ BPY_string_is_keyword()

bool BPY_string_is_keyword ( const char *  str)

Avoids duplicating keyword list.

Definition at line 871 of file bpy_interface.c.

References NULL, str, and STREQ.

Referenced by driver_variable_name_validate().

◆ BPY_text_free_code()

void BPY_text_free_code ( struct Text text)

◆ BPY_thread_restore()

void BPY_thread_restore ( BPy_ThreadStatePtr  tstate)

Definition at line 40 of file bpy_threads.c.

◆ BPY_thread_save()

BPy_ThreadStatePtr BPY_thread_save ( void  )

Definition at line 30 of file bpy_threads.c.

References NULL.