|
Blender V4.3
|
#include <algorithm>#include <Python.h>#include "MEM_guardedalloc.h"#include "BLI_utildefines.h"#include "idprop_py_api.hh"#include "idprop_py_ui_api.hh"#include "BKE_idprop.hh"#include "DNA_ID.h"#include "py_capi_utils.hh"#include "python_utildefines.hh"Go to the source code of this file.
Macros | |
| #define | USE_STRING_COERCE |
| #define | SHARED_MEMBER_SET(member, value) |
| #define | SHARED_MEMBER_SET(member, value) |
Functions | |
| bool | pyrna_id_FromPyObject (PyObject *obj, ID **id) |
| PyObject * | pyrna_id_CreatePyObject (ID *id) |
| bool | pyrna_id_CheckPyObject (PyObject *obj) |
Initialize Types | |
| static PyObject * | BPy_IDGroup_ViewKeys_CreatePyObject (BPy_IDProperty *group) |
| static PyObject * | BPy_IDGroup_ViewValues_CreatePyObject (BPy_IDProperty *group) |
| static PyObject * | BPy_IDGroup_ViewItems_CreatePyObject (BPy_IDProperty *group) |
| static BPy_IDGroup_View * | IDGroup_View_New_WithType (BPy_IDProperty *group, PyTypeObject *type) |
| void | IDProp_Init_Types () |
Python from ID-Property (Internal Conversions) | |
Low level conversion to avoid duplicate code, no type checking. | |
| static PyObject * | idprop_py_from_idp_string (const IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_int (const IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_float (const IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_double (const IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_bool (const IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_group (ID *id, IDProperty *prop, IDProperty *parent) |
| static PyObject * | idprop_py_from_idp_id (IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_array (ID *id, IDProperty *prop) |
| static PyObject * | idprop_py_from_idp_idparray (ID *id, IDProperty *prop) |
ID-Property from Python (Internal Conversions) | |
| static IDProperty * | idp_from_PyFloat (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
| static IDProperty * | idp_from_PyBool (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
| static IDProperty * | idp_from_PyLong (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
| static IDProperty * | idp_from_PyUnicode (IDProperty *prop_exist, const char *name, PyObject *ob, const bool, const bool can_create) |
| static IDProperty * | idp_from_PyBytes (IDProperty *prop_exist, const char *name, PyObject *ob, const bool, const bool can_create) |
| static int | idp_array_type_from_formatstr_and_size (const char *typestr, Py_ssize_t itemsize) |
| static const char * | idp_format_from_array_type (int type) |
| static IDProperty * | idp_from_PySequence_Buffer (IDProperty *prop_exist, const char *name, Py_buffer &buffer, const int idp_type, const bool, const bool can_create) |
| static IDProperty * | idp_from_PySequence_Fast (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
| static IDProperty * | idp_from_PySequence (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
| static IDProperty * | idp_from_PyMapping (IDProperty *, const char *name, PyObject *ob, const bool, const bool) |
| static IDProperty * | idp_from_DatablockPointer (IDProperty *prop_exist, const char *name, PyObject *ob, const bool, const bool can_create) |
| static IDProperty * | idp_from_PyObject (IDProperty *prop_exist, const char *name, PyObject *ob, const bool do_conversion, const bool can_create) |
Mapping Get/Set (Internal Access) | |
| bool | BPy_IDProperty_Map_ValidateAndCreate (PyObject *name_obj, IDProperty *group, PyObject *ob) |
| int | BPy_Wrap_SetMapItem (IDProperty *prop, PyObject *key, PyObject *val) |
| static int | BPy_IDGroup_Map_SetItem (BPy_IDProperty *self, PyObject *key, PyObject *val) |
| static PyObject * | BPy_IDGroup_iter (BPy_IDProperty *self) |
| PyObject * | BPy_IDGroup_MapDataToPy (IDProperty *prop) |
Variables | |
ID-Property Group Type | |
| static PySequenceMethods | BPy_IDGroup_Seq |
| static PyMappingMethods | BPy_IDGroup_Mapping |
| PyTypeObject | BPy_IDGroup_Type |
ID Array Type | |
| PyTypeObject | BPy_IDArray_Type |
IDProp Group Access | |
| static PyGetSetDef | BPy_IDGroup_getseters [] |
| static Py_hash_t | BPy_IDGroup_hash (BPy_IDProperty *self) |
| static PyObject * | BPy_IDGroup_repr (BPy_IDProperty *self) |
| PyObject * | BPy_IDGroup_WrapData (ID *id, IDProperty *prop, IDProperty *parent) |
| static PyObject * | BPy_IDGroup_GetName (BPy_IDProperty *self, void *) |
| static int | BPy_IDGroup_SetName (BPy_IDProperty *self, PyObject *value, void *) |
| static Py_ssize_t | BPy_IDGroup_Map_Len (BPy_IDProperty *self) |
| static PyObject * | BPy_IDGroup_Map_GetItem (BPy_IDProperty *self, PyObject *item) |
| static char | idp_sequence_type (PyObject *seq_fast) |
| static const char * | idp_try_read_name (PyObject *name_obj) |
ID-Property Group View Types (Keys/Values/Items) | |
This view types is a thin wrapper on keys/values/items, this matches Python's There are some less common features this type could support (matching Python's TODO:
| |
| static PySequenceMethods | BPy_IDGroup_ViewKeys_as_sequence |
| static PySequenceMethods | BPy_IDGroup_ViewValues_as_sequence |
| static PySequenceMethods | BPy_IDGroup_ViewItems_as_sequence |
| static PyMethodDef | BPy_IDGroup_View_methods [] |
| PyTypeObject | BPy_IDGroup_ViewKeys_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
| PyTypeObject | BPy_IDGroup_ViewValues_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
| PyTypeObject | BPy_IDGroup_ViewItems_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
| static PyObject * | BPy_IDGroup_View_repr (BPy_IDGroup_View *self) |
| static void | BPy_IDGroup_View_dealloc (BPy_IDGroup_View *self) |
| static int | BPy_IDGroup_View_traverse (BPy_IDGroup_View *self, visitproc visit, void *arg) |
| static int | BPy_IDGroup_View_clear (BPy_IDGroup_View *self) |
| static int | BPy_IDGroup_View_is_gc (BPy_IDGroup_View *self) |
| static PyObject * | BPy_Group_ViewKeys_iter (BPy_IDGroup_View *self) |
| static PyObject * | BPy_Group_ViewValues_iter (BPy_IDGroup_View *self) |
| static PyObject * | BPy_Group_ViewItems_iter (BPy_IDGroup_View *self) |
| static Py_ssize_t | BPy_Group_View_len (BPy_IDGroup_View *self) |
| static int | BPy_Group_ViewKeys_Contains (BPy_IDGroup_View *self, PyObject *value) |
| static int | BPy_Group_ViewValues_Contains (BPy_IDGroup_View *self, PyObject *value) |
| static int | BPy_Group_ViewItems_Contains (BPy_IDGroup_View *self, PyObject *value) |
| PyDoc_STRVAR (BPy_IDGroup_View_reversed_doc, "Return a reverse iterator over the ID Property keys values or items.") | |
| static PyObject * | BPy_IDGroup_View_reversed (BPy_IDGroup_View *self, PyObject *) |
| static void | IDGroup_View_init_type () |
ID-Property Group Methods | |
| static PyMethodDef | BPy_IDGroup_methods [] |
| static int | BPy_IDGroup_Contains (BPy_IDProperty *self, PyObject *value) |
| PyDoc_STRVAR (BPy_IDGroup_pop_doc, ".. method:: pop(key, default)\n" "\n" " Remove an item from the group, returning a Python representation.\n" "\n" " :raises KeyError: When the item doesn't exist.\n" "\n" " :arg key: Name of item to remove.\n" " :type key: str\n" " :arg default: Value to return when key isn't found, otherwise raise an exception.\n" " :type default: Any\n") | |
| static PyObject * | BPy_IDGroup_pop (BPy_IDProperty *self, PyObject *args) |
| static void | BPy_IDGroup_CorrectListLen (IDProperty *prop, PyObject *seq, int len, const char *func) |
| PyObject * | BPy_Wrap_GetKeys (IDProperty *prop) |
| PyObject * | BPy_Wrap_GetValues (ID *id, IDProperty *prop) |
| PyObject * | BPy_Wrap_GetItems (ID *id, IDProperty *prop) |
| PyObject * | BPy_Wrap_GetKeys_View_WithID (ID *id, IDProperty *prop) |
| PyObject * | BPy_Wrap_GetValues_View_WithID (ID *id, IDProperty *prop) |
| PyObject * | BPy_Wrap_GetItems_View_WithID (ID *id, IDProperty *prop) |
| PyDoc_STRVAR (BPy_IDGroup_keys_doc, ".. method:: keys()\n" "\n" " Return the keys associated with this group as a list of strings.\n") | |
| static PyObject * | BPy_IDGroup_keys (BPy_IDProperty *self) |
| PyDoc_STRVAR (BPy_IDGroup_values_doc, ".. method:: values()\n" "\n" " Return the values associated with this group.\n") | |
| static PyObject * | BPy_IDGroup_values (BPy_IDProperty *self) |
| PyDoc_STRVAR (BPy_IDGroup_items_doc, ".. method:: items()\n" "\n" " Iterate through the items in the dict; behaves like dictionary method items.\n") | |
| static PyObject * | BPy_IDGroup_items (BPy_IDProperty *self) |
| PyDoc_STRVAR (BPy_IDGroup_update_doc, ".. method:: update(other)\n" "\n" " Update key, values.\n" "\n" " :arg other: Updates the values in the group with this.\n" " :type other: :class:`IDPropertyGroup` | dict[str, Any]\n") | |
| static PyObject * | BPy_IDGroup_update (BPy_IDProperty *self, PyObject *value) |
| PyDoc_STRVAR (BPy_IDGroup_to_dict_doc, ".. method:: to_dict()\n" "\n" " Return a purely Python version of the group.\n") | |
| static PyObject * | BPy_IDGroup_to_dict (BPy_IDProperty *self) |
| PyDoc_STRVAR (BPy_IDGroup_clear_doc, ".. method:: clear()\n" "\n" " Clear all members from this group.\n") | |
| static PyObject * | BPy_IDGroup_clear (BPy_IDProperty *self) |
| PyDoc_STRVAR (BPy_IDGroup_get_doc, ".. method:: get(key, default=None)\n" "\n" " Return the value for key, if it exists, else default.\n") | |
| static PyObject * | BPy_IDGroup_get (BPy_IDProperty *self, PyObject *args) |
ID Array Methods | |
| static PyGetSetDef | BPy_IDArray_getseters [] |
| static PyMethodDef | BPy_IDArray_methods [] |
| static PySequenceMethods | BPy_IDArray_Seq |
| static PyMappingMethods | BPy_IDArray_AsMapping |
| static PyBufferProcs | BPy_IDArray_Buffer |
| static PyTypeObject * | idp_array_py_type (BPy_IDArray *self, size_t *elem_size) |
| static PyObject * | BPy_IDArray_repr (BPy_IDArray *self) |
| PyDoc_STRVAR (BPy_IDArray_get_typecode_doc, "The type of the data in the array {'f': float, 'd': double, 'i': int, 'b': bool}.") | |
| static PyObject * | BPy_IDArray_get_typecode (BPy_IDArray *self, void *) |
| PyDoc_STRVAR (BPy_IDArray_to_list_doc, ".. method:: to_list()\n" "\n" " Return the array as a list.\n") | |
| static PyObject * | BPy_IDArray_to_list (BPy_IDArray *self) |
| static Py_ssize_t | BPy_IDArray_Len (BPy_IDArray *self) |
| static PyObject * | BPy_IDArray_GetItem (BPy_IDArray *self, Py_ssize_t index) |
| static int | BPy_IDArray_SetItem (BPy_IDArray *self, Py_ssize_t index, PyObject *value) |
| static PyObject * | BPy_IDArray_slice (BPy_IDArray *self, int begin, int end) |
| static int | BPy_IDArray_ass_slice (BPy_IDArray *self, int begin, int end, PyObject *seq) |
| static PyObject * | BPy_IDArray_subscript (BPy_IDArray *self, PyObject *item) |
| static int | BPy_IDArray_ass_subscript (BPy_IDArray *self, PyObject *item, PyObject *value) |
| static int | itemsize_by_idarray_type (int array_type) |
| static int | BPy_IDArray_getbuffer (BPy_IDArray *self, Py_buffer *view, int flags) |
| static void | BPy_IDArray_releasebuffer (BPy_IDArray *, Py_buffer *view) |
Public Module 'idprop.types' | |
| static PyModuleDef | IDProp_types_module_def |
| static PyObject * | BPyInit_idprop_types () |
Public Module 'idprop' | |
| static PyMethodDef | IDProp_methods [] |
| static PyModuleDef | IDProp_module_def |
| PyDoc_STRVAR (IDProp_module_doc, "This module provides access id property types (currently mainly for docs).") | |
| PyObject * | BPyInit_idprop () |
| #define SHARED_MEMBER_SET | ( | member, | |
| value ) |
Referenced by IDGroup_Iter_init_type(), and IDGroup_View_init_type().
| #define SHARED_MEMBER_SET | ( | member, | |
| value ) |
| #define USE_STRING_COERCE |
Definition at line 24 of file idprop_py_api.cc.
|
static |
Definition at line 1329 of file idprop_py_api.cc.
References self.
Referenced by BPy_Group_IterItems_next(), BPy_Group_IterKeys_next(), and BPy_Group_IterValues_next().
|
static |
Definition at line 1368 of file idprop_py_api.cc.
References BPy_Group_Iter_same_size_or_raise_error(), BPy_IDGroup_WrapData(), IDProperty::name, IDProperty::next, IDProperty::prev, PyTuple_SET_ITEMS, ret, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1338 of file idprop_py_api.cc.
References BPy_Group_Iter_same_size_or_raise_error(), IDProperty::name, IDProperty::next, IDProperty::prev, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1353 of file idprop_py_api.cc.
References BPy_Group_Iter_same_size_or_raise_error(), BPy_IDGroup_WrapData(), IDProperty::next, IDProperty::prev, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1531 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 1559 of file idprop_py_api.cc.
|
static |
Definition at line 1526 of file idprop_py_api.cc.
References BPy_IDGroup_IterItems_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1539 of file idprop_py_api.cc.
References BPy_IDGroup_Contains(), and self.
|
static |
Definition at line 1516 of file idprop_py_api.cc.
References BPy_IDGroup_IterKeys_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1547 of file idprop_py_api.cc.
|
static |
Definition at line 1521 of file idprop_py_api.cc.
References BPy_IDGroup_IterValues_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 2309 of file idprop_py_api.cc.
References CLAMP, IDP_Array, idp_array_py_type(), IDProperty::len, MEM_freeN(), MEM_mallocN, PyC_AsArray(), self, and size().
Referenced by BPy_IDArray_ass_subscript().
|
static |
Definition at line 2377 of file idprop_py_api.cc.
References BPy_IDArray_ass_slice(), BPy_IDArray_SetItem(), and self.
|
static |
Definition at line 2108 of file idprop_py_api.cc.
References IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, and self.
|
static |
Definition at line 2432 of file idprop_py_api.cc.
References IDP_Array, idp_format_from_array_type(), itemsize_by_idarray_type(), IDProperty::len, MEM_mallocN, self, and IDProperty::subtype.
|
static |
Definition at line 2176 of file idprop_py_api.cc.
References IDP_Array, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, and self.
Referenced by BPy_IDArray_subscript().
|
static |
Definition at line 2171 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 2452 of file idprop_py_api.cc.
References MEM_freeN().
|
static |
Definition at line 2099 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 2200 of file idprop_py_api.cc.
References float, IDP_Array, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, PyC_Long_AsBool(), and self.
Referenced by BPy_IDArray_ass_subscript().
|
static |
Definition at line 2260 of file idprop_py_api.cc.
References CLAMP, count, IDP_Array, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, IDProperty::len, self, and IDProperty::subtype.
Referenced by BPy_IDArray_subscript().
|
static |
Definition at line 2339 of file idprop_py_api.cc.
References BPy_IDArray_GetItem(), BPy_IDArray_slice(), and self.
|
static |
Definition at line 2152 of file idprop_py_api.cc.
References BPy_IDGroup_MapDataToPy(), and self.
|
static |
Definition at line 1938 of file idprop_py_api.cc.
References IDP_ClearProperty(), and self.
|
static |
Definition at line 1867 of file idprop_py_api.cc.
References IDP_GetPropertyFromGroup(), and self.
Referenced by BPy_Group_ViewKeys_Contains().
|
static |
Definition at line 1721 of file idprop_py_api.cc.
References IDProperty::len, len, and printf.
Referenced by BPy_Wrap_GetItems(), BPy_Wrap_GetKeys(), and BPy_Wrap_GetValues().
|
static |
Definition at line 1950 of file idprop_py_api.cc.
References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), and self.
|
static |
Definition at line 252 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 143 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 1862 of file idprop_py_api.cc.
References BPy_IDGroup_ViewItems_CreatePyObject(), and self.
|
static |
Definition at line 1160 of file idprop_py_api.cc.
References BPy_IDGroup_ViewKeys_CreatePyObject(), ret, and self.
|
static |
Definition at line 1318 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1303 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1324 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1295 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1312 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1459 of file idprop_py_api.cc.
References BPy_IDGroup_IterItems_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewItems_iter().
|
static |
Definition at line 1449 of file idprop_py_api.cc.
References BPy_IDGroup_IterKeys_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewKeys_iter().
|
static |
Definition at line 1454 of file idprop_py_api.cc.
References BPy_IDGroup_IterValues_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewValues_iter().
|
static |
Definition at line 1840 of file idprop_py_api.cc.
References BPy_IDGroup_ViewKeys_CreatePyObject(), and self.
|
static |
Definition at line 304 of file idprop_py_api.cc.
References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), IDP_GROUP, and self.
|
static |
Definition at line 294 of file idprop_py_api.cc.
|
static |
Definition at line 1155 of file idprop_py_api.cc.
References BPy_Wrap_SetMapItem(), and self.
Referenced by BPy_IDGroup_update().
| PyObject * BPy_IDGroup_MapDataToPy | ( | IDProperty * | prop | ) |
For simple, non nested types this is the same as BPy_IDGroup_WrapData.
Definition at line 1174 of file idprop_py_api.cc.
References BPy_IDGroup_MapDataToPy(), IDProperty::data, ListBase::first, IDPropertyData::group, IDP_ARRAY, IDP_Array, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_IDPArray, IDP_INT, IDP_STRING, idprop_py_from_idp_bool(), idprop_py_from_idp_double(), idprop_py_from_idp_float(), idprop_py_from_idp_id(), idprop_py_from_idp_int(), idprop_py_from_idp_string(), IDProperty::len, IDProperty::name, IDProperty::next, IDProperty::subtype, IDProperty::type, UNLIKELY, and wrap().
Referenced by BPy_IDArray_to_list(), BPy_IDGroup_MapDataToPy(), BPy_IDGroup_pop(), BPy_IDGroup_to_dict(), and pyrna_struct_pop().
|
static |
Definition at line 1688 of file idprop_py_api.cc.
References BPy_IDGroup_MapDataToPy(), IDP_FreeFromGroup(), IDP_GetPropertyFromGroup(), and self.
|
static |
Definition at line 148 of file idprop_py_api.cc.
References self.
|
static |
Definition at line 257 of file idprop_py_api.cc.
References MAX_IDPROP_NAME, and self.
|
static |
Definition at line 1927 of file idprop_py_api.cc.
References BPy_IDGroup_MapDataToPy(), and self.
|
static |
Definition at line 1889 of file idprop_py_api.cc.
References BPy_IDGroup_Check, BPy_IDGroup_Map_SetItem(), IDP_MergeGroup(), self, and UNLIKELY.
|
static |
Definition at line 1851 of file idprop_py_api.cc.
References BPy_IDGroup_ViewValues_CreatePyObject(), and self.
|
static |
Definition at line 1503 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1488 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1509 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1480 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1611 of file idprop_py_api.cc.
References IDGroup_View_New_WithType(), result, and self.
|
static |
Definition at line 1497 of file idprop_py_api.cc.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 2575 of file idprop_py_api.cc.
References BPy_IDGroup_ViewItems_Type, and IDGroup_View_New_WithType().
Referenced by BPy_IDGroup_items(), and BPy_Wrap_GetItems_View_WithID().
|
static |
Definition at line 2565 of file idprop_py_api.cc.
References BPy_IDGroup_ViewKeys_Type, and IDGroup_View_New_WithType().
Referenced by BPy_IDGroup_iter(), BPy_IDGroup_keys(), and BPy_Wrap_GetKeys_View_WithID().
|
static |
Definition at line 2570 of file idprop_py_api.cc.
References BPy_IDGroup_ViewValues_Type, and IDGroup_View_New_WithType().
Referenced by BPy_IDGroup_values(), and BPy_Wrap_GetValues_View_WithID().
| PyObject * BPy_IDGroup_WrapData | ( | ID * | id, |
| IDProperty * | prop, | ||
| IDProperty * | parent ) |
Definition at line 156 of file idprop_py_api.cc.
References IDP_ARRAY, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_INT, IDP_STRING, idprop_py_from_idp_array(), idprop_py_from_idp_bool(), idprop_py_from_idp_double(), idprop_py_from_idp_float(), idprop_py_from_idp_group(), idprop_py_from_idp_id(), idprop_py_from_idp_idparray(), idprop_py_from_idp_int(), idprop_py_from_idp_string(), and IDProperty::type.
Referenced by BPy_Group_IterItems_next(), BPy_Group_IterValues_next(), BPy_IDGroup_get(), BPy_IDGroup_Map_GetItem(), BPy_Wrap_GetItems(), BPy_Wrap_GetValues(), idprop_py_from_idp_idparray(), pyrna_struct_get(), and pyrna_struct_subscript().
| bool BPy_IDProperty_Map_ValidateAndCreate | ( | PyObject * | key, |
| IDProperty * | group, | ||
| PyObject * | ob ) |
Definition at line 1048 of file idprop_py_api.cc.
References BLI_assert, ELEM, IDProperty::flag, IDP_AppendArray(), IDP_FLAG_OVERRIDABLE_LIBRARY, IDP_FLAG_STATIC_TYPE, idp_from_PyObject(), IDP_GetPropertyFromGroup(), IDP_IDPARRAY, IDP_ReplaceInGroup_ex(), idp_try_read_name(), IDP_TryConvertUIData(), IDP_type_str(), IDP_ui_data_type(), MEM_freeN(), and IDProperty::ui_data.
Referenced by BPy_Wrap_SetMapItem(), idp_from_PyMapping(), and idp_from_PySequence_Fast().
| PyObject * BPy_Wrap_GetItems | ( | ID * | id, |
| IDProperty * | prop ) |
Definition at line 1785 of file idprop_py_api.cc.
References BPy_IDGroup_CorrectListLen(), BPy_IDGroup_WrapData(), BPy_Wrap_GetItems(), IDProperty::data, ListBase::first, IDPropertyData::group, IDProperty::len, IDProperty::name, IDProperty::next, and PyTuple_SET_ITEMS.
Referenced by BPy_Wrap_GetItems().
| PyObject * BPy_Wrap_GetItems_View_WithID | ( | ID * | id, |
| IDProperty * | prop ) |
Definition at line 1826 of file idprop_py_api.cc.
References BPy_IDGroup_ViewItems_CreatePyObject(), idprop_py_from_idp_group(), ret, and self.
Referenced by pyrna_struct_items().
| PyObject * BPy_Wrap_GetKeys | ( | IDProperty * | prop | ) |
Definition at line 1736 of file idprop_py_api.cc.
References BPy_IDGroup_CorrectListLen(), BPy_Wrap_GetKeys(), IDProperty::data, ListBase::first, IDPropertyData::group, IDProperty::len, IDProperty::name, and IDProperty::next.
Referenced by BPy_Wrap_GetKeys().
| PyObject * BPy_Wrap_GetKeys_View_WithID | ( | ID * | id, |
| IDProperty * | prop ) |
Definition at line 1810 of file idprop_py_api.cc.
References BPy_IDGroup_ViewKeys_CreatePyObject(), idprop_py_from_idp_group(), ret, and self.
Referenced by pyrna_struct_keys().
| PyObject * BPy_Wrap_GetValues | ( | ID * | id, |
| IDProperty * | prop ) |
Definition at line 1763 of file idprop_py_api.cc.
References BPy_IDGroup_CorrectListLen(), BPy_IDGroup_WrapData(), BPy_Wrap_GetValues(), IDProperty::data, ListBase::first, IDPropertyData::group, IDProperty::len, and IDProperty::next.
Referenced by BPy_Wrap_GetValues().
| PyObject * BPy_Wrap_GetValues_View_WithID | ( | ID * | id, |
| IDProperty * | prop ) |
Definition at line 1818 of file idprop_py_api.cc.
References BPy_IDGroup_ViewValues_CreatePyObject(), idprop_py_from_idp_group(), ret, and self.
Referenced by pyrna_struct_values().
| int BPy_Wrap_SetMapItem | ( | IDProperty * | prop, |
| PyObject * | key, | ||
| PyObject * | val ) |
Definition at line 1119 of file idprop_py_api.cc.
References BPy_IDProperty_Map_ValidateAndCreate(), IDP_FreeFromGroup(), IDP_GetPropertyFromGroup(), IDP_GROUP, and IDProperty::type.
Referenced by BPy_IDGroup_Map_SetItem(), and pyrna_struct_ass_subscript().
| PyObject * BPyInit_idprop | ( | ) |
Definition at line 2649 of file idprop_py_api.cc.
References BPyInit_idprop_types(), IDProp_module_def, and mod().
|
static |
Definition at line 2598 of file idprop_py_api.cc.
References BPy_IDArray_Type, BPy_IDGroup_IterItems_Type, BPy_IDGroup_IterKeys_Type, BPy_IDGroup_IterValues_Type, BPy_IDGroup_Type, BPy_IDGroup_ViewItems_Type, BPy_IDGroup_ViewKeys_Type, BPy_IDGroup_ViewValues_Type, IDProp_Init_Types(), IDProp_types_module_def, and IDPropertyUIData_Init_Types().
Referenced by BPyInit_idprop().
|
static |
Definition at line 1392 of file idprop_py_api.cc.
References BPy_Group_IterItems_next(), BPy_Group_IterKeys_next(), BPy_Group_IterValues_next(), BPy_IDGroup_Iter_clear(), BPy_IDGroup_Iter_dealloc(), BPy_IDGroup_Iter_is_gc(), BPy_IDGroup_Iter_repr(), BPy_IDGroup_Iter_traverse(), BPy_IDGroup_IterItems_Type, BPy_IDGroup_IterKeys_Type, BPy_IDGroup_IterValues_Type, and SHARED_MEMBER_SET.
Referenced by IDProp_Init_Types().
|
static |
Definition at line 1426 of file idprop_py_api.cc.
References BLI_assert, IDP_GROUP, and IDProperty::len.
Referenced by BPy_IDGroup_IterItems_CreatePyObject(), BPy_IDGroup_IterKeys_CreatePyObject(), and BPy_IDGroup_IterValues_CreatePyObject().
|
static |
Definition at line 1631 of file idprop_py_api.cc.
References BPy_Group_ViewItems_iter(), BPy_Group_ViewKeys_iter(), BPy_Group_ViewValues_iter(), BPy_IDGroup_View_clear(), BPy_IDGroup_View_dealloc(), BPy_IDGroup_View_is_gc(), BPy_IDGroup_View_methods, BPy_IDGroup_View_repr(), BPy_IDGroup_View_traverse(), BPy_IDGroup_ViewItems_as_sequence, BPy_IDGroup_ViewItems_Type, BPy_IDGroup_ViewKeys_as_sequence, BPy_IDGroup_ViewKeys_Type, BPy_IDGroup_ViewValues_as_sequence, BPy_IDGroup_ViewValues_Type, and SHARED_MEMBER_SET.
Referenced by IDProp_Init_Types().
|
static |
group may be nullptr, unlike most other uses of this argument. This is supported so RNA keys/values/items methods returns an iterator with the expected type:Definition at line 2551 of file idprop_py_api.cc.
References BLI_assert, and IDP_GROUP.
Referenced by BPy_IDGroup_View_reversed(), BPy_IDGroup_ViewItems_CreatePyObject(), BPy_IDGroup_ViewKeys_CreatePyObject(), and BPy_IDGroup_ViewValues_CreatePyObject().
|
static |
Definition at line 2078 of file idprop_py_api.cc.
References double(), float, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, int, and self.
Referenced by BPy_IDArray_ass_slice().
|
static |
Definition at line 625 of file idprop_py_api.cc.
References IDP_DOUBLE, IDP_FLOAT, IDP_INT, PyC_StructFmt_type_from_str(), PyC_StructFmt_type_is_float_any(), and PyC_StructFmt_type_is_int_any().
Referenced by idp_from_PySequence().
|
static |
Definition at line 647 of file idprop_py_api.cc.
References IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, and IDP_INT.
Referenced by BPy_IDArray_getbuffer().
|
static |
Definition at line 974 of file idprop_py_api.cc.
References blender::bke::idprop::create(), ID_FLAG_EMBEDDED_DATA, IDP_AssignID(), IDP_ID, pyrna_id_FromPyObject(), and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 468 of file idprop_py_api.cc.
References blender::bke::idprop::create_bool(), IDP_ARRAY, IDP_Bool, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_INT, IDP_Int, IDP_STRING, int, PyC_Long_AsBool(), and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 596 of file idprop_py_api.cc.
References IDP_AssignStringMaxSize(), IDP_New(), IDP_STRING, IDP_STRING_SUB_BYTE, int, IDPropertyTemplate::len, IDPropertyTemplate::str, IDPropertyTemplate::string, IDProperty::subtype, IDPropertyTemplate::subtype, and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
The idp_from_Py* functions expect that the input type has been checked before and return nullptr if the IDProperty can't be created.
| prop_exist | If not null, attempt to assign given ob value to this property first, and only create a new one if not possible. If no assignment (or conversion and assignment) is possible, the current value remains unchanged. |
| do_conversion | If true, allow some 'reasonable' conversion of input value to match the prop_exist property type. E.g. can convert an int to a float, but not the other way around. |
| can_create | Whether creating a new IDProperty is allowed. |
prop_exist if given and it could be assigned given ob value, a new IDProperty otherwise. Definition at line 431 of file idprop_py_api.cc.
References blender::bke::idprop::create(), float, IDP_ARRAY, IDP_BOOLEAN, IDP_DOUBLE, IDP_Double, IDP_FLOAT, IDP_Float, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_INT, IDP_STRING, and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 505 of file idprop_py_api.cc.
References blender::bke::idprop::create(), double(), float, IDP_ARRAY, IDP_BOOLEAN, IDP_DOUBLE, IDP_Double, IDP_FLOAT, IDP_Float, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_INT, IDP_Int, IDP_STRING, and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 934 of file idprop_py_api.cc.
References BPy_IDProperty_Map_ValidateAndCreate(), blender::bke::idprop::create_group(), IDP_FreeProperty(), and len.
Referenced by idp_from_PyObject().
|
static |
Definition at line 1002 of file idprop_py_api.cc.
References idp_from_DatablockPointer(), idp_from_PyBool(), idp_from_PyBytes(), idp_from_PyFloat(), idp_from_PyLong(), idp_from_PyMapping(), idp_from_PySequence(), idp_from_PyUnicode(), and pyrna_id_CheckPyObject().
Referenced by BPy_IDProperty_Map_ValidateAndCreate().
|
static |
Definition at line 880 of file idprop_py_api.cc.
References idp_array_type_from_formatstr_and_size(), idp_from_PySequence_Buffer(), idp_from_PySequence_Fast(), IDProperty::len, and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 664 of file idprop_py_api.cc.
References IDPropertyTemplate::array, BLI_assert, IDP_ARRAY, IDP_Array, IDP_New(), IDProperty::len, IDPropertyTemplate::len, IDProperty::subtype, IDProperty::type, and IDPropertyTemplate::type.
Referenced by idp_from_PySequence().
|
static |
Definition at line 692 of file idprop_py_api.cc.
References IDPropertyTemplate::array, BLI_assert_unreachable, BPy_IDProperty_Map_ValidateAndCreate(), ELEM, IDP_ARRAY, IDP_Array, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_FreeProperty(), IDP_IDPARRAY, IDP_INT, IDP_New(), IDP_NewIDPArray(), idp_sequence_type(), IDProperty::len, IDPropertyTemplate::len, PyC_Long_AsBool(), IDProperty::subtype, IDProperty::type, and IDPropertyTemplate::type.
Referenced by idp_from_PySequence().
|
static |
Definition at line 556 of file idprop_py_api.cc.
References IDP_AssignStringMaxSize(), IDP_New(), IDP_STRING, IDP_STRING_SUB_UTF8, int, IDPropertyTemplate::len, PyC_UnicodeAsBytesAndSize(), IDPropertyTemplate::str, IDPropertyTemplate::string, IDProperty::subtype, IDPropertyTemplate::subtype, and IDProperty::type.
Referenced by idp_from_PyObject().
|
static |
Definition at line 333 of file idprop_py_api.cc.
References ELEM, IDP_BOOLEAN, IDP_DOUBLE, IDP_IDPARRAY, IDP_INT, and len.
Referenced by idp_from_PySequence_Fast().
|
static |
Definition at line 380 of file idprop_py_api.cc.
References MAX_IDPROP_NAME.
Referenced by BPy_IDProperty_Map_ValidateAndCreate().
| void IDProp_Init_Types | ( | ) |
Definition at line 2527 of file idprop_py_api.cc.
References BPy_IDArray_Type, BPy_IDGroup_IterItems_Type, BPy_IDGroup_IterKeys_Type, BPy_IDGroup_IterValues_Type, BPy_IDGroup_Type, BPy_IDGroup_ViewItems_Type, BPy_IDGroup_ViewKeys_Type, BPy_IDGroup_ViewValues_Type, IDGroup_Iter_init_type(), and IDGroup_View_init_type().
Referenced by BPy_init_modules(), and BPyInit_idprop_types().
|
static |
Definition at line 101 of file idprop_py_api.cc.
References BPy_IDArray_Type.
Referenced by BPy_IDGroup_WrapData().
|
static |
Definition at line 82 of file idprop_py_api.cc.
References IDP_Bool.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 77 of file idprop_py_api.cc.
References IDP_Double.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 72 of file idprop_py_api.cc.
References IDP_Float.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 87 of file idprop_py_api.cc.
References BPy_IDGroup_Type.
Referenced by BPy_IDGroup_WrapData(), BPy_Wrap_GetItems_View_WithID(), BPy_Wrap_GetKeys_View_WithID(), and BPy_Wrap_GetValues_View_WithID().
|
static |
Definition at line 96 of file idprop_py_api.cc.
References IDProperty::data, IDPropertyData::pointer, and pyrna_id_CreatePyObject().
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 109 of file idprop_py_api.cc.
References BPy_IDGroup_WrapData(), IDP_IDPArray, IDProperty::len, UNLIKELY, and wrap().
Referenced by BPy_IDGroup_WrapData().
|
static |
Definition at line 67 of file idprop_py_api.cc.
References IDP_Int.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 54 of file idprop_py_api.cc.
References IDP_Array, IDP_String, IDP_STRING_SUB_BYTE, IDProperty::len, PyC_UnicodeFromBytesAndSize(), and IDProperty::subtype.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
Definition at line 2415 of file idprop_py_api.cc.
References double(), float, IDP_BOOLEAN, IDP_DOUBLE, IDP_FLOAT, IDP_INT, and int.
Referenced by BPy_IDArray_getbuffer().
| PyDoc_STRVAR | ( | BPy_IDArray_get_typecode_doc | , |
| "The type of the data in the array {'f': float, 'd': double, 'i': int, 'b': bool}." | ) |
| PyDoc_STRVAR | ( | BPy_IDArray_to_list_doc | , |
| ".. method:: to_list()\n" "\n" " Return the array as a list.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_clear_doc | , |
| ".. method:: clear()\n" "\n" " Clear all members from this group.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_get_doc | , |
| ".. method:: get(key, default=None)\n" "\n" " Return the value for | key, | ||
| if it | exists, | ||
| else default.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_items_doc | , |
| ".. method:: items()\n" "\n" " Iterate through the items in the dict; behaves like dictionary method items.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_keys_doc | , |
| ".. method:: keys()\n" "\n" " Return the keys associated with this group as a list of strings.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_pop_doc | , |
| ".. method:: pop(key, default)\n" "\n" " Remove an item from the | group, | ||
| returning a Python representation.\n" "\n" " :raises KeyError:When the item doesn 't exist.\n" "\n" " :arg key:Name of item to remove.\n" " :type key:str\n" " :arg default:Value to return when key isn 't | found, | ||
| otherwise raise an exception.\n" " :type default:Any\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_to_dict_doc | , |
| ".. method:: to_dict()\n" "\n" " Return a purely Python version of the group.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_update_doc | , |
| ".. method:: update(other)\n" "\n" " Update | key, | ||
| values.\n" "\n" " :arg other:Updates the values in the group with this.\n" " :type other::class:`IDPropertyGroup`|dict\n" | [str, Any] ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_values_doc | , |
| ".. method:: values()\n" "\n" " Return the values associated with this group.\n" | ) |
| PyDoc_STRVAR | ( | BPy_IDGroup_View_reversed_doc | , |
| "Return a reverse iterator over the ID Property keys values or items." | ) |
| PyDoc_STRVAR | ( | IDProp_module_doc | , |
| "This module provides access id property types (currently mainly for docs)." | ) |
|
extern |
Definition at line 7823 of file bpy_rna.cc.
References BPy_StructRNA_Check, ptr, RNA_struct_is_ID(), and PointerRNA::type.
Referenced by idp_from_PyObject().
|
extern |
Definition at line 7802 of file bpy_rna.cc.
References ptr, pyrna_struct_CreatePyObject(), and RNA_id_pointer_create().
Referenced by bpy_user_map(), foreach_libblock_id_user_map_callback(), and idprop_py_from_idp_id().
|
extern |
Definition at line 7812 of file bpy_rna.cc.
References pyrna_id_CheckPyObject().
Referenced by bpy_batch_remove(), bpy_lib_write(), and idp_from_DatablockPointer().
|
static |
Definition at line 2409 of file idprop_py_api.cc.
|
static |
Definition at line 2457 of file idprop_py_api.cc.
|
static |
Definition at line 2136 of file idprop_py_api.cc.
|
static |
Definition at line 2162 of file idprop_py_api.cc.
|
static |
Definition at line 2246 of file idprop_py_api.cc.
| PyTypeObject BPy_IDArray_Type |
Definition at line 2468 of file idprop_py_api.cc.
Referenced by BPyInit_idprop_types(), IDProp_Init_Types(), and idprop_py_from_idp_array().
|
static |
Definition at line 285 of file idprop_py_api.cc.
| PyTypeObject BPy_IDGroup_IterItems_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1389 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_IterItems_CreatePyObject(), BPyInit_idprop_types(), IDGroup_Iter_init_type(), and IDProp_Init_Types().
| PyTypeObject BPy_IDGroup_IterKeys_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1387 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_IterKeys_CreatePyObject(), BPyInit_idprop_types(), IDGroup_Iter_init_type(), and IDProp_Init_Types().
| PyTypeObject BPy_IDGroup_IterValues_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1388 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_IterValues_CreatePyObject(), BPyInit_idprop_types(), IDGroup_Iter_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 2013 of file idprop_py_api.cc.
|
static |
Definition at line 1977 of file idprop_py_api.cc.
|
static |
Definition at line 1999 of file idprop_py_api.cc.
| PyTypeObject BPy_IDGroup_Type |
Definition at line 2019 of file idprop_py_api.cc.
Referenced by BPyInit_idprop_types(), IDProp_Init_Types(), idprop_py_from_idp_group(), and pyrna_struct_id_properties_ensure().
|
static |
Definition at line 1618 of file idprop_py_api.cc.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1593 of file idprop_py_api.cc.
Referenced by IDGroup_View_init_type().
| PyTypeObject BPy_IDGroup_ViewItems_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1628 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_ViewItems_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 1571 of file idprop_py_api.cc.
Referenced by IDGroup_View_init_type().
| PyTypeObject BPy_IDGroup_ViewKeys_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1626 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_ViewKeys_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 1582 of file idprop_py_api.cc.
Referenced by IDGroup_View_init_type().
| PyTypeObject BPy_IDGroup_ViewValues_Type = {PyVarObject_HEAD_INIT(nullptr, 0)} |
Definition at line 1627 of file idprop_py_api.cc.
Referenced by BPy_IDGroup_ViewValues_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 2629 of file idprop_py_api.cc.
|
static |
Definition at line 2637 of file idprop_py_api.cc.
Referenced by BPyInit_idprop().
|
static |
Definition at line 2586 of file idprop_py_api.cc.
Referenced by BPyInit_idprop_types().