|
Blender V4.5
|
#include <Python.h>#include <frameobject.h>#include "BLI_utildefines.h"#include "py_capi_utils.hh"#include "python_utildefines.hh"#include "MEM_guardedalloc.h"#include "BLI_string.h"Go to the source code of this file.
Macros | |
| #define | PY_SSIZE_T_CLEAN |
| #define | PyLong_AsInt _PyLong_AsInt |
| #define | PyUnicode_CompareWithASCIIString _PyUnicode_EqualToASCIIString |
Functions | |
Fast Python to C Array Conversion for Primitive Types | |
| int | PyC_AsArray_FAST (void *array, const size_t array_item_size, PyObject *value_fast, const Py_ssize_t length, const PyTypeObject *type, const char *error_prefix) |
| int | PyC_AsArray (void *array, const size_t array_item_size, PyObject *value, const Py_ssize_t length, const PyTypeObject *type, const char *error_prefix) |
| static int | PyC_AsArray_Multi_impl (void **array_p, const size_t array_item_size, PyObject *value, const int *dims, const int dims_len, const PyTypeObject *type, const char *error_prefix) |
| static int | PyC_AsArray_Multi_FAST_impl (void **array_p, const size_t array_item_size, PyObject *value_fast, const int *dims, const int dims_len, const PyTypeObject *type, const char *error_prefix) |
| int | PyC_AsArray_Multi_FAST (void *array, const size_t array_item_size, PyObject *value_fast, const int *dims, const int dims_len, const PyTypeObject *type, const char *error_prefix) |
| int | PyC_AsArray_Multi (void *array, const size_t array_item_size, PyObject *value, const int *dims, const int dims_len, const PyTypeObject *type, const char *error_prefix) |
Typed Tuple Packing | |
| |
| PyObject * | PyC_Tuple_PackArray_F32 (const float *array, uint len) |
| PyObject * | PyC_Tuple_PackArray_F64 (const double *array, uint len) |
| PyObject * | PyC_Tuple_PackArray_I32 (const int *array, uint len) |
| PyObject * | PyC_Tuple_PackArray_I32FromBool (const int *array, uint len) |
| PyObject * | PyC_Tuple_PackArray_Bool (const bool *array, uint len) |
| PyObject * | PyC_Tuple_PackArray_String (const char **array, uint len) |
Typed Tuple Packing (Multi-Dimensional) | |
| static PyObject * | PyC_Tuple_PackArray_Multi_F32_impl (const float **array_p, const int dims[], const int dims_len) |
| PyObject * | PyC_Tuple_PackArray_Multi_F32 (const float *array, const int dims[], const int dims_len) |
| static PyObject * | PyC_Tuple_PackArray_Multi_F64_impl (const double **array_p, const int dims[], const int dims_len) |
| PyObject * | PyC_Tuple_PackArray_Multi_F64 (const double *array, const int dims[], const int dims_len) |
| static PyObject * | PyC_Tuple_PackArray_Multi_I32_impl (const int **array_p, const int dims[], const int dims_len) |
| PyObject * | PyC_Tuple_PackArray_Multi_I32 (const int *array, const int dims[], const int dims_len) |
| static PyObject * | PyC_Tuple_PackArray_Multi_Bool_impl (const bool **array_p, const int dims[], const int dims_len) |
| PyObject * | PyC_Tuple_PackArray_Multi_Bool (const bool *array, const int dims[], const int dims_len) |
Tuple/List Filling | |
| void | PyC_Tuple_Fill (PyObject *tuple, PyObject *value) |
| void | PyC_List_Fill (PyObject *list, PyObject *value) |
Bool/Enum Argument Parsing | |
| int | PyC_ParseBool (PyObject *o, void *p) |
| int | PyC_ParseStringEnum (PyObject *o, void *p) |
| const char * | PyC_StringEnum_FindIDFromValue (const PyC_StringEnumItems *items, const int value) |
| int | PyC_CheckArgs_DeepCopy (PyObject *args) |
Simple Printing (for debugging) | |
These are useful to run directly from a debugger to be able to inspect the state. | |
| void | PyC_ObSpit (const char *name, PyObject *var) |
| void | PyC_ObSpitStr (char *result, size_t result_maxncpy, PyObject *var) |
| void | PyC_LineSpit () |
| void | PyC_StackSpit () |
Access Current Frame File Name & Line Number | |
| void | PyC_FileAndNum (const char **r_filename, int *r_lineno) |
| void | PyC_FileAndNum_Safe (const char **r_filename, int *r_lineno) |
Object Access Utilities | |
| PyObject * | PyC_Object_GetAttrStringArgs (PyObject *o, Py_ssize_t n,...) |
Frozen Set Creation | |
| PyObject * | PyC_FrozenSetFromStrings (const char **strings) |
Exception Utilities | |
| PyObject * | PyC_Err_Format_Prefix (PyObject *exception_type_prefix, const char *formatformat,...) |
| PyObject * | PyC_Err_SetString_Prefix (PyObject *exception_type_prefix, const char *str) |
| void | PyC_Err_PrintWithFunc (PyObject *py_func) |
Exception Buffer Access | |
| static void | pyc_exception_buffer_handle_system_exit () |
| PyObject * | PyC_ExceptionBuffer () |
| PyObject * | PyC_ExceptionBuffer_Simple () |
Unicode Conversion | |
In some cases we need to coerce strings, avoid doing this inline. | |
| const char * | PyC_UnicodeAsBytesAndSize (PyObject *py_str, Py_ssize_t *r_size, PyObject **r_coerce) |
| const char * | PyC_UnicodeAsBytes (PyObject *py_str, PyObject **r_coerce) |
| PyObject * | PyC_UnicodeFromBytesAndSize (const char *str, Py_ssize_t size) |
| PyObject * | PyC_UnicodeFromBytes (const char *str) |
| PyObject * | PyC_UnicodeFromStdStr (const std::string &str) |
| int | PyC_ParseUnicodeAsBytesAndSize (PyObject *o, void *p) |
| int | PyC_ParseUnicodeAsBytesAndSize_OrNone (PyObject *o, void *p) |
Name Space Creation/Manipulation | |
| PyObject * | PyC_DefaultNameSpace (const char *filename) |
| bool | PyC_NameSpace_ImportArray (PyObject *py_dict, const char *imports[]) |
| PyObject * | PyC_MainModule_Backup () |
| void | PyC_MainModule_Restore (PyObject *main_mod) |
| bool | PyC_IsInterpreterActive () |
#Py_SetPythonHome Wrapper | |
| void | PyC_RunQuicky (const char *filepath, int n,...) |
| void * | PyC_RNA_AsPointer (PyObject *value, const char *type_name) |
Flag Set Utilities (#PyC_FlagSet) | |
Convert to/from Python set of strings to an int flag. | |
| PyObject * | PyC_FlagSet_AsString (const PyC_FlagSet *item) |
| int | PyC_FlagSet_ValueFromID_int (const PyC_FlagSet *item, const char *identifier, int *r_value) |
| int | PyC_FlagSet_ValueFromID (const PyC_FlagSet *item, const char *identifier, int *r_value, const char *error_prefix) |
| int | PyC_FlagSet_ToBitfield (const PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix) |
| PyObject * | PyC_FlagSet_FromBitfield (PyC_FlagSet *items, int flag) |
Std Files Flush | |
| void | PyC_StdFilesFlush () |
Int Conversion | |
| |
| static ulong | pyc_Long_AsUnsignedLong (PyObject *value) |
| int | PyC_Long_AsBool (PyObject *value) |
| int8_t | PyC_Long_AsI8 (PyObject *value) |
| int16_t | PyC_Long_AsI16 (PyObject *value) |
| uint8_t | PyC_Long_AsU8 (PyObject *value) |
| uint16_t | PyC_Long_AsU16 (PyObject *value) |
| uint32_t | PyC_Long_AsU32 (PyObject *value) |
| uint64_t | PyC_Long_AsU64 (PyObject *value) |
Py_buffer Utils | |
| char | PyC_StructFmt_type_from_str (const char *typestr) |
| bool | PyC_StructFmt_type_is_float_any (char formatformat) |
| bool | PyC_StructFmt_type_is_int_any (char formatformat) |
| bool | PyC_StructFmt_type_is_byte (char formatformat) |
| bool | PyC_StructFmt_type_is_bool (char formatformat) |
Run String (Evaluate to Primitive Types) | |
| static PyObject | ATTR_WARN_UNUSED_RESULT |
| static PyObject * | pyc_run_string_as_py_object (const char *imports[], const char *imports_star[], const char *expr, const char *filename) ATTR_NONNULL(3 |
| bool | PyC_RunString_AsNumber (const char *imports[], const char *expr, const char *filename, double *r_value) |
| bool | PyC_RunString_AsIntPtr (const char *imports[], const char *expr, const char *filename, intptr_t *r_value) |
| bool | PyC_RunString_AsStringAndSize (const char *imports[], const char *expr, const char *filename, char **r_value, size_t *r_value_size) |
| bool | PyC_RunString_AsString (const char *imports[], const char *expr, const char *filename, char **r_value) |
| bool | PyC_RunString_AsStringAndSizeOrNone (const char *imports[], const char *expr, const char *filename, char **r_value, size_t *r_value_size) |
| bool | PyC_RunString_AsStringOrNone (const char *imports[], const char *expr, const char *filename, char **r_value) |
Extend upon CPython's API, filling in some gaps, these functions use PyC_ prefix to distinguish them apart from CPython.
Definition in file py_capi_utils.cc.
| #define PY_SSIZE_T_CLEAN |
Definition at line 13 of file py_capi_utils.cc.
| #define PyLong_AsInt _PyLong_AsInt |
Definition at line 35 of file py_capi_utils.cc.
Referenced by Py_LOCAL_INLINE(), PyC_Long_AsBool(), PyC_Long_AsI16(), and PyC_Long_AsI8().
| #define PyUnicode_CompareWithASCIIString _PyUnicode_EqualToASCIIString |
Definition at line 36 of file py_capi_utils.cc.
Referenced by pygpu_framebuffer_new_parse_arg().
| int PyC_AsArray | ( | void * | array, |
| const size_t | array_item_size, | ||
| PyObject * | value, | ||
| const Py_ssize_t | length, | ||
| const PyTypeObject * | type, | ||
| const char * | error_prefix ) |
Definition at line 177 of file py_capi_utils.cc.
References length(), PyC_AsArray(), PyC_AsArray_FAST(), and ret.
Referenced by bpy_gizmo_target_set_value(), BPy_IDArray_ass_slice(), bpy_prop_array_from_py_with_dims(), idprop_ui_data_update_bool_default(), idprop_ui_data_update_float_default(), idprop_ui_data_update_int_default(), py_imbuf_ppm_set(), py_rna_gizmo_handler_get_cb(), PyC_AsArray(), pygpu_texture__tp_new(), and pygpu_texture_clear().
| int PyC_AsArray_FAST | ( | void * | array, |
| const size_t | array_item_size, | ||
| PyObject * | value_fast, | ||
| const Py_ssize_t | length, | ||
| const PyTypeObject * | type, | ||
| const char * | error_prefix ) |
Definition at line 44 of file py_capi_utils.cc.
References BLI_assert, BLI_assert_unreachable, i, length(), PyC_AsArray_FAST(), PyC_Long_AsI16(), and PyC_Long_AsI8().
Referenced by PyC_AsArray(), PyC_AsArray_FAST(), PyC_AsArray_Multi_FAST_impl(), pygpu_IndexBuf__tp_new(), pygpu_shader_uniform_bool(), and pygpu_shader_uniform_int().
| int PyC_AsArray_Multi | ( | void * | array, |
| const size_t | array_item_size, | ||
| PyObject * | value, | ||
| const int * | dims, | ||
| const int | dims_len, | ||
| const PyTypeObject * | type, | ||
| const char * | error_prefix ) |
Definition at line 285 of file py_capi_utils.cc.
References PyC_AsArray_Multi(), and PyC_AsArray_Multi_impl().
Referenced by bpy_prop_array_from_py_with_dims(), and PyC_AsArray_Multi().
| int PyC_AsArray_Multi_FAST | ( | void * | array, |
| const size_t | array_item_size, | ||
| PyObject * | value_fast, | ||
| const int * | dims, | ||
| const int | dims_len, | ||
| const PyTypeObject * | type, | ||
| const char * | error_prefix ) |
Definition at line 273 of file py_capi_utils.cc.
References PyC_AsArray_Multi_FAST(), and PyC_AsArray_Multi_FAST_impl().
Referenced by PyC_AsArray_Multi_FAST().
|
static |
Definition at line 204 of file py_capi_utils.cc.
References i, length(), POINTER_OFFSET, PyC_AsArray_FAST(), PyC_AsArray_Multi_FAST_impl(), and PyC_AsArray_Multi_impl().
Referenced by PyC_AsArray_Multi_FAST(), PyC_AsArray_Multi_FAST_impl(), and PyC_AsArray_Multi_impl().
|
static |
Definition at line 252 of file py_capi_utils.cc.
References PyC_AsArray_Multi_FAST_impl(), PyC_AsArray_Multi_impl(), and ret.
Referenced by PyC_AsArray_Multi(), PyC_AsArray_Multi_FAST_impl(), and PyC_AsArray_Multi_impl().
| int PyC_CheckArgs_DeepCopy | ( | PyObject * | args | ) |
Silly function, we don't use arg. just check its compatible with __deepcopy__.
Definition at line 555 of file py_capi_utils.cc.
References PyC_CheckArgs_DeepCopy().
Referenced by Color_deepcopy(), Euler_deepcopy(), Matrix_deepcopy(), py_imbuf_deepcopy(), PyC_CheckArgs_DeepCopy(), PyC_StringEnum_FindIDFromValue(), Quaternion_deepcopy(), and Vector_deepcopy().
| PyObject * PyC_DefaultNameSpace | ( | const char * | filename | ) |
Description: This function creates a new Python dictionary object. NOTE: dict is owned by sys.modules["__main__"] module, reference is borrowed NOTE: important we use the dict from main, this is what python expects for 'pickle' to work as well as strings like this...
foo = 10 print(import("__main__").foo)
NOTE: this overwrites main which gives problems with nested calls. be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is any chance that python is in the call stack.
Definition at line 1113 of file py_capi_utils.cc.
References PyC_DefaultNameSpace(), and PyC_UnicodeFromBytes().
Referenced by bpy_rna_uilayout_introspect(), bpy_run_string_impl(), PyC_DefaultNameSpace(), pyc_run_string_as_py_object(), PyC_RunQuicky(), and python_script_exec().
| PyObject * PyC_Err_Format_Prefix | ( | PyObject * | exception_type_prefix, |
| const char * | format, | ||
| ... ) |
Similar to #PyErr_Format(),
Implementation - we can't actually prepend the existing exception, because it could have any arguments given to it, so instead we get its __str__ output and raise our own exception including it.
Definition at line 781 of file py_capi_utils.cc.
References PyC_Err_Format_Prefix().
Referenced by bpy_class_call(), PyC_Err_Format_Prefix(), PyC_Err_SetString_Prefix(), and pyrna_py_to_prop().
| void PyC_Err_PrintWithFunc | ( | PyObject * | py_func | ) |
Use for Python callbacks run directly from C, when we can't use normal methods of raising exceptions.
Definition at line 832 of file py_capi_utils.cc.
References PyC_Err_PrintWithFunc().
Referenced by bpy_msgbus_notify(), bpy_prop_boolean_array_get_fn(), bpy_prop_boolean_array_set_fn(), bpy_prop_boolean_get_fn(), bpy_prop_boolean_set_fn(), bpy_prop_enum_get_fn(), bpy_prop_enum_itemf_fn(), bpy_prop_enum_set_fn(), bpy_prop_float_array_get_fn(), bpy_prop_float_array_set_fn(), bpy_prop_float_get_fn(), bpy_prop_float_set_fn(), bpy_prop_int_array_get_fn(), bpy_prop_int_array_set_fn(), bpy_prop_int_get_fn(), bpy_prop_int_set_fn(), bpy_prop_pointer_poll_fn(), bpy_prop_string_get_fn(), bpy_prop_string_length_fn(), bpy_prop_string_set_fn(), bpy_prop_string_visit_fn_call(), bpy_prop_string_visit_for_search_fn(), bpy_prop_update_fn(), and PyC_Err_PrintWithFunc().
| PyObject * PyC_Err_SetString_Prefix | ( | PyObject * | exception_type_prefix, |
| const char * | str ) |
Definition at line 827 of file py_capi_utils.cc.
References PyC_Err_Format_Prefix(), PyC_Err_SetString_Prefix(), and str.
Referenced by bpy_app_debug_value_set(), and PyC_Err_SetString_Prefix().
|
static |
When a script calls sys.exit(..) it is expected that Blender quits, internally this raises as SystemExit exception which this function detects.
Historically Blender would call PyErr_Print when encountering an error. In some cases PyErr_Print is still called, but not all. When only PyC_ExceptionBuffer is used to access the error, it's not desirable that sys.exit() fails to exit, causing sys.exit(..) to arbitrarily work depending on the internals of Blender's error handling. To avoid this discrepancy, detect when PyErr_Print would exit and call it in that case. It's important to call PyErr_Print (instead of simply exiting), because the exception may contain a message which the user should see.
Definition at line 869 of file py_capi_utils.cc.
References pyc_exception_buffer_handle_system_exit().
Referenced by pyc_exception_buffer_handle_system_exit(), PyC_ExceptionBuffer(), and PyC_ExceptionBuffer_Simple().
| PyObject * PyC_ExceptionBuffer | ( | ) |
Return a string containing the full stack trace.
Definition at line 897 of file py_capi_utils.cc.
References BLI_assert, pyc_exception_buffer_handle_system_exit(), PyC_ExceptionBuffer(), result, and UNLIKELY.
Referenced by BPy_errors_to_report_ex(), pointer_type_from_py(), PyC_ExceptionBuffer(), pyrna_py_to_prop(), and run_string_handle_error().
| PyObject * PyC_ExceptionBuffer_Simple | ( | ) |
A version of PyC_ExceptionBuffer that returns the last exception only.
Useful for error messages from evaluating numeric expressions for example where a full multi-line stack-trace isn't needed and doesn't format well in the status-bar.
Definition at line 957 of file py_capi_utils.cc.
References BLI_assert, pyc_exception_buffer_handle_system_exit(), PyC_ExceptionBuffer_Simple(), result, and UNLIKELY.
Referenced by BPy_errors_to_report_ex(), PyC_ExceptionBuffer_Simple(), and run_string_handle_error().
| void PyC_FileAndNum | ( | const char ** | r_filename, |
| int * | r_lineno ) |
Definition at line 655 of file py_capi_utils.cc.
References mod, and PyC_FileAndNum().
Referenced by BPy_errors_to_report_ex(), PyC_FileAndNum(), PyC_FileAndNum_Safe(), PyC_LineSpit(), and pyrna_func_call().
| void PyC_FileAndNum_Safe | ( | const char ** | r_filename, |
| int * | r_lineno ) |
Definition at line 709 of file py_capi_utils.cc.
References PyC_FileAndNum(), PyC_FileAndNum_Safe(), and PyC_IsInterpreterActive().
Referenced by PyC_FileAndNum_Safe().
| PyObject * PyC_FlagSet_AsString | ( | const PyC_FlagSet * | item | ) |
Definition at line 1379 of file py_capi_utils.cc.
References PyC_FlagSet::identifier, and PyC_FlagSet_AsString().
Referenced by PyC_FlagSet_AsString(), and PyC_FlagSet_ValueFromID().
| PyObject * PyC_FlagSet_FromBitfield | ( | PyC_FlagSet * | items, |
| int | flag ) |
Definition at line 1468 of file py_capi_utils.cc.
References PyC_FlagSet::identifier, PyC_FlagSet_FromBitfield(), ret, and PyC_FlagSet::value.
Referenced by bpy_bmesh_select_mode_get(), and PyC_FlagSet_FromBitfield().
| int PyC_FlagSet_ToBitfield | ( | const PyC_FlagSet * | items, |
| PyObject * | value, | ||
| int * | r_value, | ||
| const char * | error_prefix ) |
Definition at line 1418 of file py_capi_utils.cc.
References PyC_FlagSet_ToBitfield(), PyC_FlagSet_ValueFromID(), and ret.
Referenced by bpy_bmesh_select_mode_set(), bpy_bmesh_transform(), bpy_slot_from_py(), PyC_FlagSet_ToBitfield(), and pygpu_shader_info_image().
| int PyC_FlagSet_ValueFromID | ( | const PyC_FlagSet * | item, |
| const char * | identifier, | ||
| int * | r_value, | ||
| const char * | error_prefix ) |
Definition at line 1402 of file py_capi_utils.cc.
References PyC_FlagSet_AsString(), PyC_FlagSet_ValueFromID(), and PyC_FlagSet_ValueFromID_int().
Referenced by bpy_slot_from_py(), M_Noise_fractal(), M_Noise_hetero_terrain(), M_Noise_hybrid_multi_fractal(), M_Noise_multi_fractal(), M_Noise_noise(), M_Noise_noise_vector(), M_Noise_ridged_multi_fractal(), M_Noise_turbulence(), M_Noise_turbulence_vector(), M_Noise_variable_lacunarity(), M_Noise_voronoi(), PyC_FlagSet_ToBitfield(), and PyC_FlagSet_ValueFromID().
| int PyC_FlagSet_ValueFromID_int | ( | const PyC_FlagSet * | item, |
| const char * | identifier, | ||
| int * | r_value ) |
Definition at line 1390 of file py_capi_utils.cc.
References PyC_FlagSet::identifier, PyC_FlagSet_ValueFromID_int(), STREQ, and PyC_FlagSet::value.
Referenced by PyC_FlagSet_ValueFromID(), and PyC_FlagSet_ValueFromID_int().
| PyObject * PyC_FrozenSetFromStrings | ( | const char ** | strings | ) |
Definition at line 759 of file py_capi_utils.cc.
References PyC_FrozenSetFromStrings(), ret, and str.
Referenced by BPyInit__bpy_path(), and PyC_FrozenSetFromStrings().
| bool PyC_IsInterpreterActive | ( | ) |
Definition at line 1175 of file py_capi_utils.cc.
References PyC_IsInterpreterActive().
Referenced by BPY_context_dict_clear_members_array(), BPY_context_member_get(), BPY_text_free_code(), PyC_FileAndNum_Safe(), PyC_IsInterpreterActive(), PyC_LineSpit(), and PyC_StackSpit().
| void PyC_LineSpit | ( | ) |
Definition at line 617 of file py_capi_utils.cc.
References PyC_FileAndNum(), PyC_IsInterpreterActive(), and PyC_LineSpit().
Referenced by _RNA_warning(), and PyC_LineSpit().
| void PyC_List_Fill | ( | PyObject * | list, |
| PyObject * | value ) |
Definition at line 487 of file py_capi_utils.cc.
References i, and PyC_List_Fill().
Referenced by PyC_List_Fill().
| int PyC_Long_AsBool | ( | PyObject * | value | ) |
Even though Python provides a way to retrieve the boolean value for an object, in many cases it's far too relaxed, with the following examples coercing values.
In practice this is often a mistake by the script author that doesn't behave as they expect. So it's better to be more strict for attribute assignment and function arguments, only accepting True/False 0/1.
If coercing a value is desired, it can be done explicitly: data.value = bool(value)
Definition at line 1770 of file py_capi_utils.cc.
References PyC_Long_AsBool(), PyLong_AsInt, and UNLIKELY.
Referenced by bpy_bm_elem_hflag_set(), bpy_bm_elem_hide_set(), bpy_bm_elem_select_set(), bpy_bmesh_select_flush(), BPy_BMLayerItem_SetItem(), bpy_bmloopuv_pin_uv_set(), bpy_bmloopuv_select_edge_set(), bpy_bmloopuv_select_set(), bpy_bmvertskin_flag_set(), BPy_IDArray_SetItem(), bpy_prop_boolean_get_fn(), bpy_slot_from_py(), foreach_getset(), idp_from_PyBool(), idp_from_PySequence_Fast(), idprop_ui_data_update_bool_default(), PyC_Long_AsBool(), PyC_StringEnum_FindIDFromValue(), pyrna_array_contains_py(), and pyrna_py_to_prop_array_index().
| int16_t PyC_Long_AsI16 | ( | PyObject * | value | ) |
Definition at line 1796 of file py_capi_utils.cc.
References INT16_MAX, PyC_Long_AsI16(), PyLong_AsInt, and UNLIKELY.
Referenced by bpy_app_debug_value_set(), foreach_getset(), PyC_AsArray_FAST(), PyC_Long_AsI16(), and PyC_StringEnum_FindIDFromValue().
| int8_t PyC_Long_AsI8 | ( | PyObject * | value | ) |
Definition at line 1783 of file py_capi_utils.cc.
References INT8_MAX, PyC_Long_AsI8(), PyLong_AsInt, and UNLIKELY.
Referenced by foreach_getset(), PyC_AsArray_FAST(), PyC_Long_AsI8(), and PyC_StringEnum_FindIDFromValue().
| uint16_t PyC_Long_AsU16 | ( | PyObject * | value | ) |
Definition at line 1827 of file py_capi_utils.cc.
References PyC_Long_AsU16(), pyc_Long_AsUnsignedLong(), UINT16_MAX, and UNLIKELY.
Referenced by foreach_getset(), PyC_Long_AsU16(), and PyC_StringEnum_FindIDFromValue().
| uint32_t PyC_Long_AsU32 | ( | PyObject * | value | ) |
Definition at line 1840 of file py_capi_utils.cc.
References PyC_Long_AsU32(), pyc_Long_AsUnsignedLong(), UINT32_MAX, and UNLIKELY.
Referenced by C_BVHTree_FromPolygons(), PyC_Long_AsU32(), PyC_StringEnum_FindIDFromValue(), pygpu_framebuffer_clear(), pygpu_IndexBuf__tp_new(), and pygpu_select_load_id().
| uint64_t PyC_Long_AsU64 | ( | PyObject * | value | ) |
#PyLong_AsUnsignedLongLong, unlike #PyLong_AsLongLong, does not fall back to calling #PyNumber_Index when its argument is not a PyLongObject instance. To match parsing signed integer types with #PyLong_AsLongLong, this function performs the #PyNumber_Index fallback, if necessary, before calling #PyLong_AsUnsignedLongLong.
Definition at line 1853 of file py_capi_utils.cc.
References PyC_Long_AsU64().
Referenced by foreach_getset(), PyC_Long_AsU64(), and PyC_StringEnum_FindIDFromValue().
| uint8_t PyC_Long_AsU8 | ( | PyObject * | value | ) |
Unlike Python's #PyLong_AsUnsignedLong and #PyLong_AsUnsignedLongLong, these unsigned integer parsing functions fall back to calling #PyNumber_Index when their argument is not a PyLongObject. This matches Python's signed integer parsing functions which also fall back to calling #PyNumber_Index.
Definition at line 1814 of file py_capi_utils.cc.
References PyC_Long_AsU8(), pyc_Long_AsUnsignedLong(), UINT8_MAX, and UNLIKELY.
Referenced by foreach_getset(), PyC_Long_AsU8(), and PyC_StringEnum_FindIDFromValue().
|
static |
Definition at line 1748 of file py_capi_utils.cc.
References pyc_Long_AsUnsignedLong().
Referenced by PyC_Long_AsU16(), PyC_Long_AsU32(), PyC_Long_AsU8(), and pyc_Long_AsUnsignedLong().
| PyObject * PyC_MainModule_Backup | ( | ) |
PyC_MainModule_Restore MUST be called after PyC_MainModule_Backup.
Definition at line 1151 of file py_capi_utils.cc.
References PyC_MainModule_Backup().
Referenced by bpy_rna_uilayout_introspect(), bpy_run_string_impl(), PyC_MainModule_Backup(), pyc_run_string_as_py_object(), and python_script_exec().
| void PyC_MainModule_Restore | ( | PyObject * | main_mod | ) |
Definition at line 1163 of file py_capi_utils.cc.
References PyC_MainModule_Restore().
Referenced by bpy_rna_uilayout_introspect(), bpy_run_string_impl(), PyC_MainModule_Restore(), pyc_run_string_as_py_object(), and python_script_exec().
| bool PyC_NameSpace_ImportArray | ( | PyObject * | py_dict, |
| const char * | imports[] ) |
Import imports into py_dict.
| py_dict | A Python dictionary, typically used as a name-space for script execution. |
| imports | A NULL terminated array of strings. |
Definition at line 1131 of file py_capi_utils.cc.
References i, mod, and PyC_NameSpace_ImportArray().
Referenced by bpy_run_string_impl(), PyC_NameSpace_ImportArray(), and pyc_run_string_as_py_object().
| PyObject * PyC_Object_GetAttrStringArgs | ( | PyObject * | o, |
| Py_ssize_t | n, | ||
| ... ) |
Definition at line 724 of file py_capi_utils.cc.
References i, and PyC_Object_GetAttrStringArgs().
Referenced by PyC_Object_GetAttrStringArgs().
| void PyC_ObSpit | ( | const char * | name, |
| PyObject * | var ) |
Useful to print Python objects while debugging.
Definition at line 571 of file py_capi_utils.cc.
References PyC_ObSpit().
Referenced by bpy_class_free_ex(), PyC_ObSpit(), PyC_RunQuicky(), and pyrna_subtype_set_rna().
| void PyC_ObSpitStr | ( | char * | result, |
| size_t | result_maxncpy, | ||
| PyObject * | var ) |
A version of PyC_ObSpit that writes into a string (and doesn't take a name argument). Use for logging.
Definition at line 589 of file py_capi_utils.cc.
References BLI_snprintf(), PyC_ObSpitStr(), and result.
Referenced by PyC_ObSpitStr(), and pyrna_srna_ExternalType().
| int PyC_ParseBool | ( | PyObject * | o, |
| void * | p ) |
Use with PyArg_ParseTuple's "O&" formatting.
Definition at line 504 of file py_capi_utils.cc.
References ELEM, PyC_ParseBool(), and true.
Referenced by bpy_app_help_text(), bpy_blend_paths(), bpy_bm_new(), bpy_bm_update_edit_mesh(), bpy_bm_utils_edge_rotate(), bpy_bm_utils_face_join(), bpy_bm_utils_face_split(), bpy_bmelemseq_sort(), bpy_bmesh_from_mesh(), bpy_bmesh_from_object(), bpy_bmface_copy(), bpy_bmface_copy_from_face_interp(), bpy_bmloop_copy_from_face_interp(), BPy_BoolProperty(), bpy_driver_secure_code_test(), bpy_flip_name(), bpy_lib_load(), bpy_lib_write(), bpy_orphans_purge(), bpyunits_to_string(), C_BVHTree_FromObject(), C_BVHTree_FromPolygons(), M_Geometry_intersect_line_plane(), M_Geometry_intersect_line_sphere(), M_Geometry_intersect_line_sphere_2d(), M_Geometry_intersect_ray_tri(), py_find_nearest_cb(), PyC_ParseBool(), PyC_RunString_AsStringOrNone(), pygpu_offscreen_draw_view3d(), pygpu_offscreen_unbind(), pygpu_state_depth_mask_set(), pygpu_state_front_facing_set(), pygpu_state_program_point_size_set(), pygpu_state_scissor_test_set(), pyop_as_string(), and pyrna_struct_is_property_set().
| int PyC_ParseStringEnum | ( | PyObject * | o, |
| void * | p ) |
Use with PyArg_ParseTuple's "O&" formatting.
Definition at line 517 of file py_capi_utils.cc.
References e, i, PyC_ParseStringEnum(), and STREQ.
Referenced by bpy_lib_write(), bpy_resource_path(), bpy_system_resource(), bpy_user_resource(), bpy_utils_previews_load(), py_imbuf_resize(), PyC_ParseStringEnum(), pygpu_batch__tp_new(), pygpu_buffer__tp_new(), pygpu_framebuffer_read_color(), pygpu_IndexBuf__tp_new(), pygpu_interface_info_get_args(), pygpu_offscreen__tp_new(), pygpu_shader_from_builtin(), pygpu_shader_info_depth_write(), pygpu_shader_info_fragment_out(), pygpu_shader_info_image(), pygpu_shader_info_push_constant(), pygpu_shader_info_sampler(), pygpu_shader_info_vertex_in(), pygpu_state_blend_set(), pygpu_state_depth_test_set(), pygpu_state_face_culling_set(), pygpu_texture__tp_new(), pygpu_texture_clear(), and pygpu_vertformat_attr_add().
| int PyC_ParseUnicodeAsBytesAndSize | ( | PyObject * | o, |
| void * | p ) |
Use with PyArg_ParseTuple's "O&" formatting.
Expose PyC_UnicodeAsBytes in a way which is useful to the argument parser.
| o | An argument parsed to PyC_UnicodeAsBytes. |
| p | Pointer to #PyC_UnicodeAsBytes_Data. |
Definition at line 1077 of file py_capi_utils.cc.
References BLI_assert, data, PyC_ParseUnicodeAsBytesAndSize(), PyC_UnicodeAsBytesAndSize(), and UNLIKELY.
Referenced by bpy_app_icons_new_triangles_from_file(), bpy_lib_load(), bpy_lib_write(), bpy_system_resource(), bpy_user_resource(), bpy_utils_previews_load(), M_imbuf_load(), py_blf_load(), py_blf_unload(), PyC_ParseUnicodeAsBytesAndSize(), and PyC_ParseUnicodeAsBytesAndSize_OrNone().
| int PyC_ParseUnicodeAsBytesAndSize_OrNone | ( | PyObject * | o, |
| void * | p ) |
A version of PyC_ParseUnicodeAsBytesAndSize that accepts None.
Definition at line 1096 of file py_capi_utils.cc.
References BLI_assert, data, PyC_ParseUnicodeAsBytesAndSize(), PyC_ParseUnicodeAsBytesAndSize_OrNone(), and UNUSED_VARS_NDEBUG.
Referenced by bpy_rna_data_temp_data(), M_imbuf_write(), and PyC_ParseUnicodeAsBytesAndSize_OrNone().
| void * PyC_RNA_AsPointer | ( | PyObject * | value, |
| const char * | type_name ) |
Generic function to avoid depending on RNA.
Definition at line 1336 of file py_capi_utils.cc.
References PyC_RNA_AsPointer(), result, and STREQ.
Referenced by BlenderTextureShader___init__(), bpy_bm_from_edit_mesh(), bpy_bm_update_edit_mesh(), bpy_bmesh_from_mesh(), bpy_bmesh_from_object(), bpy_bmesh_to_mesh(), C_BVHTree_FromObject(), PyC_RNA_AsPointer(), pygpu_offscreen_draw_view3d(), and pygpu_texture_from_image().
|
static |
Definition at line 1495 of file py_capi_utils.cc.
References i, mod, PyC_DefaultNameSpace(), PyC_MainModule_Backup(), PyC_MainModule_Restore(), PyC_NameSpace_ImportArray(), and pyc_run_string_as_py_object().
Referenced by pyc_run_string_as_py_object(), PyC_RunString_AsIntPtr(), PyC_RunString_AsNumber(), PyC_RunString_AsStringAndSize(), and PyC_RunString_AsStringAndSizeOrNone().
| void PyC_RunQuicky | ( | const char * | filepath, |
| int | n, | ||
| ... ) |
Definition at line 1187 of file py_capi_utils.cc.
References i, printf, PyC_DefaultNameSpace(), PyC_ObSpit(), PyC_RunQuicky(), and ret.
Referenced by PyC_RunQuicky().
| bool PyC_RunString_AsIntPtr | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| intptr_t * | r_value ) |
Definition at line 1578 of file py_capi_utils.cc.
References BLI_assert, pyc_run_string_as_py_object(), and PyC_RunString_AsIntPtr().
Referenced by BPY_run_string_as_intptr(), PyC_RunString_AsIntPtr(), and PyC_RunString_AsIntPtr().
| bool PyC_RunString_AsNumber | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| double * | r_value ) |
Definition at line 1532 of file py_capi_utils.cc.
References BLI_assert, i, pyc_run_string_as_py_object(), and PyC_RunString_AsNumber().
Referenced by BPY_run_string_as_number(), bpyunits_to_value(), PyC_RunString_AsNumber(), and PyC_RunString_AsNumber().
| bool PyC_RunString_AsString | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| char ** | r_value ) |
Definition at line 1632 of file py_capi_utils.cc.
References PyC_RunString_AsString(), and PyC_RunString_AsStringAndSize().
Referenced by PyC_RunString_AsString(), and PyC_RunString_AsString().
| bool PyC_RunString_AsStringAndSize | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| char ** | r_value, | ||
| size_t * | r_value_size ) |
Definition at line 1603 of file py_capi_utils.cc.
References BLI_assert, MEM_malloc_arrayN(), pyc_run_string_as_py_object(), and PyC_RunString_AsStringAndSize().
Referenced by BPY_run_string_as_string_and_len(), PyC_RunString_AsString(), PyC_RunString_AsStringAndSize(), and PyC_RunString_AsStringAndSize().
| bool PyC_RunString_AsStringAndSizeOrNone | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| char ** | r_value, | ||
| size_t * | r_value_size ) |
Definition at line 1641 of file py_capi_utils.cc.
References BLI_assert, MEM_malloc_arrayN(), pyc_run_string_as_py_object(), and PyC_RunString_AsStringAndSizeOrNone().
Referenced by BPY_run_string_as_string_and_len_or_none(), PyC_RunString_AsStringAndSizeOrNone(), PyC_RunString_AsStringAndSizeOrNone(), and PyC_RunString_AsStringOrNone().
| bool PyC_RunString_AsStringOrNone | ( | const char * | imports[], |
| const char * | expr, | ||
| const char * | filename, | ||
| char ** | r_value ) |
Definition at line 1677 of file py_capi_utils.cc.
References PyC_RunString_AsStringAndSizeOrNone(), and PyC_RunString_AsStringOrNone().
Referenced by PyC_RunString_AsStringOrNone(), and PyC_RunString_AsStringOrNone().
| void PyC_StackSpit | ( | ) |
Definition at line 635 of file py_capi_utils.cc.
References PyC_IsInterpreterActive(), and PyC_StackSpit().
Referenced by PyC_StackSpit().
| void PyC_StdFilesFlush | ( | ) |
Flush Python's sys.stdout and sys.stderr. Errors are ignored.
Definition at line 1695 of file py_capi_utils.cc.
References BLI_assert, and PyC_StdFilesFlush().
Referenced by PyC_RunString_AsStringOrNone(), PyC_StdFilesFlush(), and python_script_exec().
| const char * PyC_StringEnum_FindIDFromValue | ( | const PyC_StringEnumItems * | items, |
| const int | value ) |
Definition at line 545 of file py_capi_utils.cc.
References i, PyC_StringEnumItems::id, and PyC_StringEnum_FindIDFromValue().
Referenced by PyC_StringEnum_FindIDFromValue(), PyC_StringEnum_FindIDFromValue(), pygpu_buffer__tp_repr(), pygpu_shader_attrs_info_get(), pygpu_state_blend_get(), pygpu_state_depth_test_get(), and pygpu_texture_format_get().
| char PyC_StructFmt_type_from_str | ( | const char * | typestr | ) |
Definition at line 1886 of file py_capi_utils.cc.
References PyC_StructFmt_type_from_str().
Referenced by gl_buffer_type_from_py_buffer(), idp_array_type_from_formatstr_and_size(), PyC_StructFmt_type_from_str(), and pygpu_IndexBuf__tp_new().
| bool PyC_StructFmt_type_is_bool | ( | char | format | ) |
Definition at line 1946 of file py_capi_utils.cc.
References PyC_StructFmt_type_is_bool().
Referenced by PyC_StructFmt_type_is_bool().
| bool PyC_StructFmt_type_is_byte | ( | char | format | ) |
Definition at line 1934 of file py_capi_utils.cc.
References PyC_StructFmt_type_is_byte().
Referenced by gl_buffer_type_from_py_buffer(), and PyC_StructFmt_type_is_byte().
| bool PyC_StructFmt_type_is_float_any | ( | char | format | ) |
Definition at line 1900 of file py_capi_utils.cc.
References PyC_StructFmt_type_is_float_any().
Referenced by gl_buffer_type_from_py_buffer(), idp_array_type_from_formatstr_and_size(), PyC_StructFmt_type_is_float_any(), and pygpu_IndexBuf__tp_new().
| bool PyC_StructFmt_type_is_int_any | ( | char | format | ) |
Definition at line 1912 of file py_capi_utils.cc.
References PyC_StructFmt_type_is_int_any().
Referenced by gl_buffer_type_from_py_buffer(), idp_array_type_from_formatstr_and_size(), and PyC_StructFmt_type_is_int_any().
| void PyC_Tuple_Fill | ( | PyObject * | tuple, |
| PyObject * | value ) |
Caller needs to ensure tuple is uninitialized. Handy for filling a tuple with None for eg.
Definition at line 476 of file py_capi_utils.cc.
References i, and PyC_Tuple_Fill().
Referenced by kdtree_nearest_to_py_and_check(), py_bvhtree_nearest_to_py_none(), py_bvhtree_raycast_to_py_none(), and PyC_Tuple_Fill().
| PyObject * PyC_Tuple_PackArray_Bool | ( | const bool * | array, |
| uint | len ) |
Definition at line 342 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_Bool().
Referenced by bpy_prop_boolean_array_set_fn(), PyC_Tuple_Pack_Bool(), PyC_Tuple_PackArray_Bool(), and PyC_Tuple_PackArray_Multi_Bool_impl().
| PyObject * PyC_Tuple_PackArray_F32 | ( | const float * | array, |
| uint | len ) |
Definition at line 306 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_F32().
Referenced by bpy_gizmo_target_get_range(), bpy_gizmo_target_get_value(), bpy_prop_float_array_set_fn(), py_rna_gizmo_handler_set_cb(), PyC_Tuple_Pack_F32(), PyC_Tuple_PackArray_F32(), and PyC_Tuple_PackArray_Multi_F32_impl().
| PyObject * PyC_Tuple_PackArray_F64 | ( | const double * | array, |
| uint | len ) |
Definition at line 315 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_F64().
Referenced by PyC_Tuple_Pack_F64(), PyC_Tuple_PackArray_F64(), and PyC_Tuple_PackArray_Multi_F64_impl().
| PyObject * PyC_Tuple_PackArray_I32 | ( | const int * | array, |
| uint | len ) |
Definition at line 324 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_I32().
Referenced by bpy_prop_int_array_set_fn(), PyC_Tuple_Pack_I32(), PyC_Tuple_PackArray_I32(), and PyC_Tuple_PackArray_Multi_I32_impl().
| PyObject * PyC_Tuple_PackArray_I32FromBool | ( | const int * | array, |
| uint | len ) |
Definition at line 333 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_I32FromBool().
Referenced by PyC_Tuple_Pack_I32FromBool(), and PyC_Tuple_PackArray_I32FromBool().
| PyObject * PyC_Tuple_PackArray_Multi_Bool | ( | const bool * | array, |
| const int | dims[], | ||
| const int | dims_len ) |
Definition at line 465 of file py_capi_utils.cc.
References PyC_Tuple_PackArray_Multi_Bool(), and PyC_Tuple_PackArray_Multi_Bool_impl().
Referenced by bpy_prop_boolean_array_set_fn(), and PyC_Tuple_PackArray_Multi_Bool().
|
static |
Definition at line 446 of file py_capi_utils.cc.
References i, len(), PyC_Tuple_PackArray_Bool(), and PyC_Tuple_PackArray_Multi_Bool_impl().
Referenced by PyC_Tuple_PackArray_Multi_Bool(), and PyC_Tuple_PackArray_Multi_Bool_impl().
| PyObject * PyC_Tuple_PackArray_Multi_F32 | ( | const float * | array, |
| const int | dims[], | ||
| const int | dims_len ) |
Definition at line 393 of file py_capi_utils.cc.
References PyC_Tuple_PackArray_Multi_F32(), and PyC_Tuple_PackArray_Multi_F32_impl().
Referenced by bpy_prop_float_array_set_fn(), and PyC_Tuple_PackArray_Multi_F32().
|
static |
Definition at line 374 of file py_capi_utils.cc.
References i, len(), PyC_Tuple_PackArray_F32(), and PyC_Tuple_PackArray_Multi_F32_impl().
Referenced by PyC_Tuple_PackArray_Multi_F32(), and PyC_Tuple_PackArray_Multi_F32_impl().
| PyObject * PyC_Tuple_PackArray_Multi_F64 | ( | const double * | array, |
| const int | dims[], | ||
| const int | dims_len ) |
Definition at line 417 of file py_capi_utils.cc.
References PyC_Tuple_PackArray_Multi_F64(), and PyC_Tuple_PackArray_Multi_F64_impl().
Referenced by PyC_Tuple_PackArray_Multi_F64().
|
static |
Definition at line 398 of file py_capi_utils.cc.
References i, len(), PyC_Tuple_PackArray_F64(), and PyC_Tuple_PackArray_Multi_F64_impl().
Referenced by PyC_Tuple_PackArray_Multi_F64(), and PyC_Tuple_PackArray_Multi_F64_impl().
| PyObject * PyC_Tuple_PackArray_Multi_I32 | ( | const int * | array, |
| const int | dims[], | ||
| const int | dims_len ) |
Definition at line 441 of file py_capi_utils.cc.
References PyC_Tuple_PackArray_Multi_I32(), and PyC_Tuple_PackArray_Multi_I32_impl().
Referenced by bpy_prop_int_array_set_fn(), and PyC_Tuple_PackArray_Multi_I32().
|
static |
Definition at line 422 of file py_capi_utils.cc.
References i, len(), PyC_Tuple_PackArray_I32(), and PyC_Tuple_PackArray_Multi_I32_impl().
Referenced by PyC_Tuple_PackArray_Multi_I32(), and PyC_Tuple_PackArray_Multi_I32_impl().
| PyObject * PyC_Tuple_PackArray_String | ( | const char ** | array, |
| uint | len ) |
Definition at line 351 of file py_capi_utils.cc.
References i, len(), and PyC_Tuple_PackArray_String().
Referenced by bpy_app_python_args_get(), and PyC_Tuple_PackArray_String().
| const char * PyC_UnicodeAsBytes | ( | PyObject * | py_str, |
| PyObject ** | r_coerce ) |
Definition at line 1027 of file py_capi_utils.cc.
References PyC_UnicodeAsBytes(), and result.
Referenced by bpy_app_binary_path_set(), init_func(), PyC_UnicodeAsBytes(), PyC_UnicodeAsBytes(), pyrna_py_to_prop(), and pyrna_WindowManager_clipboard_set().
| const char * PyC_UnicodeAsBytesAndSize | ( | PyObject * | py_str, |
| Py_ssize_t * | r_size, | ||
| PyObject ** | r_coerce ) |
String conversion, escape non-unicode chars
| r_size | The string length (not including the null terminator). |
| r_coerce | must reference a pointer set to NULL. |
Definition at line 1000 of file py_capi_utils.cc.
References PyC_UnicodeAsBytesAndSize(), and result.
Referenced by idp_from_PyUnicode(), py_imbuf_filepath_set(), PyC_ParseUnicodeAsBytesAndSize(), and PyC_UnicodeAsBytesAndSize().
| PyObject * PyC_UnicodeFromBytes | ( | const char * | str | ) |
Create a str from bytes in a way which is compatible with non UTF8 encoded file-system paths, see: #111033. Follow http://www.python.org/dev/peps/pep-0383/
Definition at line 1067 of file py_capi_utils.cc.
References PyC_UnicodeFromBytes(), PyC_UnicodeFromBytesAndSize(), and str.
Referenced by bpy_app_autoexec_fail_message_get(), bpy_app_binary_path_get(), bpy_app_tempdir_get(), bpy_blend_foreach_path_cb(), foreach_id_file_path_map(), foreach_id_file_path_map_callback(), Freestyle_Init(), py_imbuf_filepath_get(), PyC_DefaultNameSpace(), PyC_UnicodeFromBytes(), pyrna_struct_CreatePyObject_with_primitive_support(), python_compat_wrapper_PyRun_FileExFlags(), and python_script_exec().
| PyObject * PyC_UnicodeFromBytesAndSize | ( | const char * | str, |
| Py_ssize_t | size ) |
| size | The length of the string: strlen(str). |
Definition at line 1052 of file py_capi_utils.cc.
References PyC_UnicodeFromBytesAndSize(), result, size(), and str.
Referenced by idprop_py_from_idp_string(), PyC_UnicodeFromBytes(), PyC_UnicodeFromBytesAndSize(), PyC_UnicodeFromStdStr(), pyrna_param_to_py(), pyrna_prop_to_py(), and pyrna_WindowManager_clipboard_get().
| PyObject * PyC_UnicodeFromStdStr | ( | const std::string & | str | ) |
Create a str from std::string, wraps PyC_UnicodeFromBytesAndSize.
Definition at line 1072 of file py_capi_utils.cc.
References PyC_UnicodeFromBytesAndSize(), PyC_UnicodeFromStdStr(), and str.
Referenced by BPy_GeometrySet_get_name(), BPy_GeometrySet_repr(), BPy_init_modules(), bpy_resource_path(), bpy_script_paths(), bpy_system_resource(), bpy_user_resource(), blender::render::hydra::cache_or_get_image_file_func(), PyC_UnicodeFromStdStr(), pygpu_interface_info_name_get(), pyop_as_string(), pyrna_prop_path_from_id(), pyrna_struct_getattro(), pyrna_struct_path_from_id(), SShape_name_get(), StrokeAttribute_repr(), ViewShape_library_path_get(), and ViewShape_name_get().
| PyObject ATTR_WARN_UNUSED_RESULT |
Definition at line 1494 of file py_capi_utils.cc.