Blender
V3.3
|
#include <Python.h>
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "idprop_py_api.h"
#include "idprop_py_ui_api.h"
#include "BKE_idprop.h"
#include "DNA_ID.h"
#include "py_capi_utils.h"
#include "python_utildefines.h"
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 (void) |
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_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 (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PyLong (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PyUnicode (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PyBytes (const char *name, PyObject *ob) |
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 (const char *name, Py_buffer *buffer) |
static IDProperty * | idp_from_PySequence_Fast (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PySequence (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PyMapping (const char *name, PyObject *ob) |
static IDProperty * | idp_from_DatablockPointer (const char *name, PyObject *ob) |
static IDProperty * | idp_from_PyObject (PyObject *name_obj, PyObject *ob) |
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 *UNUSED(closure)) |
static int | BPy_IDGroup_SetName (BPy_IDProperty *self, PyObject *value, void *UNUSED(closure)) |
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(NULL, 0)} |
PyTypeObject | BPy_IDGroup_ViewValues_Type = {PyVarObject_HEAD_INIT(NULL, 0)} |
PyTypeObject | BPy_IDGroup_ViewItems_Type = {PyVarObject_HEAD_INIT(NULL, 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 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 *UNUSED(ignored)) |
static void | IDGroup_View_init_type (void) |
ID-Property Group Methods | |
static struct 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: string\n" " :arg default: Value to return when key isn't found, otherwise raise an exception.\n" " :type default: Undefined\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` or dict\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, bool *r_is_double) |
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}.") | |
static PyObject * | BPy_IDArray_get_typecode (BPy_IDArray *self) |
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 int | BPy_IDArray_Len (BPy_IDArray *self) |
static PyObject * | BPy_IDArray_GetItem (BPy_IDArray *self, int index) |
static int | BPy_IDArray_SetItem (BPy_IDArray *self, int 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 *UNUSED(self), Py_buffer *view) |
Public Module 'idprop.types' | |
static struct PyModuleDef | IDProp_types_module_def |
static PyObject * | BPyInit_idprop_types (void) |
Public Module 'idprop' | |
static PyMethodDef | IDProp_methods [] |
static struct PyModuleDef | IDProp_module_def |
PyDoc_STRVAR (IDProp_module_doc, "This module provides access id property types (currently mainly for docs).") | |
PyObject * | BPyInit_idprop (void) |
#define SHARED_MEMBER_SET | ( | member, | |
value | |||
) |
#define SHARED_MEMBER_SET | ( | member, | |
value | |||
) |
#define USE_STRING_COERCE |
Definition at line 20 of file idprop_py_api.c.
|
static |
Definition at line 912 of file idprop_py_api.c.
References self.
Referenced by BPy_Group_IterItems_next(), BPy_Group_IterKeys_next(), and BPy_Group_IterValues_next().
|
static |
Definition at line 951 of file idprop_py_api.c.
References BPy_Group_Iter_same_size_or_raise_error(), BPy_IDGroup_WrapData(), IDProperty::name, IDProperty::next, NULL, IDProperty::prev, PyTuple_SET_ITEMS, ret, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 921 of file idprop_py_api.c.
References BPy_Group_Iter_same_size_or_raise_error(), IDProperty::name, IDProperty::next, NULL, IDProperty::prev, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 936 of file idprop_py_api.c.
References BPy_Group_Iter_same_size_or_raise_error(), BPy_IDGroup_WrapData(), IDProperty::next, NULL, IDProperty::prev, and self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1106 of file idprop_py_api.c.
|
static |
Definition at line 1134 of file idprop_py_api.c.
|
static |
Definition at line 1101 of file idprop_py_api.c.
References BPy_IDGroup_IterItems_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1114 of file idprop_py_api.c.
References BPy_IDGroup_Contains(), NULL, and self.
|
static |
Definition at line 1091 of file idprop_py_api.c.
References BPy_IDGroup_IterKeys_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1122 of file idprop_py_api.c.
|
static |
Definition at line 1096 of file idprop_py_api.c.
References BPy_IDGroup_IterValues_CreatePyObject(), and self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1814 of file idprop_py_api.c.
References CLAMP, double(), IDP_Array, idp_array_py_type(), IDProperty::len, MEM_freeN, MEM_mallocN, MIN2, PyC_AsArray(), and size().
Referenced by BPy_IDArray_ass_subscript().
|
static |
Definition at line 1883 of file idprop_py_api.c.
References BPy_IDArray_ass_slice(), BPy_IDArray_SetItem(), and self.
|
static |
Definition at line 1652 of file idprop_py_api.c.
References IDP_DOUBLE, IDP_FLOAT, IDP_INT, NULL, and self.
|
static |
Definition at line 1935 of file idprop_py_api.c.
References IDP_Array, idp_format_from_array_type(), itemsize_by_idarray_type(), IDProperty::len, blender::math::length(), MEM_mallocN, IDProperty::subtype, and view.
|
static |
Definition at line 1698 of file idprop_py_api.c.
References IDP_Array, IDP_DOUBLE, IDP_FLOAT, IDP_INT, NULL, and self.
Referenced by BPy_IDArray_subscript().
|
static |
Definition at line 1693 of file idprop_py_api.c.
|
static |
Definition at line 1955 of file idprop_py_api.c.
|
static |
Definition at line 1645 of file idprop_py_api.c.
References self.
|
static |
Definition at line 1720 of file idprop_py_api.c.
References float(), IDP_Array, IDP_DOUBLE, IDP_FLOAT, IDP_INT, and self.
Referenced by BPy_IDArray_ass_subscript().
|
static |
Definition at line 1772 of file idprop_py_api.c.
References CLAMP, count, IDP_Array, IDP_DOUBLE, IDP_FLOAT, IDP_INT, IDProperty::len, MIN2, and IDProperty::subtype.
Referenced by BPy_IDArray_subscript().
|
static |
Definition at line 1845 of file idprop_py_api.c.
References BPy_IDArray_GetItem(), BPy_IDArray_slice(), NULL, and self.
|
static |
Definition at line 1683 of file idprop_py_api.c.
References BPy_IDGroup_MapDataToPy(), and self.
|
static |
Definition at line 1490 of file idprop_py_api.c.
References IDP_ClearProperty(), and self.
|
static |
Definition at line 1426 of file idprop_py_api.c.
References IDP_GetPropertyFromGroup(), and self.
Referenced by BPy_Group_ViewKeys_Contains().
|
static |
Definition at line 1292 of file idprop_py_api.c.
References len, and IDProperty::len.
Referenced by BPy_Wrap_GetItems(), BPy_Wrap_GetKeys(), and BPy_Wrap_GetValues().
|
static |
Definition at line 1500 of file idprop_py_api.c.
References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), NULL, and self.
|
static |
Definition at line 240 of file idprop_py_api.c.
References self.
|
static |
Definition at line 134 of file idprop_py_api.c.
References self.
|
static |
Definition at line 1421 of file idprop_py_api.c.
References BPy_IDGroup_ViewItems_CreatePyObject().
|
static |
Definition at line 757 of file idprop_py_api.c.
References BPy_IDGroup_ViewKeys_CreatePyObject(), NULL, and ret.
|
static |
Definition at line 906 of file idprop_py_api.c.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 891 of file idprop_py_api.c.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 883 of file idprop_py_api.c.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 900 of file idprop_py_api.c.
References self.
Referenced by IDGroup_Iter_init_type().
|
static |
Definition at line 1039 of file idprop_py_api.c.
References BPy_IDGroup_IterItems_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewItems_iter().
|
static |
Definition at line 1029 of file idprop_py_api.c.
References BPy_IDGroup_IterKeys_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewKeys_iter().
|
static |
Definition at line 1034 of file idprop_py_api.c.
References BPy_IDGroup_IterValues_Type, and IDGroup_Iter_New_WithType().
Referenced by BPy_Group_ViewValues_iter().
|
static |
Definition at line 1403 of file idprop_py_api.c.
References BPy_IDGroup_ViewKeys_CreatePyObject().
|
static |
Definition at line 292 of file idprop_py_api.c.
References BPy_IDGroup_WrapData(), IDP_GetPropertyFromGroup(), IDP_GROUP, NULL, and self.
|
static |
Definition at line 282 of file idprop_py_api.c.
|
static |
Definition at line 752 of file idprop_py_api.c.
References BPy_Wrap_SetMapItem(), and self.
Referenced by BPy_IDGroup_update().
PyObject* BPy_IDGroup_MapDataToPy | ( | struct IDProperty * | prop | ) |
For simple, non nested types this is the same as BPy_IDGroup_WrapData.
Definition at line 771 of file idprop_py_api.c.
References IDProperty::data, ListBase::first, IDPropertyData::group, IDP_Array, IDP_ARRAY, IDP_DOUBLE, IDP_FLOAT, IDP_GROUP, IDP_ID, IDP_IDPArray, IDP_IDPARRAY, IDP_INT, IDP_STRING, 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, NULL, IDProperty::subtype, IDProperty::type, UNLIKELY, and blender::bke::image::partial_update::wrap().
Referenced by BPy_IDArray_to_list(), BPy_IDGroup_pop(), BPy_IDGroup_to_dict(), and pyrna_struct_pop().
|
static |
Definition at line 1259 of file idprop_py_api.c.
References BPy_IDGroup_MapDataToPy(), IDP_FreeFromGroup(), IDP_GetPropertyFromGroup(), NULL, and self.
|
static |
Definition at line 139 of file idprop_py_api.c.
References self.
|
static |
Definition at line 245 of file idprop_py_api.c.
References MAX_IDPROP_NAME, and self.
|
static |
Definition at line 1481 of file idprop_py_api.c.
References BPy_IDGroup_MapDataToPy(), and self.
|
static |
Definition at line 1445 of file idprop_py_api.c.
References BPy_IDGroup_Check, BPy_IDGroup_Map_SetItem(), IDP_MergeGroup(), NULL, BPy_IDProperty::prop, self, and UNLIKELY.
|
static |
Definition at line 1412 of file idprop_py_api.c.
References BPy_IDGroup_ViewValues_CreatePyObject().
|
static |
Definition at line 1083 of file idprop_py_api.c.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1068 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1060 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1184 of file idprop_py_api.c.
References IDGroup_View_New_WithType(), result, and self.
|
static |
Definition at line 1077 of file idprop_py_api.c.
References self.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 2105 of file idprop_py_api.c.
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 2095 of file idprop_py_api.c.
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 2100 of file idprop_py_api.c.
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 147 of file idprop_py_api.c.
References IDP_ARRAY, IDP_DOUBLE, IDP_FLOAT, IDP_GROUP, IDP_ID, IDP_IDPARRAY, IDP_INT, IDP_STRING, idprop_py_from_idp_array(), 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, |
struct IDProperty * | group, | ||
PyObject * | ob | ||
) |
Definition at line 675 of file idprop_py_api.c.
References IDProperty::flag, IDP_AppendArray(), IDP_FreePropertyContent(), idp_from_PyObject(), IDP_GetPropertyFromGroup(), IDP_IDPARRAY, IDP_ReplaceInGroup_ex(), MEM_freeN, IDProperty::name, IDProperty::next, NULL, IDProperty::prev, IDProperty::subtype, IDProperty::type, 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 1352 of file idprop_py_api.c.
References BPy_IDGroup_CorrectListLen(), BPy_IDGroup_WrapData(), IDProperty::data, ListBase::first, IDPropertyData::group, IDProperty::len, IDProperty::name, IDProperty::next, and PyTuple_SET_ITEMS.
PyObject* BPy_Wrap_GetItems_View_WithID | ( | ID * | id, |
IDProperty * | prop | ||
) |
Definition at line 1391 of file idprop_py_api.c.
References BPy_IDGroup_ViewItems_CreatePyObject(), idprop_py_from_idp_group(), NULL, and ret.
Referenced by pyrna_struct_items().
PyObject* BPy_Wrap_GetKeys | ( | IDProperty * | prop | ) |
Definition at line 1307 of file idprop_py_api.c.
References BPy_IDGroup_CorrectListLen(), IDProperty::data, ListBase::first, IDPropertyData::group, len, IDProperty::len, IDProperty::name, and IDProperty::next.
PyObject* BPy_Wrap_GetKeys_View_WithID | ( | ID * | id, |
IDProperty * | prop | ||
) |
Definition at line 1375 of file idprop_py_api.c.
References BPy_IDGroup_ViewKeys_CreatePyObject(), idprop_py_from_idp_group(), NULL, and ret.
Referenced by pyrna_struct_keys().
PyObject* BPy_Wrap_GetValues | ( | ID * | id, |
IDProperty * | prop | ||
) |
Definition at line 1332 of file idprop_py_api.c.
References BPy_IDGroup_CorrectListLen(), BPy_IDGroup_WrapData(), IDProperty::data, ListBase::first, IDPropertyData::group, IDProperty::len, and IDProperty::next.
PyObject* BPy_Wrap_GetValues_View_WithID | ( | ID * | id, |
IDProperty * | prop | ||
) |
Definition at line 1383 of file idprop_py_api.c.
References BPy_IDGroup_ViewValues_CreatePyObject(), idprop_py_from_idp_group(), NULL, and ret.
Referenced by pyrna_struct_values().
int BPy_Wrap_SetMapItem | ( | IDProperty * | prop, |
PyObject * | key, | ||
PyObject * | val | ||
) |
Definition at line 716 of file idprop_py_api.c.
References BPy_IDProperty_Map_ValidateAndCreate(), IDP_FreeFromGroup(), IDP_GetPropertyFromGroup(), IDP_GROUP, NULL, and IDProperty::type.
Referenced by BPy_IDGroup_Map_SetItem(), and pyrna_struct_ass_subscript().
PyObject* BPyInit_idprop | ( | void | ) |
Definition at line 2177 of file idprop_py_api.c.
References BPyInit_idprop_types(), IDProp_module_def, and mod().
|
static |
Definition at line 2128 of file idprop_py_api.c.
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().
Definition at line 975 of file idprop_py_api.c.
References BPy_Group_IterItems_next(), BPy_Group_IterKeys_next(), BPy_Group_IterValues_next(), BPy_IDGroup_Iter_clear(), BPy_IDGroup_Iter_dealloc(), 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 1008 of file idprop_py_api.c.
References BLI_assert, BPy_IDGroup_Iter::cur, IDProperty::data, ListBase::first, IDPropertyData::group, BPy_IDGroup_Iter::group, IDP_GROUP, ListBase::last, IDProperty::len, BPy_IDGroup_Iter::len_init, NULL, BPy_IDProperty::prop, BPy_IDGroup_Iter::reversed, type, and IDProperty::type.
Referenced by BPy_IDGroup_IterItems_CreatePyObject(), BPy_IDGroup_IterKeys_CreatePyObject(), and BPy_IDGroup_IterValues_CreatePyObject().
Definition at line 1204 of file idprop_py_api.c.
References BPy_Group_ViewItems_iter(), BPy_Group_ViewKeys_iter(), BPy_Group_ViewValues_iter(), BPy_IDGroup_View_clear(), BPy_IDGroup_View_dealloc(), 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 NULL, 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 2082 of file idprop_py_api.c.
References BLI_assert, BPy_IDGroup_View::group, IDP_GROUP, NULL, BPy_IDProperty::prop, BPy_IDGroup_View::reversed, type, and IDProperty::type.
Referenced by BPy_IDGroup_View_reversed(), BPy_IDGroup_ViewItems_CreatePyObject(), BPy_IDGroup_ViewKeys_CreatePyObject(), and BPy_IDGroup_ViewValues_CreatePyObject().
|
static |
Definition at line 1627 of file idprop_py_api.c.
References IDP_DOUBLE, IDP_FLOAT, IDP_INT, NULL, and self.
Referenced by BPy_IDArray_ass_slice().
|
static |
Definition at line 437 of file idprop_py_api.c.
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_Buffer().
|
static |
Definition at line 458 of file idprop_py_api.c.
References IDP_DOUBLE, IDP_FLOAT, IDP_INT, NULL, and type.
Referenced by BPy_IDArray_getbuffer().
|
static |
Definition at line 628 of file idprop_py_api.c.
References IDPropertyTemplate::id, IDP_ID, IDP_New(), and pyrna_id_FromPyObject().
Referenced by idp_from_PyObject().
|
static |
Definition at line 428 of file idprop_py_api.c.
References IDP_New(), IDP_STRING, IDP_STRING_SUB_BYTE, IDPropertyTemplate::len, IDPropertyTemplate::str, IDPropertyTemplate::string, and IDPropertyTemplate::subtype.
Referenced by idp_from_PyObject().
|
static |
The 'idp_from_Py*' functions expect that the input type has been checked before and return NULL if the IDProperty can't be created.
Definition at line 392 of file idprop_py_api.c.
References IDPropertyTemplate::d, IDP_DOUBLE, and IDP_New().
Referenced by idp_from_PyObject().
|
static |
Definition at line 399 of file idprop_py_api.c.
References IDPropertyTemplate::i, IDP_INT, IDP_New(), and NULL.
Referenced by idp_from_PyObject().
|
static |
Definition at line 593 of file idprop_py_api.c.
References BPy_IDProperty_Map_ValidateAndCreate(), IDP_FreeProperty(), IDP_GROUP, IDP_New(), len, and NULL.
Referenced by idp_from_PyObject().
|
static |
Definition at line 635 of file idprop_py_api.c.
References idp_from_DatablockPointer(), idp_from_PyBytes(), idp_from_PyFloat(), idp_from_PyLong(), idp_from_PyMapping(), idp_from_PySequence(), idp_from_PyUnicode(), idp_try_read_name(), NULL, and pyrna_id_CheckPyObject().
Referenced by BPy_IDProperty_Map_ValidateAndCreate().
|
static |
Definition at line 560 of file idprop_py_api.c.
References buffer, idp_from_PySequence_Buffer(), idp_from_PySequence_Fast(), NULL, PyC_StructFmt_type_from_str(), PyC_StructFmt_type_is_float_any(), and PyC_StructFmt_type_is_int_any().
Referenced by idp_from_PyObject().
|
static |
Definition at line 472 of file idprop_py_api.c.
References IDPropertyTemplate::array, buffer, IDP_Array, IDP_ARRAY, idp_array_type_from_formatstr_and_size(), IDP_New(), IDPropertyTemplate::len, NULL, and IDPropertyTemplate::type.
Referenced by idp_from_PySequence().
|
static |
Definition at line 491 of file idprop_py_api.c.
References IDPropertyTemplate::array, BPy_IDProperty_Map_ValidateAndCreate(), IDP_Array, IDP_ARRAY, IDP_DOUBLE, IDP_FreeProperty(), IDP_IDPARRAY, IDP_INT, IDP_New(), IDP_NewIDPArray(), idp_sequence_type(), IDPropertyTemplate::len, NULL, and IDPropertyTemplate::type.
Referenced by idp_from_PySequence().
|
static |
Definition at line 409 of file idprop_py_api.c.
References IDP_New(), IDP_STRING, IDP_STRING_SUB_UTF8, IDPropertyTemplate::len, NULL, PyC_UnicodeAsByteAndSize(), IDPropertyTemplate::str, IDPropertyTemplate::string, and IDPropertyTemplate::subtype.
Referenced by idp_from_PyObject().
|
static |
Definition at line 320 of file idprop_py_api.c.
References IDP_DOUBLE, IDP_IDPARRAY, IDP_INT, len, and type.
Referenced by idp_from_PySequence_Fast().
|
static |
Definition at line 355 of file idprop_py_api.c.
References MAX_IDPROP_NAME, and NULL.
Referenced by idp_from_PyObject().
Definition at line 2058 of file idprop_py_api.c.
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 92 of file idprop_py_api.c.
References BPy_IDArray_Type, and id.
Referenced by BPy_IDGroup_WrapData().
|
static |
Definition at line 73 of file idprop_py_api.c.
References IDP_Double.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 68 of file idprop_py_api.c.
References IDP_Float.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 78 of file idprop_py_api.c.
References BPy_IDGroup_Type, id, BPy_IDProperty::owner_id, BPy_IDProperty::parent, and BPy_IDProperty::prop.
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 87 of file idprop_py_api.c.
References IDProperty::data, IDPropertyData::pointer, and pyrna_id_CreatePyObject().
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 100 of file idprop_py_api.c.
References BPy_IDGroup_WrapData(), IDP_IDPArray, IDProperty::len, NULL, UNLIKELY, and blender::bke::image::partial_update::wrap().
Referenced by BPy_IDGroup_WrapData().
|
static |
Definition at line 63 of file idprop_py_api.c.
References IDP_Int.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 50 of file idprop_py_api.c.
References IDP_Array, IDP_String, IDP_STRING_SUB_BYTE, IDProperty::len, PyC_UnicodeFromByteAndSize(), and IDProperty::subtype.
Referenced by BPy_IDGroup_MapDataToPy(), and BPy_IDGroup_WrapData().
|
static |
Definition at line 1921 of file idprop_py_api.c.
References double(), float(), IDP_DOUBLE, IDP_FLOAT, and IDP_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}." | |||
) |
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:string\n" " :arg default:Value to return when key isn 't | found, | ||
otherwise raise an exception.\n" " :type default:Undefined\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` or dict\n" | |||
) |
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)." | |||
) |
bool pyrna_id_CheckPyObject | ( | PyObject * | obj | ) |
Definition at line 7668 of file bpy_rna.c.
References BPy_StructRNA_Check, ptr, RNA_struct_is_ID(), and PointerRNA::type.
Referenced by idp_from_PyObject().
PyObject* pyrna_id_CreatePyObject | ( | ID * | id | ) |
Definition at line 7646 of file bpy_rna.c.
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().
Definition at line 7657 of file bpy_rna.c.
References NULL, and pyrna_id_CheckPyObject().
Referenced by bpy_batch_remove(), bpy_lib_write(), and idp_from_DatablockPointer().
|
static |
Definition at line 1915 of file idprop_py_api.c.
|
static |
Definition at line 1960 of file idprop_py_api.c.
|
static |
Definition at line 1669 of file idprop_py_api.c.
|
static |
Definition at line 1688 of file idprop_py_api.c.
|
static |
Definition at line 1757 of file idprop_py_api.c.
PyTypeObject BPy_IDArray_Type |
Definition at line 1971 of file idprop_py_api.c.
Referenced by BPyInit_idprop_types(), IDProp_Init_Types(), and idprop_py_from_idp_array().
|
static |
Definition at line 273 of file idprop_py_api.c.
PyTypeObject BPy_IDGroup_IterItems_Type = {PyVarObject_HEAD_INIT(NULL, 0)} |
Definition at line 972 of file idprop_py_api.c.
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(NULL, 0)} |
Definition at line 970 of file idprop_py_api.c.
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(NULL, 0)} |
Definition at line 971 of file idprop_py_api.c.
Referenced by BPy_IDGroup_IterValues_CreatePyObject(), BPyInit_idprop_types(), IDGroup_Iter_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 1554 of file idprop_py_api.c.
|
static |
Definition at line 1500 of file idprop_py_api.c.
|
static |
Definition at line 1540 of file idprop_py_api.c.
PyTypeObject BPy_IDGroup_Type |
Definition at line 1560 of file idprop_py_api.c.
Referenced by BPyInit_idprop_types(), IDProp_Init_Types(), idprop_py_from_idp_group(), and pyrna_struct_id_properties_ensure().
|
static |
Definition at line 1191 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
|
static |
Definition at line 1168 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
PyTypeObject BPy_IDGroup_ViewItems_Type = {PyVarObject_HEAD_INIT(NULL, 0)} |
Definition at line 1201 of file idprop_py_api.c.
Referenced by BPy_IDGroup_ViewItems_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 1146 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
PyTypeObject BPy_IDGroup_ViewKeys_Type = {PyVarObject_HEAD_INIT(NULL, 0)} |
Definition at line 1199 of file idprop_py_api.c.
Referenced by BPy_IDGroup_ViewKeys_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 1157 of file idprop_py_api.c.
Referenced by IDGroup_View_init_type().
PyTypeObject BPy_IDGroup_ViewValues_Type = {PyVarObject_HEAD_INIT(NULL, 0)} |
Definition at line 1200 of file idprop_py_api.c.
Referenced by BPy_IDGroup_ViewValues_CreatePyObject(), BPyInit_idprop_types(), IDGroup_View_init_type(), and IDProp_Init_Types().
|
static |
Definition at line 2159 of file idprop_py_api.c.
|
static |
Definition at line 2163 of file idprop_py_api.c.
Referenced by BPyInit_idprop().
|
static |
Definition at line 2105 of file idprop_py_api.c.
Referenced by BPyInit_idprop_types().