Blender  V3.3
Classes | Macros | Functions | Variables
bpy_rna.c File Reference
#include <Python.h>
#include <float.h>
#include <stddef.h>
#include "RNA_path.h"
#include "RNA_types.h"
#include "BLI_bitmap.h"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BPY_extern.h"
#include "BPY_extern_clog.h"
#include "bpy_capi_utils.h"
#include "bpy_intern_string.h"
#include "bpy_props.h"
#include "bpy_rna.h"
#include "bpy_rna_anim.h"
#include "bpy_rna_callback.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_prototypes.h"
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_node.h"
#include "DEG_depsgraph_query.h"
#include "../generic/idprop_py_api.h"
#include "../generic/idprop_py_ui_api.h"
#include "../generic/py_capi_rna.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#include "../mathutils/mathutils.h"

Go to the source code of this file.

Classes

struct  BPy_TypesModule_State
 

Macros

#define USE_PEDANTIC_WRITE
 
#define USE_MATHUTILS
 
#define USE_STRING_COERCE
 
#define USE_POSTPONED_ANNOTATIONS
 
#define BPY_DOC_ID_PROP_TYPE_NOTE
 
#define MATHUTILS_CB_SUBTYPE_EUL   0
 
#define MATHUTILS_CB_SUBTYPE_VEC   1
 
#define MATHUTILS_CB_SUBTYPE_QUAT   2
 
#define MATHUTILS_CB_SUBTYPE_COLOR   3
 
#define PROP_ALL_VECTOR_SUBTYPES
 
#define PYRNA_PROP_COLLECTION_ABS_INDEX(ret_err)
 
#define BPY_REPLACEMENT_STRING(rna_attr, py_attr)
 

Functions

static PyObject * pyrna_struct_Subtype (PointerRNA *ptr)
 
static PyObject * pyrna_prop_collection_values (BPy_PropertyRNA *self)
 
static PyObject * pyrna_register_class (PyObject *self, PyObject *py_class)
 
static PyObject * pyrna_unregister_class (PyObject *self, PyObject *py_class)
 
int pyrna_struct_validity_check (BPy_StructRNA *pysrna)
 
int pyrna_prop_validity_check (BPy_PropertyRNA *self)
 
void pyrna_invalidate (BPy_DummyPointerRNA *self)
 
void BPY_id_release (struct ID *id)
 
static bool rna_id_write_error (PointerRNA *ptr, PyObject *key)
 
bool pyrna_write_check (void)
 
void pyrna_write_set (bool val)
 
static Py_ssize_t pyrna_prop_collection_length (BPy_PropertyRNA *self)
 
static Py_ssize_t pyrna_prop_array_length (BPy_PropertyArrayRNA *self)
 
static int pyrna_py_to_prop (PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix)
 
static int deferred_register_prop (StructRNA *srna, PyObject *key, PyObject *item)
 
static PyObject * pyrna_prop_array_subscript_slice (BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length)
 
static short pyrna_rotation_euler_order_get (PointerRNA *ptr, const short order_fallback, PropertyRNA **r_prop_eul_order)
 
static int mathutils_rna_generic_check (BaseMathObject *bmo)
 
static int mathutils_rna_vector_get (BaseMathObject *bmo, int subtype)
 
static int mathutils_rna_vector_set (BaseMathObject *bmo, int subtype)
 
static int mathutils_rna_vector_get_index (BaseMathObject *bmo, int UNUSED(subtype), int index)
 
static int mathutils_rna_vector_set_index (BaseMathObject *bmo, int UNUSED(subtype), int index)
 
static int mathutils_rna_matrix_get (BaseMathObject *bmo, int UNUSED(subtype))
 
static int mathutils_rna_matrix_set (BaseMathObject *bmo, int UNUSED(subtype))
 
PyObject * pyrna_math_object_from_array (PointerRNA *ptr, PropertyRNA *prop)
 
static int pyrna_struct_compare (BPy_StructRNA *a, BPy_StructRNA *b)
 
static int pyrna_prop_compare (BPy_PropertyRNA *a, BPy_PropertyRNA *b)
 
static PyObject * pyrna_struct_richcmp (PyObject *a, PyObject *b, int op)
 
static PyObject * pyrna_prop_richcmp (PyObject *a, PyObject *b, int op)
 
static PyObject * pyrna_struct_str (BPy_StructRNA *self)
 
static PyObject * pyrna_struct_repr (BPy_StructRNA *self)
 
static PyObject * pyrna_prop_str (BPy_PropertyRNA *self)
 
static PyObject * pyrna_prop_repr_ex (BPy_PropertyRNA *self, const int index_dim, const int index)
 
static PyObject * pyrna_prop_repr (BPy_PropertyRNA *self)
 
static PyObject * pyrna_prop_array_repr (BPy_PropertyArrayRNA *self)
 
static PyObject * pyrna_func_repr (BPy_FunctionRNA *self)
 
static Py_hash_t pyrna_struct_hash (BPy_StructRNA *self)
 
static long pyrna_prop_hash (BPy_PropertyRNA *self)
 
static void pyrna_struct_dealloc (BPy_StructRNA *self)
 
static void pyrna_prop_dealloc (BPy_PropertyRNA *self)
 
static void pyrna_prop_array_dealloc (BPy_PropertyRNA *self)
 
static const char * pyrna_enum_as_string (PointerRNA *ptr, PropertyRNA *prop)
 
static int pyrna_string_to_enum (PyObject *item, PointerRNA *ptr, PropertyRNA *prop, int *r_value, const char *error_prefix)
 
static int pyrna_prop_to_enum_bitfield (PointerRNA *ptr, PropertyRNA *prop, PyObject *value, int *r_value, const char *error_prefix)
 
static PyObject * pyrna_enum_to_py (PointerRNA *ptr, PropertyRNA *prop, int val)
 
PyObject * pyrna_prop_to_py (PointerRNA *ptr, PropertyRNA *prop)
 
int pyrna_pydict_to_props (PointerRNA *ptr, PyObject *kw, const bool all_args, const char *error_prefix)
 
static PyObject * pyrna_func_to_py (const PointerRNA *ptr, FunctionRNA *func)
 
static PyObject * pyrna_prop_array_to_py_index (BPy_PropertyArrayRNA *self, int index)
 
static int pyrna_py_to_prop_array_index (BPy_PropertyArrayRNA *self, int index, PyObject *value)
 
static int pyrna_prop_array_bool (BPy_PropertyRNA *self)
 
static int pyrna_prop_collection_bool (BPy_PropertyRNA *self)
 
static int pyrna_prop_collection_subscript_is_valid_or_error (const PyObject *value)
 
static PyObject * pyrna_prop_collection_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum)
 
static int pyrna_prop_collection_ass_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum, PyObject *value)
 
static PyObject * pyrna_prop_array_subscript_int (BPy_PropertyArrayRNA *self, int keynum)
 
static PyObject * pyrna_prop_collection_subscript_str (BPy_PropertyRNA *self, const char *keyname)
 
static int pyrna_prop_collection_subscript_str_lib_pair_ptr (BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const short err_not_found, PointerRNA *r_ptr)
 
static PyObject * pyrna_prop_collection_subscript_str_lib_pair (BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const bool err_not_found)
 
static PyObject * pyrna_prop_collection_subscript_slice (BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop)
 
static PyObject * pyrna_prop_collection_subscript (BPy_PropertyRNA *self, PyObject *key)
 
static int pyrna_prop_collection_type_check (BPy_PropertyRNA *self, PyObject *value)
 
static int pyrna_prop_collection_ass_subscript (BPy_PropertyRNA *self, PyObject *key, PyObject *value)
 
static PyObject * pyrna_prop_array_subscript (BPy_PropertyArrayRNA *self, PyObject *key)
 
static PyObject * prop_subscript_ass_array_slice__as_seq_fast (PyObject *value, int length)
 
static int prop_subscript_ass_array_slice__float_recursive (PyObject **value_items, float *value, int totdim, const int dimsize[], const float range[2])
 
static int prop_subscript_ass_array_slice__int_recursive (PyObject **value_items, int *value, int totdim, const int dimsize[], const int range[2])
 
static int prop_subscript_ass_array_slice__bool_recursive (PyObject **value_items, bool *value, int totdim, const int dimsize[])
 
static int prop_subscript_ass_array_slice (PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int start, int stop, int length, PyObject *value_orig)
 
static int prop_subscript_ass_array_int (BPy_PropertyArrayRNA *self, Py_ssize_t keynum, PyObject *value)
 
static int pyrna_prop_array_ass_subscript (BPy_PropertyArrayRNA *self, PyObject *key, PyObject *value)
 
static int pyrna_prop_array_contains (BPy_PropertyRNA *self, PyObject *value)
 
static int pyrna_prop_collection_contains (BPy_PropertyRNA *self, PyObject *key)
 
static int pyrna_struct_contains (BPy_StructRNA *self, PyObject *value)
 
static PyObject * pyrna_struct_subscript (BPy_StructRNA *self, PyObject *key)
 
static int pyrna_struct_ass_subscript (BPy_StructRNA *self, PyObject *key, PyObject *value)
 
 PyDoc_STRVAR (pyrna_struct_keys_doc, ".. method:: keys()\n" "\n" " Returns the keys of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property keys.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewKeys`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
 
static PyObject * pyrna_struct_keys (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_items_doc, ".. method:: items()\n" "\n" " Returns the items of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property key, value pairs.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewItems`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
 
static PyObject * pyrna_struct_items (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_values_doc, ".. method:: values()\n" "\n" " Returns the values of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property values.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewValues`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
 
static PyObject * pyrna_struct_values (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_is_property_set_doc, ".. method:: is_property_set(property, ghost=True)\n" "\n" " Check if a property is set, use for testing operator properties.\n" "\n" " :arg ghost: Used for operators that re-run with previous settings.\n" " In this case the property is not marked as set,\n" " yet the value from the previous execution is used.\n" "\n" " In rare cases you may want to set this option to false.\n" "\n" " :type ghost: boolean\n" " :return: True when the property has been set.\n" " :rtype: boolean\n")
 
static PyObject * pyrna_struct_is_property_set (BPy_StructRNA *self, PyObject *args, PyObject *kw)
 
 PyDoc_STRVAR (pyrna_struct_property_unset_doc, ".. method:: property_unset(property)\n" "\n" " Unset a property, will use default value afterward.\n")
 
static PyObject * pyrna_struct_property_unset (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_is_property_hidden_doc, ".. method:: is_property_hidden(property)\n" "\n" " Check if a property is hidden.\n" "\n" " :return: True when the property is hidden.\n" " :rtype: boolean\n")
 
static PyObject * pyrna_struct_is_property_hidden (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_is_property_readonly_doc, ".. method:: is_property_readonly(property)\n" "\n" " Check if a property is readonly.\n" "\n" " :return: True when the property is readonly (not writable).\n" " :rtype: boolean\n")
 
static PyObject * pyrna_struct_is_property_readonly (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_is_property_overridable_library_doc, ".. method:: is_property_overridable_library(property)\n" "\n" " Check if a property is overridable.\n" "\n" " :return: True when the property is overridable.\n" " :rtype: boolean\n")
 
static PyObject * pyrna_struct_is_property_overridable_library (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_property_overridable_library_set_doc, ".. method:: property_overridable_library_set(property, overridable)\n" "\n" " Define a property as overridable or not (only for custom properties!).\n" "\n" " :return: True when the overridable status of the property was successfully set.\n" " :rtype: boolean\n")
 
static PyObject * pyrna_struct_property_overridable_library_set (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_path_resolve_doc, ".. method:: path_resolve(path, coerce=True)\n" "\n" " Returns the property from the path, raise an exception when not found.\n" "\n" " :arg path: path which this property resolves.\n" " :type path: string\n" " :arg coerce: optional argument, when True, the property will be converted\n" " into its Python representation.\n" " :type coerce: boolean\n")
 
static PyObject * pyrna_struct_path_resolve (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_path_from_id_doc, ".. method:: path_from_id(property=\"\")\n" "\n" " Returns the data path from the ID to this object (string).\n" "\n" " :arg property: Optional property name which can be used if the path is\n" " to a property of this object.\n" " :type property: string\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data`\n" " to this struct and property (when given).\n" " :rtype: str\n")
 
static PyObject * pyrna_struct_path_from_id (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_prop_path_from_id_doc, ".. method:: path_from_id()\n" "\n" " Returns the data path from the ID to this property (string).\n" "\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data` to this property.\n" " :rtype: str\n")
 
static PyObject * pyrna_prop_path_from_id (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_prop_as_bytes_doc, ".. method:: as_bytes()\n" "\n" " Returns this string property as a byte rather than a Python string.\n" "\n" " :return: The string as bytes.\n" " :rtype: bytes\n")
 
static PyObject * pyrna_prop_as_bytes (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_prop_update_doc, ".. method:: update()\n" "\n" " Execute the properties update callback.\n" "\n" " .. note::\n" " This is called when assigning a property,\n" " however in rare cases it's useful to call explicitly.\n")
 
static PyObject * pyrna_prop_update (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_type_recast_doc, ".. method:: type_recast()\n" "\n" " Return a new instance, this is needed because types\n" " such as textures can be changed at runtime.\n" "\n" " :return: a new instance of this object with the type initialized again.\n" " :rtype: subclass of :class:`bpy.types.bpy_struct`\n")
 
static PyObject * pyrna_struct_type_recast (BPy_StructRNA *self)
 
static PyObject * pyrna_struct_bl_rna_find_subclass_recursive (PyObject *cls, const char *id)
 
 PyDoc_STRVAR (pyrna_struct_bl_rna_get_subclass_py_doc, ".. classmethod:: bl_rna_get_subclass_py(id, default=None)\n" "\n" " :arg id: The RNA type identifier.\n" " :type id: string\n" " :return: The class or default when not found.\n" " :rtype: type\n")
 
static PyObject * pyrna_struct_bl_rna_get_subclass_py (PyObject *cls, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_bl_rna_get_subclass_doc, ".. classmethod:: bl_rna_get_subclass(id, default=None)\n" "\n" " :arg id: The RNA type identifier.\n" " :type id: string\n" " :return: The RNA type or default when not found.\n" " :rtype: :class:`bpy.types.Struct` subclass\n")
 
static PyObject * pyrna_struct_bl_rna_get_subclass (PyObject *cls, PyObject *args)
 
static void pyrna_dir_members_py__add_keys (PyObject *list, PyObject *dict)
 
static void pyrna_dir_members_py (PyObject *list, PyObject *self)
 
static void pyrna_dir_members_rna (PyObject *list, PointerRNA *ptr)
 
static PyObject * pyrna_struct_dir (BPy_StructRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_id_properties_ensure_doc, ".. method:: id_properties_ensure()\n\n" " :return: the parent group for an RNA struct's custom IDProperties.\n" " :rtype: :class:`bpy.types.IDPropertyGroup`\n")
 
static PyObject * pyrna_struct_id_properties_ensure (BPy_StructRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_id_properties_ui_doc, ".. method:: id_properties_ui(key)\n" "\n" " :return: Return an object used to manage an IDProperty's UI data.\n" " :arg key: String name of the property.\n" " :rtype: :class:`bpy.types.IDPropertyUIManager`\n")
 
static PyObject * pyrna_struct_id_properties_ui (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_id_properties_clear_doc, ".. method:: id_properties_clear()\n\n" " :return: Remove the parent group for an RNA struct's custom IDProperties.\n")
 
static PyObject * pyrna_struct_id_properties_clear (BPy_StructRNA *self)
 
static PyObject * pyrna_struct_getattro (BPy_StructRNA *self, PyObject *pyname)
 
static int pyrna_struct_meta_idprop_setattro (PyObject *cls, PyObject *attr, PyObject *value)
 
static int pyrna_struct_setattro (BPy_StructRNA *self, PyObject *pyname, PyObject *value)
 
static PyObject * pyrna_prop_dir (BPy_PropertyRNA *self)
 
static PyObject * pyrna_prop_array_getattro (BPy_PropertyRNA *self, PyObject *pyname)
 
static PyObject * pyrna_prop_collection_getattro (BPy_PropertyRNA *self, PyObject *pyname)
 
static int pyrna_prop_collection_setattro (BPy_PropertyRNA *self, PyObject *pyname, PyObject *value)
 
static PyObject * pyrna_prop_collection_idprop_add (BPy_PropertyRNA *self)
 
static PyObject * pyrna_prop_collection_idprop_remove (BPy_PropertyRNA *self, PyObject *value)
 
static PyObject * pyrna_prop_collection_idprop_clear (BPy_PropertyRNA *self)
 
static PyObject * pyrna_prop_collection_idprop_move (BPy_PropertyRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_get_id_data_doc, "The :class:`bpy.types.ID` object this datablock is from or None, (not available for " "all data types)")
 
static PyObject * pyrna_struct_get_id_data (BPy_DummyPointerRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_get_data_doc, "The data this property is using, *type* :class:`bpy.types.bpy_struct`")
 
static PyObject * pyrna_struct_get_data (BPy_DummyPointerRNA *self)
 
 PyDoc_STRVAR (pyrna_struct_get_rna_type_doc, "The property type for introspection")
 
static PyObject * pyrna_struct_get_rna_type (BPy_PropertyRNA *self)
 
static PyObject * pyrna_func_doc_get (BPy_FunctionRNA *self, void *closure)
 
 PyDoc_STRVAR (pyrna_prop_collection_keys_doc, ".. method:: keys()\n" "\n" " Return the identifiers of collection members\n" " (matching Python's dict.keys() functionality).\n" "\n" " :return: the identifiers for each member of this collection.\n" " :rtype: list of strings\n")
 
static PyObject * pyrna_prop_collection_keys (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_prop_collection_items_doc, ".. method:: items()\n" "\n" " Return the identifiers of collection members\n" " (matching Python's dict.items() functionality).\n" "\n" " :return: (key, value) pairs for each member of this collection.\n" " :rtype: list of tuples\n")
 
static PyObject * pyrna_prop_collection_items (BPy_PropertyRNA *self)
 
 PyDoc_STRVAR (pyrna_prop_collection_values_doc, ".. method:: values()\n" "\n" " Return the values of collection\n" " (matching Python's dict.values() functionality).\n" "\n" " :return: the members of this collection.\n" " :rtype: list\n")
 
 PyDoc_STRVAR (pyrna_struct_get_doc, ".. method:: get(key, default=None)\n" "\n" " Returns the value of the custom property assigned to key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with the custom property.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
 
static PyObject * pyrna_struct_get (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_pop_doc, ".. method:: pop(key, default=None)\n" "\n" " Remove and return the value of the custom property assigned to key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with the custom property.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
 
static PyObject * pyrna_struct_pop (BPy_StructRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_struct_as_pointer_doc, ".. method:: as_pointer()\n" "\n" " Returns the memory address which holds a pointer to Blender's internal data\n" "\n" " :return: int (memory address).\n" " :rtype: int\n" "\n" " .. note:: This is intended only for advanced script writers who need to\n" " pass blender data to their own C/Python modules.\n")
 
static PyObject * pyrna_struct_as_pointer (BPy_StructRNA *self)
 
 PyDoc_STRVAR (pyrna_prop_collection_get_doc, ".. method:: get(key, default=None)\n" "\n" " Returns the value of the item assigned to key or default when not found\n" " (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The identifier for the collection member.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n")
 
static PyObject * pyrna_prop_collection_get (BPy_PropertyRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_prop_collection_find_doc, ".. method:: find(key)\n" "\n" " Returns the index of a key in a collection or -1 when not found\n" " (matches Python's string find function of the same name).\n" "\n" " :arg key: The identifier for the collection member.\n" " :type key: string\n" " :return: index of the key.\n" " :rtype: int\n")
 
static PyObject * pyrna_prop_collection_find (BPy_PropertyRNA *self, PyObject *key_ob)
 
static bool foreach_attr_type (BPy_PropertyRNA *self, const char *attr, RawPropertyType *r_raw_type, int *r_attr_tot, bool *r_attr_signed)
 
static int foreach_parse_args (BPy_PropertyRNA *self, PyObject *args, const char **r_attr, PyObject **r_seq, int *r_tot, int *r_size, RawPropertyType *r_raw_type, int *r_attr_tot, bool *r_attr_signed)
 
static bool foreach_compat_buffer (RawPropertyType raw_type, int attr_signed, const char *format)
 
static PyObject * foreach_getset (BPy_PropertyRNA *self, PyObject *args, int set)
 
 PyDoc_STRVAR (pyrna_prop_collection_foreach_get_doc, ".. method:: foreach_get(attr, seq)\n" "\n" " This is a function to give fast access to attributes within a collection.\n")
 
static PyObject * pyrna_prop_collection_foreach_get (BPy_PropertyRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_prop_collection_foreach_set_doc, ".. method:: foreach_set(attr, seq)\n" "\n" " This is a function to give fast access to attributes within a collection.\n")
 
static PyObject * pyrna_prop_collection_foreach_set (BPy_PropertyRNA *self, PyObject *args)
 
static PyObject * pyprop_array_foreach_getset (BPy_PropertyArrayRNA *self, PyObject *args, const bool do_set)
 
 PyDoc_STRVAR (pyrna_prop_array_foreach_get_doc, ".. method:: foreach_get(seq)\n" "\n" " This is a function to give fast access to array data.\n")
 
static PyObject * pyrna_prop_array_foreach_get (BPy_PropertyArrayRNA *self, PyObject *args)
 
 PyDoc_STRVAR (pyrna_prop_array_foreach_set_doc, ".. method:: foreach_set(seq)\n" "\n" " This is a function to give fast access to array data.\n")
 
static PyObject * pyrna_prop_array_foreach_set (BPy_PropertyArrayRNA *self, PyObject *args)
 
static PyObject * pyrna_prop_array_iter (BPy_PropertyArrayRNA *self)
 
static PyObject * pyrna_prop_collection_iter (BPy_PropertyRNA *self)
 
static PyObject * pyrna_struct_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
 
static PyObject * pyrna_prop_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
 
static PyObject * pyrna_param_to_py (PointerRNA *ptr, PropertyRNA *prop, void *data)
 
static PyObject * small_dict_get_item_string (PyObject *dict, const char *key_lookup)
 
static void pyrna_func_error_prefix (BPy_FunctionRNA *self, PropertyRNA *parm, const int parm_index, char *error, const size_t error_size)
 
static PyObject * pyrna_func_call (BPy_FunctionRNA *self, PyObject *args, PyObject *kw)
 
static PyObject * pyrna_func_doc_get (BPy_FunctionRNA *self, void *UNUSED(closure))
 
static void pyrna_prop_collection_iter_dealloc (BPy_PropertyCollectionIterRNA *self)
 
static PyObject * pyrna_prop_collection_iter_next (BPy_PropertyCollectionIterRNA *self)
 
static PyObject * pyrna_prop_collection_iter_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop)
 
static void pyrna_subtype_set_rna (PyObject *newclass, StructRNA *srna)
 
static PyObject * pyrna_srna_Subtype (StructRNA *srna)
 
static PyObject * pyrna_srna_PyBase (StructRNA *srna)
 
static PyObject * pyrna_srna_ExternalType (StructRNA *srna)
 
static StructRNAsrna_from_ptr (PointerRNA *ptr)
 
PyObject * pyrna_struct_CreatePyObject (PointerRNA *ptr)
 
PyObject * pyrna_prop_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop)
 
PyObject * pyrna_id_CreatePyObject (ID *id)
 
bool pyrna_id_FromPyObject (PyObject *obj, ID **id)
 
bool pyrna_id_CheckPyObject (PyObject *obj)
 
void BPY_rna_init (void)
 
void BPY_rna_exit (void)
 
PyObject * BPY_rna_module (void)
 
void BPY_update_rna_module (void)
 
StructRNApyrna_struct_as_srna (PyObject *self, const bool parent, const char *error_prefix)
 
const PointerRNApyrna_struct_as_ptr (PyObject *py_obj, const StructRNA *srna)
 
const PointerRNApyrna_struct_as_ptr_or_null (PyObject *py_obj, const StructRNA *srna)
 
int pyrna_struct_as_ptr_parse (PyObject *o, void *p)
 
int pyrna_struct_as_ptr_or_null_parse (PyObject *o, void *p)
 
StructRNAsrna_from_self (PyObject *self, const char *error_prefix)
 
static int pyrna_deferred_register_class_from_type_hints (StructRNA *srna, PyTypeObject *py_class)
 
static int pyrna_deferred_register_props (StructRNA *srna, PyObject *class_dict)
 
static int pyrna_deferred_register_class_recursive (StructRNA *srna, PyTypeObject *py_class)
 
int pyrna_deferred_register_class (StructRNA *srna, PyTypeObject *py_class)
 
static int rna_function_arg_count (FunctionRNA *func, int *min_count)
 
static int bpy_class_validate_recursive (PointerRNA *dummyptr, StructRNA *srna, void *py_data, int *have_function)
 
static int bpy_class_validate (PointerRNA *dummyptr, void *py_data, int *have_function)
 
static int bpy_class_call (bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
 
static void bpy_class_free (void *pyob_ptr)
 
void pyrna_alloc_types (void)
 
void pyrna_free_types (void)
 
 PyDoc_STRVAR (pyrna_register_class_doc, ".. function:: register_class(cls)\n" "\n" " Register a subclass of a Blender type class.\n" "\n" " :arg cls: Blender type class in:\n" " :class:`bpy.types.Panel`, :class:`bpy.types.UIList`,\n" " :class:`bpy.types.Menu`, :class:`bpy.types.Header`,\n" " :class:`bpy.types.Operator`, :class:`bpy.types.KeyingSetInfo`,\n" " :class:`bpy.types.RenderEngine`\n" " :type cls: class\n" " :raises ValueError:\n" " if the class is not a subclass of a registerable blender class.\n" "\n" " .. note::\n" "\n" " If the class has a *register* class method it will be called\n" " before registration.\n")
 
static PyObject * pyrna_register_class (PyObject *UNUSED(self), PyObject *py_class)
 
static int pyrna_srna_contains_pointer_prop_srna (StructRNA *srna_props, StructRNA *srna, const char **r_prop_identifier)
 
 PyDoc_STRVAR (pyrna_unregister_class_doc, ".. function:: unregister_class(cls)\n" "\n" " Unload the Python class from blender.\n" "\n" " If the class has an *unregister* class method it will be called\n" " before unregistering.\n")
 
static PyObject * pyrna_unregister_class (PyObject *UNUSED(self), PyObject *py_class)
 
void pyrna_struct_type_extend_capi (struct StructRNA *srna, struct PyMethodDef *method, struct PyGetSetDef *getset)
 
static PyObject * pyrna_bl_owner_id_get (PyObject *UNUSED(self))
 
static PyObject * pyrna_bl_owner_id_set (PyObject *UNUSED(self), PyObject *value)
 

Variables

BPy_StructRNAbpy_context_module = NULL
 
static bool rna_disallow_writes = false
 
static uchar mathutils_rna_array_cb_index = -1
 
static Mathutils_Callback mathutils_rna_array_cb
 
static uchar mathutils_rna_matrix_cb_index = -1
 
static Mathutils_Callback mathutils_rna_matrix_cb
 
static PyMappingMethods pyrna_prop_array_as_mapping
 
static PyMappingMethods pyrna_prop_collection_as_mapping
 
static PyNumberMethods pyrna_prop_array_as_number
 
static PyNumberMethods pyrna_prop_collection_as_number
 
static PySequenceMethods pyrna_prop_array_as_sequence
 
static PySequenceMethods pyrna_prop_collection_as_sequence
 
static PySequenceMethods pyrna_struct_as_sequence
 
static PyMappingMethods pyrna_struct_as_mapping
 
static PyGetSetDef pyrna_prop_getseters []
 
static PyGetSetDef pyrna_struct_getseters []
 
static PyGetSetDef pyrna_func_getseters []
 
static struct PyMethodDef pyrna_struct_methods []
 
static struct PyMethodDef pyrna_prop_methods []
 
static struct PyMethodDef pyrna_prop_array_methods []
 
static struct PyMethodDef pyrna_prop_collection_methods []
 
static struct PyMethodDef pyrna_prop_collection_idprop_methods []
 
PyTypeObject pyrna_struct_meta_idprop_Type
 
PyTypeObject pyrna_struct_Type
 
PyTypeObject pyrna_prop_Type
 
PyTypeObject pyrna_prop_array_Type
 
PyTypeObject pyrna_prop_collection_Type
 
static PyTypeObject pyrna_prop_collection_idprop_Type
 
PyTypeObject pyrna_func_Type
 
static PyTypeObject pyrna_prop_collection_iter_Type
 
static PyObject * bpy_types_dict = NULL
 
static PointerRNArna_module_ptr = NULL
 
PyMethodDef meth_bpy_register_class
 
PyMethodDef meth_bpy_unregister_class
 
PyMethodDef meth_bpy_owner_id_get
 
PyMethodDef meth_bpy_owner_id_set
 

RNA Types Module <tt>bpy.types</tt>

static struct PyMethodDef bpy_types_module_methods []
 
static struct PyModuleDef bpy_types_module_def
 
static PyObject * bpy_types_module_getattro (PyObject *self, PyObject *pyname)
 
static PyObject * bpy_types_module_dir (PyObject *self)
 
 PyDoc_STRVAR (bpy_types_module_doc, "Access to internal Blender types")
 
PyObject * BPY_rna_types (void)
 

Detailed Description

This file is the main interface between Python and Blender's data api (RNA), exposing RNA to Python so blender data can be accessed in a Python like way.

The two main types are BPy_StructRNA and BPy_PropertyRNA - the base classes for most of the data Python accesses in blender.

Definition in file bpy_rna.c.

Macro Definition Documentation

◆ BPY_DOC_ID_PROP_TYPE_NOTE

#define BPY_DOC_ID_PROP_TYPE_NOTE
Value:
" .. note::\n" \
"\n" \
" Only the :class:`bpy.types.ID`, :class:`bpy.types.Bone` and\n" \
" :class:`bpy.types.PoseBone` classes support custom properties.\n"

Definition at line 95 of file bpy_rna.c.

◆ BPY_REPLACEMENT_STRING

#define BPY_REPLACEMENT_STRING (   rna_attr,
  py_attr 
)
Value:
else if (STREQ(identifier, rna_attr)) \
{ \
if ((item = PyObject_GetAttr(py_class, py_attr))) { \
if (item != Py_None) { \
if (pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class:") != 0) { \
Py_DECREF(item); \
return -1; \
} \
} \
Py_DECREF(item); \
} \
else { \
PyErr_Clear(); \
} \
} /* Intentionally allow else here. */
#define STREQ(a, b)
static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix)
Definition: bpy_rna.c:1533

◆ MATHUTILS_CB_SUBTYPE_COLOR

#define MATHUTILS_CB_SUBTYPE_COLOR   3

Definition at line 390 of file bpy_rna.c.

◆ MATHUTILS_CB_SUBTYPE_EUL

#define MATHUTILS_CB_SUBTYPE_EUL   0

Definition at line 387 of file bpy_rna.c.

◆ MATHUTILS_CB_SUBTYPE_QUAT

#define MATHUTILS_CB_SUBTYPE_QUAT   2

Definition at line 389 of file bpy_rna.c.

◆ MATHUTILS_CB_SUBTYPE_VEC

#define MATHUTILS_CB_SUBTYPE_VEC   1

Definition at line 388 of file bpy_rna.c.

◆ PROP_ALL_VECTOR_SUBTYPES

#define PROP_ALL_VECTOR_SUBTYPES
Value:
case PROP_VELOCITY: \
case PROP_XYZ: \
@ PROP_DIRECTION
Definition: RNA_types.h:155
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_ACCELERATION
Definition: RNA_types.h:157
@ PROP_COORDS
Definition: RNA_types.h:167
@ PROP_TRANSLATION
Definition: RNA_types.h:154
@ PROP_XYZ_LENGTH
Definition: RNA_types.h:163
@ PROP_VELOCITY
Definition: RNA_types.h:156

Note that PROP_NONE is included as a vector subtype. this is because it is handy to have x/y access to fcurve keyframes and other fixed size float arrays of length 2-4.

Definition at line 617 of file bpy_rna.c.

◆ PYRNA_PROP_COLLECTION_ABS_INDEX

#define PYRNA_PROP_COLLECTION_ABS_INDEX (   ret_err)
Value:
if (keynum < 0) { \
keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \
if (keynum_abs < 0) { \
PyErr_Format(PyExc_IndexError, "bpy_prop_collection[%d]: out of range.", keynum); \
return ret_err; \
} \
} \
(void)0
PyObject * self
Definition: bpy_driver.c:165
SyclQueue void void size_t num_bytes void
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3762

Definition at line 2206 of file bpy_rna.c.

◆ USE_MATHUTILS

#define USE_MATHUTILS

Definition at line 70 of file bpy_rna.c.

◆ USE_PEDANTIC_WRITE

#define USE_PEDANTIC_WRITE

Definition at line 69 of file bpy_rna.c.

◆ USE_POSTPONED_ANNOTATIONS

#define USE_POSTPONED_ANNOTATIONS

This must be enabled to support Python 3.10's postponed annotations, from __future__ import annotations.

This has the disadvantage of evaluating strings at run-time, in the future we might be able to reinstate the older, more efficient logic using descriptors, see: pep-0649

Definition at line 80 of file bpy_rna.c.

◆ USE_STRING_COERCE

#define USE_STRING_COERCE

Definition at line 71 of file bpy_rna.c.

Function Documentation

◆ bpy_class_call()

static int bpy_class_call ( bContext C,
PointerRNA ptr,
FunctionRNA func,
ParameterList parms 
)
static

◆ bpy_class_free()

static void bpy_class_free ( void pyob_ptr)
static

Definition at line 8820 of file bpy_rna.c.

References bpy_intern_str_bl_rna, G, G_DEBUG_PYTHON, PyC_ObSpit(), and self.

Referenced by pyrna_free_types(), and pyrna_register_class().

◆ bpy_class_validate()

static int bpy_class_validate ( PointerRNA dummyptr,
void py_data,
int *  have_function 
)
static

Definition at line 8487 of file bpy_rna.c.

References bpy_class_validate_recursive(), and PointerRNA::type.

Referenced by pyrna_register_class().

◆ bpy_class_validate_recursive()

static int bpy_class_validate_recursive ( PointerRNA dummyptr,
StructRNA srna,
void py_data,
int *  have_function 
)
static

◆ BPY_id_release()

void BPY_id_release ( struct ID id)

Definition at line 287 of file bpy_rna.c.

References NULL, and void.

Referenced by BKE_libblock_free_data_py().

◆ BPY_rna_exit()

void BPY_rna_exit ( void  )

Definition at line 7726 of file bpy_rna.c.

References BLI_ghash_free(), BLI_ghash_len(), BLI_ghashIterator_getKey(), GHASH_ITER, id, ID::name, and NULL.

Referenced by BPY_python_end().

◆ BPY_rna_init()

void BPY_rna_init ( void  )

◆ BPY_rna_module()

PyObject* BPY_rna_module ( void  )

◆ BPY_rna_types()

PyObject* BPY_rna_types ( void  )

◆ bpy_types_module_dir()

static PyObject* bpy_types_module_dir ( PyObject *  self)
static

Definition at line 7837 of file bpy_rna.c.

References pos, ret, RNA_PROP_BEGIN, RNA_PROP_END, RNA_struct_identifier(), and state.

◆ bpy_types_module_getattro()

static PyObject* bpy_types_module_getattro ( PyObject *  self,
PyObject *  pyname 
)
static

◆ BPY_update_rna_module()

void BPY_update_rna_module ( void  )

Definition at line 7762 of file bpy_rna.c.

References PointerRNA::data, G_MAIN, RNA_main_pointer_create(), and rna_module_ptr.

Referenced by BPY_driver_exec(), and BPY_modules_update().

◆ deferred_register_prop()

static int deferred_register_prop ( StructRNA srna,
PyObject *  key,
PyObject *  item 
)
static

◆ foreach_attr_type()

static bool foreach_attr_type ( BPy_PropertyRNA self,
const char *  attr,
RawPropertyType r_raw_type,
int *  r_attr_tot,
bool r_attr_signed 
)
static

◆ foreach_compat_buffer()

static bool foreach_compat_buffer ( RawPropertyType  raw_type,
int  attr_signed,
const char *  format 
)
static

◆ foreach_getset()

static PyObject* foreach_getset ( BPy_PropertyRNA self,
PyObject *  args,
int  set 
)
static

◆ foreach_parse_args()

static int foreach_parse_args ( BPy_PropertyRNA self,
PyObject *  args,
const char **  r_attr,
PyObject **  r_seq,
int *  r_tot,
int *  r_size,
RawPropertyType r_raw_type,
int *  r_attr_tot,
bool r_attr_signed 
)
static

◆ mathutils_rna_generic_check()

static int mathutils_rna_generic_check ( BaseMathObject bmo)
static

Definition at line 392 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT.

◆ mathutils_rna_matrix_get()

static int mathutils_rna_matrix_get ( BaseMathObject bmo,
int   UNUSEDsubtype 
)
static

Definition at line 536 of file bpy_rna.c.

References NULL, PYRNA_PROP_CHECK_INT, RNA_property_float_get_array(), and self.

◆ mathutils_rna_matrix_set()

static int mathutils_rna_matrix_set ( BaseMathObject bmo,
int   UNUSEDsubtype 
)
static

◆ mathutils_rna_vector_get()

static int mathutils_rna_vector_get ( BaseMathObject bmo,
int  subtype 
)
static

◆ mathutils_rna_vector_get_index()

static int mathutils_rna_vector_get_index ( BaseMathObject bmo,
int   UNUSEDsubtype,
int  index 
)
static

Definition at line 477 of file bpy_rna.c.

References NULL, PYRNA_PROP_CHECK_INT, RNA_property_float_get_index(), and self.

◆ mathutils_rna_vector_set()

static int mathutils_rna_vector_set ( BaseMathObject bmo,
int  subtype 
)
static

◆ mathutils_rna_vector_set_index()

static int mathutils_rna_vector_set_index ( BaseMathObject bmo,
int   UNUSEDsubtype,
int  index 
)
static

◆ prop_subscript_ass_array_int()

static int prop_subscript_ass_array_int ( BPy_PropertyArrayRNA self,
Py_ssize_t  keynum,
PyObject *  value 
)
static

◆ prop_subscript_ass_array_slice()

static int prop_subscript_ass_array_slice ( PointerRNA ptr,
PropertyRNA prop,
int  arraydim,
int  arrayoffset,
int  start,
int  stop,
int  length,
PyObject *  value_orig 
)
static

◆ prop_subscript_ass_array_slice__as_seq_fast()

static PyObject* prop_subscript_ass_array_slice__as_seq_fast ( PyObject *  value,
int  length 
)
static

◆ prop_subscript_ass_array_slice__bool_recursive()

static int prop_subscript_ass_array_slice__bool_recursive ( PyObject **  value_items,
bool value,
int  totdim,
const int  dimsize[] 
)
static

◆ prop_subscript_ass_array_slice__float_recursive()

static int prop_subscript_ass_array_slice__float_recursive ( PyObject **  value_items,
float value,
int  totdim,
const int  dimsize[],
const float  range[2] 
)
static

◆ prop_subscript_ass_array_slice__int_recursive()

static int prop_subscript_ass_array_slice__int_recursive ( PyObject **  value_items,
int *  value,
int  totdim,
const int  dimsize[],
const int  range[2] 
)
static

◆ PyDoc_STRVAR() [1/38]

PyDoc_STRVAR ( bpy_types_module_doc  ,
"Access to internal Blender types  
)

◆ PyDoc_STRVAR() [2/38]

PyDoc_STRVAR ( pyrna_prop_array_foreach_get_doc  ,
".. method:: foreach_get(seq)\n" "\n" " This is a function to give fast access to array data.\n"   
)

◆ PyDoc_STRVAR() [3/38]

PyDoc_STRVAR ( pyrna_prop_array_foreach_set_doc  ,
".. method:: foreach_set(seq)\n" "\n" " This is a function to give fast access to array data.\n"   
)

◆ PyDoc_STRVAR() [4/38]

PyDoc_STRVAR ( pyrna_prop_as_bytes_doc  ,
".. method:: as_bytes()\n" "\n" " Returns this string property as a byte rather than a Python string.\n" "\n" " :return: The string as bytes.\n" " :rtype: bytes\n"   
)

◆ PyDoc_STRVAR() [5/38]

PyDoc_STRVAR ( pyrna_prop_collection_find_doc  ,
".. method:: find(key)\n" "\n" " Returns the index of a key in a collection or -1 when not found\n" " (matches Python's string find function of the same name).\n" "\n" " :arg key: The identifier for the collection member.\n" " :type key: string\n" " :return: index of the key.\n" " :rtype: int\n"   
)

◆ PyDoc_STRVAR() [6/38]

PyDoc_STRVAR ( pyrna_prop_collection_foreach_get_doc  ,
".. method:: foreach_get(attr, seq)\n" "\n" " This is a function to give fast access to attributes within a collection.\n"   
)

◆ PyDoc_STRVAR() [7/38]

PyDoc_STRVAR ( pyrna_prop_collection_foreach_set_doc  ,
".. method:: foreach_set(attr, seq)\n" "\n" " This is a function to give fast access to attributes within a collection.\n"   
)

◆ PyDoc_STRVAR() [8/38]

PyDoc_STRVAR ( pyrna_prop_collection_get_doc  ,
".. method:: get(key, default=None)\n" "\n" " Returns the value of the item assigned to key or default when not found\n" " (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The identifier for the collection member.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n"   
)

◆ PyDoc_STRVAR() [9/38]

PyDoc_STRVAR ( pyrna_prop_collection_items_doc  ,
".. method:: items()\n" "\n" " Return the identifiers of collection members\n" " (matching Python's dict.items() functionality).\n" "\n" " :return: (key, value) pairs for each member of this collection.\n" " :rtype: list of tuples\n"   
)

◆ PyDoc_STRVAR() [10/38]

PyDoc_STRVAR ( pyrna_prop_collection_keys_doc  ,
".. method:: keys()\n" "\n" " Return the identifiers of collection members\n" " (matching Python's dict.keys() functionality).\n" "\n" " :return: the identifiers for each member of this collection.\n" " :rtype: list of strings\n"   
)

◆ PyDoc_STRVAR() [11/38]

PyDoc_STRVAR ( pyrna_prop_collection_values_doc  ,
".. method:: values()\n" "\n" " Return the values of collection\n" " (matching Python's dict.values() functionality).\n" "\n" " :return: the members of this collection.\n" " :rtype: list\n"   
)

◆ PyDoc_STRVAR() [12/38]

PyDoc_STRVAR ( pyrna_prop_path_from_id_doc  ,
".. method:: path_from_id()\n" "\n" " Returns the data path from the ID to this property (string).\n" "\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data` to this property.\n" " :rtype: str\n"   
)

◆ PyDoc_STRVAR() [13/38]

PyDoc_STRVAR ( pyrna_prop_update_doc  ,
".. method:: update()\n" "\n" " Execute the properties update callback.\n" "\n" " .. note::\n" " This is called when assigning a  property,
\n" " however in rare cases it 's useful to call explicitly.\n"   
)

◆ PyDoc_STRVAR() [14/38]

PyDoc_STRVAR ( pyrna_register_class_doc  ,
".. function:: register_class(cls)\n" "\n" " Register a subclass of a Blender type class.\n" "\n" " :arg cls: Blender type class in:\n" " :class:`bpy.types.Panel ,
:class:`bpy.types.UIList`  ,
\n" " :class:`bpy.types.Menu ,
:class:`bpy.types.Header ,
\n" " :class:`bpy.types.Operator`  ,
:class:`bpy.types.KeyingSetInfo ,
\n" " :class:`bpy.types.RenderEngine`\n" " :type cls:class\n" " :raises ValueError:\n" " if the class is not a subclass of a registerable blender class.\n" "\n" " .. note::\n" "\n" " If the class has a *register *class method it will be called\n" " before registration.\n"   
)
Warning
memory leak!

There is currently a bug where moving the registration of a Python class does not properly manage reference-counts from the Python class. As the srna owns the Python class this should not be so tricky, but changing the references as you'd expect when changing ownership crashes blender on exit so I had to comment out the #Py_DECREF. This is not so bad because the leak only happens when re-registering (continuously running SCRIPT_OT_reload).

  • Should still be fixed - Campbell

◆ PyDoc_STRVAR() [15/38]

PyDoc_STRVAR ( pyrna_struct_as_pointer_doc  ,
".. method:: as_pointer()\n" "\n" " Returns the memory address which holds a pointer to Blender's internal data\n" "\n" " :return: int (memory address).\n" " :rtype: int\n" "\n" " .. note:: This is intended only for advanced script writers who need to\n" " pass blender data to their own C/Python modules.\n"   
)

◆ PyDoc_STRVAR() [16/38]

PyDoc_STRVAR ( pyrna_struct_bl_rna_get_subclass_doc  ,
".. classmethod:: bl_rna_get_subclass(id, default=None)\n" "\n" " :arg id: The RNA type identifier.\n" " :type id: string\n" " :return: The RNA type or default when not found.\n" " :rtype: :class:`bpy.types.Struct` subclass\n"   
)

◆ PyDoc_STRVAR() [17/38]

PyDoc_STRVAR ( pyrna_struct_bl_rna_get_subclass_py_doc  ,
".. classmethod:: bl_rna_get_subclass_py(id, default=None)\n" "\n" " :arg id: The RNA type identifier.\n" " :type id: string\n" " :return: The class or default when not found.\n" " :rtype: type\n"   
)

◆ PyDoc_STRVAR() [18/38]

PyDoc_STRVAR ( pyrna_struct_get_data_doc  ,
"The data this property is  using,
*type *:class:`bpy.types.bpy_struct`"   
)

◆ PyDoc_STRVAR() [19/38]

PyDoc_STRVAR ( pyrna_struct_get_doc  ,
".. method:: get(key, default=None)\n" "\n" " Returns the value of the custom property assigned to key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with the custom property.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n" "\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)

◆ PyDoc_STRVAR() [20/38]

PyDoc_STRVAR ( pyrna_struct_get_id_data_doc  ,
"The :class:`bpy.types.ID` object this datablock is from or  None,
(not available for " "all data types)"   
)

◆ PyDoc_STRVAR() [21/38]

PyDoc_STRVAR ( pyrna_struct_get_rna_type_doc  ,
"The property type for introspection"   
)

◆ PyDoc_STRVAR() [22/38]

PyDoc_STRVAR ( pyrna_struct_id_properties_clear_doc  ,
".. method:: id_properties_clear()\n\n" " :return: Remove the parent group for an RNA struct's custom IDProperties.\n"   
)

◆ PyDoc_STRVAR() [23/38]

PyDoc_STRVAR ( pyrna_struct_id_properties_ensure_doc  ,
".. method:: id_properties_ensure()\n\n" " :return: the parent group for an RNA struct's custom IDProperties.\n" " :rtype: :class:`bpy.types.IDPropertyGroup`\n"   
)

◆ PyDoc_STRVAR() [24/38]

PyDoc_STRVAR ( pyrna_struct_id_properties_ui_doc  ,
".. method:: id_properties_ui(key)\n" "\n" " :return: Return an object used to manage an IDProperty's UI data.\n" " :arg key: String name of the property.\n" " :rtype: :class:`bpy.types.IDPropertyUIManager`\n"   
)

◆ PyDoc_STRVAR() [25/38]

PyDoc_STRVAR ( pyrna_struct_is_property_hidden_doc  ,
".. method:: is_property_hidden(property)\n" "\n" " Check if a property is hidden.\n" "\n" " :return: True when the property is hidden.\n" " :rtype: boolean\n"   
)

◆ PyDoc_STRVAR() [26/38]

PyDoc_STRVAR ( pyrna_struct_is_property_overridable_library_doc  ,
".. method:: is_property_overridable_library(property)\n" "\n" " Check if a property is overridable.\n" "\n" " :return: True when the property is overridable.\n" " :rtype: boolean\n"   
)

◆ PyDoc_STRVAR() [27/38]

PyDoc_STRVAR ( pyrna_struct_is_property_readonly_doc  ,
".. method:: is_property_readonly(property)\n" "\n" " Check if a property is readonly.\n" "\n" " :return: True when the property is readonly (not writable).\n" " :rtype: boolean\n"   
)

◆ PyDoc_STRVAR() [28/38]

PyDoc_STRVAR ( pyrna_struct_is_property_set_doc  ,
".. method:: is_property_set(property, ghost=True)\n" "\n" " Check if a property is  set,
use for testing operator properties.\n" "\n" " :arg ghost:Used for operators that re-run with previous settings.\n" " In this case the property is not marked as  set,
\n" " yet the value from the previous execution is used.\n" "\n" " In rare cases you may want to set this option to false.\n" "\n" " :type ghost:boolean\n" " :return:True when the property has been set.\n" " :rtype:boolean\n"   
)

◆ PyDoc_STRVAR() [29/38]

PyDoc_STRVAR ( pyrna_struct_items_doc  ,
".. method:: items()\n" "\n" " Returns the items of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property  key,
value pairs.\n" " :rtype::class:`idprop.type.IDPropertyGroupViewItems`\n" "\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)

◆ PyDoc_STRVAR() [30/38]

PyDoc_STRVAR ( pyrna_struct_keys_doc  ,
".. method:: keys()\n" "\n" " Returns the keys of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property keys.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewKeys`\n" "\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)

◆ PyDoc_STRVAR() [31/38]

PyDoc_STRVAR ( pyrna_struct_path_from_id_doc  ,
".. method:: path_from_id(property=\"\")\n" "\n" " Returns the data path from the ID to this object (string).\n" "\n" " :arg property: Optional property name which can be used if the path is\n" " to a property of this object.\n" " :type property: string\n" " :return: The path from :class:`bpy.types.bpy_struct.id_data`\n" " to this struct and property (when given).\n" " :rtype: str\n"   
)

◆ PyDoc_STRVAR() [32/38]

PyDoc_STRVAR ( pyrna_struct_path_resolve_doc  ,
".. method:: path_resolve(path, coerce=True)\n" "\n" " Returns the property from the  path,
raise an exception when not found.\n" "\n" " :arg path:path which this property resolves.\n" " :type path:string\n" " :arg coerce:optional  argument,
when  True,
the property will be converted\n" " into its Python representation.\n" " :type coerce:boolean\n"   
)

◆ PyDoc_STRVAR() [33/38]

PyDoc_STRVAR ( pyrna_struct_pop_doc  ,
".. method:: pop(key, default=None)\n" "\n" " Remove and return the value of the custom property assigned to key or default\n" " when not found (matches Python's dictionary function of the same name).\n" "\n" " :arg key: The key associated with the custom property.\n" " :type key: string\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Undefined\n" "\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)

◆ PyDoc_STRVAR() [34/38]

PyDoc_STRVAR ( pyrna_struct_property_overridable_library_set_doc  ,
".. method:: property_overridable_library_set(property, overridable)\n" "\n" " Define a property as overridable or not (only for custom properties!).\n" "\n" " :return: True when the overridable status of the property was successfully set.\n" " :rtype: boolean\n"   
)

◆ PyDoc_STRVAR() [35/38]

PyDoc_STRVAR ( pyrna_struct_property_unset_doc  ,
".. method:: property_unset(property)\n" "\n" " Unset a  property,
will use default value afterward.\n"   
)

◆ PyDoc_STRVAR() [36/38]

PyDoc_STRVAR ( pyrna_struct_type_recast_doc  ,
".. method:: type_recast()\n" "\n" " Return a new  instance,
this is needed because types\n" " such as textures can be changed at runtime.\n" "\n" " :return:a new instance of this object with the type initialized again.\n" " :rtype:subclass of :class:`bpy.types.bpy_struct`\n"   
)

◆ PyDoc_STRVAR() [37/38]

PyDoc_STRVAR ( pyrna_struct_values_doc  ,
".. method:: values()\n" "\n" " Returns the values of this objects custom properties (matches Python's\n" " dictionary function of the same name).\n" "\n" " :return: custom property values.\n" " :rtype: :class:`idprop.type.IDPropertyGroupViewValues`\n" "\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)

◆ PyDoc_STRVAR() [38/38]

PyDoc_STRVAR ( pyrna_unregister_class_doc  ,
".. function:: unregister_class(cls)\n" "\n" " Unload the Python class from blender.\n" "\n" " If the class has an *unregister* class method it will be called\n" " before unregistering.\n"   
)

◆ pyprop_array_foreach_getset()

static PyObject* pyprop_array_foreach_getset ( BPy_PropertyArrayRNA self,
PyObject *  args,
const bool  do_set 
)
static

◆ pyrna_alloc_types()

void pyrna_alloc_types ( void  )
Note
This isn't essential to run on startup, since subtypes will lazy initialize. But keep running in debug mode so we get immediate notification of bad class hierarchy or any errors in "bpy_types.py" at load time, so errors don't go unnoticed.

Definition at line 8853 of file bpy_rna.c.

References NULL, ptr, pyrna_struct_Subtype(), RNA_blender_rna_pointer_create(), RNA_PROP_BEGIN, RNA_PROP_END, and RNA_struct_find_property().

Referenced by BPY_python_start().

◆ pyrna_bl_owner_id_get()

static PyObject* pyrna_bl_owner_id_get ( PyObject *  UNUSEDself)
static

Definition at line 9272 of file bpy_rna.c.

References RNA_struct_state_owner_get().

◆ pyrna_bl_owner_id_set()

static PyObject* pyrna_bl_owner_id_set ( PyObject *  UNUSEDself,
PyObject *  value 
)
static

Definition at line 9281 of file bpy_rna.c.

References NULL, and RNA_struct_state_owner_set().

◆ pyrna_deferred_register_class()

int pyrna_deferred_register_class ( StructRNA srna,
PyTypeObject *  py_class 
)

◆ pyrna_deferred_register_class_from_type_hints()

static int pyrna_deferred_register_class_from_type_hints ( StructRNA srna,
PyTypeObject *  py_class 
)
static

Extract __annotations__ using typing.get_type_hints which handles the delayed evaluation.

Definition at line 8118 of file bpy_rna.c.

References BLI_assert, deferred_register_prop(), NULL, pos, and ret.

Referenced by pyrna_deferred_register_class().

◆ pyrna_deferred_register_class_recursive()

static int pyrna_deferred_register_class_recursive ( StructRNA srna,
PyTypeObject *  py_class 
)
static

Definition at line 8197 of file bpy_rna.c.

References len, pyrna_deferred_register_props(), pyrna_struct_Type, and ret.

Referenced by pyrna_deferred_register_class().

◆ pyrna_deferred_register_props()

static int pyrna_deferred_register_props ( StructRNA srna,
PyObject *  class_dict 
)
static

◆ pyrna_dir_members_py()

static void pyrna_dir_members_py ( PyObject *  list,
PyObject *  self 
)
static

◆ pyrna_dir_members_py__add_keys()

static void pyrna_dir_members_py__add_keys ( PyObject *  list,
PyObject *  dict 
)
static

Definition at line 4032 of file bpy_rna.c.

Referenced by pyrna_dir_members_py().

◆ pyrna_dir_members_rna()

static void pyrna_dir_members_rna ( PyObject *  list,
PointerRNA ptr 
)
static

◆ pyrna_enum_as_string()

static const char* pyrna_enum_as_string ( PointerRNA ptr,
PropertyRNA prop 
)
static

◆ pyrna_enum_to_py()

static PyObject* pyrna_enum_to_py ( PointerRNA ptr,
PropertyRNA prop,
int  val 
)
static

◆ pyrna_free_types()

void pyrna_free_types ( void  )

◆ pyrna_func_call()

static PyObject* pyrna_func_call ( BPy_FunctionRNA self,
PyObject *  args,
PyObject *  kw 
)
static

◆ pyrna_func_doc_get() [1/2]

static PyObject* pyrna_func_doc_get ( BPy_FunctionRNA self,
void closure 
)
static

◆ pyrna_func_doc_get() [2/2]

static PyObject* pyrna_func_doc_get ( BPy_FunctionRNA self,
void UNUSEDclosure 
)
static

◆ pyrna_func_error_prefix()

static void pyrna_func_error_prefix ( BPy_FunctionRNA self,
PropertyRNA parm,
const int  parm_index,
char *  error,
const size_t  error_size 
)
static
Parameters
parm_indexThe argument index or -1 for keyword arguments.

Definition at line 6124 of file bpy_rna.c.

References BLI_snprintf(), error(), RNA_function_identifier(), RNA_property_identifier(), RNA_struct_identifier(), and PointerRNA::type.

Referenced by pyrna_func_call().

◆ pyrna_func_repr()

static PyObject* pyrna_func_repr ( BPy_FunctionRNA self)
static

Definition at line 1087 of file bpy_rna.c.

References RNA_function_identifier(), RNA_struct_identifier(), and self.

◆ pyrna_func_to_py()

static PyObject* pyrna_func_to_py ( const PointerRNA ptr,
FunctionRNA func 
)
static

◆ pyrna_id_CheckPyObject()

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(), and pyrna_id_FromPyObject().

◆ pyrna_id_CreatePyObject()

PyObject* pyrna_id_CreatePyObject ( ID id)

◆ pyrna_id_FromPyObject()

bool pyrna_id_FromPyObject ( PyObject *  obj,
ID **  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().

◆ pyrna_invalidate()

void pyrna_invalidate ( BPy_DummyPointerRNA self)

Definition at line 123 of file bpy_rna.c.

References RNA_POINTER_INVALIDATE, and self.

Referenced by BPY_DECREF_RNA_INVALIDATE().

◆ pyrna_math_object_from_array()

PyObject* pyrna_math_object_from_array ( PointerRNA ptr,
PropertyRNA prop 
)

◆ pyrna_param_to_py()

static PyObject* pyrna_param_to_py ( PointerRNA ptr,
PropertyRNA prop,
void data 
)
static

◆ pyrna_prop_array_ass_subscript()

static int pyrna_prop_array_ass_subscript ( BPy_PropertyArrayRNA self,
PyObject *  key,
PyObject *  value 
)
static

◆ pyrna_prop_array_bool()

static int pyrna_prop_array_bool ( BPy_PropertyRNA self)
static

Definition at line 2189 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT, RNA_property_array_length(), and self.

◆ pyrna_prop_array_contains()

static int pyrna_prop_array_contains ( BPy_PropertyRNA self,
PyObject *  value 
)
static

Definition at line 3290 of file bpy_rna.c.

References pyrna_array_contains_py(), and self.

◆ pyrna_prop_array_dealloc()

static void pyrna_prop_array_dealloc ( BPy_PropertyRNA self)
static

Definition at line 1194 of file bpy_rna.c.

References NULL, and self.

◆ pyrna_prop_array_foreach_get()

static PyObject* pyrna_prop_array_foreach_get ( BPy_PropertyArrayRNA self,
PyObject *  args 
)
static

Definition at line 5620 of file bpy_rna.c.

References pyprop_array_foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

◆ pyrna_prop_array_foreach_set()

static PyObject* pyrna_prop_array_foreach_set ( BPy_PropertyArrayRNA self,
PyObject *  args 
)
static

Definition at line 5631 of file bpy_rna.c.

References pyprop_array_foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

◆ pyrna_prop_array_getattro()

static PyObject* pyrna_prop_array_getattro ( BPy_PropertyRNA self,
PyObject *  pyname 
)
static

Definition at line 4578 of file bpy_rna.c.

◆ pyrna_prop_array_iter()

static PyObject* pyrna_prop_array_iter ( BPy_PropertyArrayRNA self)
static

◆ pyrna_prop_array_length()

static Py_ssize_t pyrna_prop_array_length ( BPy_PropertyArrayRNA self)
static

◆ pyrna_prop_array_repr()

static PyObject* pyrna_prop_array_repr ( BPy_PropertyArrayRNA self)
static

Definition at line 1082 of file bpy_rna.c.

References pyrna_prop_repr_ex(), and self.

◆ pyrna_prop_array_subscript()

static PyObject* pyrna_prop_array_subscript ( BPy_PropertyArrayRNA self,
PyObject *  key 
)
static

◆ pyrna_prop_array_subscript_int()

static PyObject* pyrna_prop_array_subscript_int ( BPy_PropertyArrayRNA self,
int  keynum 
)
static

◆ pyrna_prop_array_subscript_slice()

static PyObject * pyrna_prop_array_subscript_slice ( BPy_PropertyArrayRNA self,
PointerRNA ptr,
PropertyRNA prop,
Py_ssize_t  start,
Py_ssize_t  stop,
Py_ssize_t  length 
)
static

TODO: dimensions

Note
Could also use pyrna_prop_array_to_py_index(self, count) in a loop, but it's much slower since at the moment it reads (and even allocates) the entire array for each index.

Definition at line 2556 of file bpy_rna.c.

References BLI_assert_msg, count, blender::math::length(), NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, ptr, pyrna_prop_array_to_py_index(), PYRNA_STACK_ARRAY, RNA_property_array_dimension(), RNA_property_boolean_get_array(), RNA_property_float_get_array(), RNA_property_int_get_array(), and RNA_property_type().

Referenced by pyrna_math_object_from_array(), pyrna_prop_array_iter(), and pyrna_prop_array_subscript().

◆ pyrna_prop_array_to_py_index()

static PyObject* pyrna_prop_array_to_py_index ( BPy_PropertyArrayRNA self,
int  index 
)
static

◆ pyrna_prop_as_bytes()

static PyObject* pyrna_prop_as_bytes ( BPy_PropertyRNA self)
static

◆ pyrna_prop_collection_ass_subscript()

static int pyrna_prop_collection_ass_subscript ( BPy_PropertyRNA self,
PyObject *  key,
PyObject *  value 
)
static

◆ pyrna_prop_collection_ass_subscript_int()

static int pyrna_prop_collection_ass_subscript_int ( BPy_PropertyRNA self,
Py_ssize_t  keynum,
PyObject *  value 
)
static

◆ pyrna_prop_collection_bool()

static int pyrna_prop_collection_bool ( BPy_PropertyRNA self)
static

Definition at line 2196 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT, RNA_property_collection_is_empty(), and self.

◆ pyrna_prop_collection_contains()

static int pyrna_prop_collection_contains ( BPy_PropertyRNA self,
PyObject *  key 
)
static

◆ pyrna_prop_collection_find()

static PyObject* pyrna_prop_collection_find ( BPy_PropertyRNA self,
PyObject *  key_ob 
)
static

◆ pyrna_prop_collection_foreach_get()

static PyObject* pyrna_prop_collection_foreach_get ( BPy_PropertyRNA self,
PyObject *  args 
)
static

Definition at line 5452 of file bpy_rna.c.

References foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

◆ pyrna_prop_collection_foreach_set()

static PyObject* pyrna_prop_collection_foreach_set ( BPy_PropertyRNA self,
PyObject *  args 
)
static

Definition at line 5463 of file bpy_rna.c.

References foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

◆ pyrna_prop_collection_get()

static PyObject* pyrna_prop_collection_get ( BPy_PropertyRNA self,
PyObject *  args 
)
static

◆ pyrna_prop_collection_getattro()

static PyObject* pyrna_prop_collection_getattro ( BPy_PropertyRNA self,
PyObject *  pyname 
)
static

◆ pyrna_prop_collection_idprop_add()

static PyObject* pyrna_prop_collection_idprop_add ( BPy_PropertyRNA self)
static

Odd case, we need to be able return a Python method from a #PyTypeObject.tp_getset.

Definition at line 4696 of file bpy_rna.c.

References PointerRNA::data, NULL, pyrna_struct_CreatePyObject(), rna_disallow_writes, rna_id_write_error(), RNA_property_collection_add(), and self.

◆ pyrna_prop_collection_idprop_clear()

static PyObject* pyrna_prop_collection_idprop_clear ( BPy_PropertyRNA self)
static

◆ pyrna_prop_collection_idprop_move()

static PyObject* pyrna_prop_collection_idprop_move ( BPy_PropertyRNA self,
PyObject *  args 
)
static

◆ pyrna_prop_collection_idprop_remove()

static PyObject* pyrna_prop_collection_idprop_remove ( BPy_PropertyRNA self,
PyObject *  value 
)
static

◆ pyrna_prop_collection_items()

static PyObject* pyrna_prop_collection_items ( BPy_PropertyRNA self)
static

◆ pyrna_prop_collection_iter()

static PyObject * pyrna_prop_collection_iter ( BPy_PropertyRNA self)
static

Definition at line 7197 of file bpy_rna.c.

References pyrna_prop_collection_iter_CreatePyObject(), and self.

◆ pyrna_prop_collection_iter_CreatePyObject()

static PyObject* pyrna_prop_collection_iter_CreatePyObject ( PointerRNA ptr,
PropertyRNA prop 
)
static

◆ pyrna_prop_collection_iter_dealloc()

static void pyrna_prop_collection_iter_dealloc ( BPy_PropertyCollectionIterRNA self)
static

Definition at line 7228 of file bpy_rna.c.

References NULL, RNA_property_collection_end(), and self.

◆ pyrna_prop_collection_iter_next()

static PyObject * pyrna_prop_collection_iter_next ( BPy_PropertyCollectionIterRNA self)
static

Definition at line 7202 of file bpy_rna.c.

References NULL, pyrna_struct_CreatePyObject(), RNA_property_collection_next(), and self.

◆ pyrna_prop_collection_keys()

static PyObject* pyrna_prop_collection_keys ( BPy_PropertyRNA self)
static

Definition at line 4850 of file bpy_rna.c.

References MEM_freeN, ret, RNA_PROP_BEGIN, RNA_PROP_END, RNA_struct_name_get_alloc(), and self.

◆ pyrna_prop_collection_length()

static Py_ssize_t pyrna_prop_collection_length ( BPy_PropertyRNA self)
static

Definition at line 2180 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT, RNA_property_collection_length(), and self.

Referenced by pyrna_prop_str().

◆ pyrna_prop_collection_setattro()

static int pyrna_prop_collection_setattro ( BPy_PropertyRNA self,
PyObject *  pyname,
PyObject *  value 
)
static

◆ pyrna_prop_collection_subscript()

static PyObject* pyrna_prop_collection_subscript ( BPy_PropertyRNA self,
PyObject *  key 
)
static

◆ pyrna_prop_collection_subscript_int()

static PyObject* pyrna_prop_collection_subscript_int ( BPy_PropertyRNA self,
Py_ssize_t  keynum 
)
static

◆ pyrna_prop_collection_subscript_is_valid_or_error()

static int pyrna_prop_collection_subscript_is_valid_or_error ( const PyObject *  value)
static
Parameters
resultThe result of calling a subscription operation on a collection (never NULL).

Definition at line 2219 of file bpy_rna.c.

References BLI_assert, BPy_StructRNA_Check, NULL, BPy_StructRNA::ptr, PointerRNA::type, and UNLIKELY.

Referenced by pyrna_prop_collection_subscript_int(), and pyrna_prop_collection_subscript_str().

◆ pyrna_prop_collection_subscript_slice()

static PyObject* pyrna_prop_collection_subscript_slice ( BPy_PropertyRNA self,
Py_ssize_t  start,
Py_ssize_t  stop 
)
static

◆ pyrna_prop_collection_subscript_str()

static PyObject* pyrna_prop_collection_subscript_str ( BPy_PropertyRNA self,
const char *  keyname 
)
static

◆ pyrna_prop_collection_subscript_str_lib_pair()

static PyObject* pyrna_prop_collection_subscript_str_lib_pair ( BPy_PropertyRNA self,
PyObject *  key,
const char *  err_prefix,
const bool  err_not_found 
)
static

◆ pyrna_prop_collection_subscript_str_lib_pair_ptr()

static int pyrna_prop_collection_subscript_str_lib_pair_ptr ( BPy_PropertyRNA self,
PyObject *  key,
const char *  err_prefix,
const short  err_not_found,
PointerRNA r_ptr 
)
static

Special case: bpy.data.objects["some_id_name", "//some_lib_name.blend"] also for: bpy.data.objects.get(("some_id_name", "//some_lib_name.blend"), fallback)

Note
error codes since this is not to be called directly from Python, this matches Python's __contains__ values C-API.
  • -1: exception set
  • 0: not found
  • 1: found

Definition at line 2413 of file bpy_rna.c.

References BLI_findstring(), id, lib, ID::lib, Main::libraries, ID::name, NULL, RNA_PROP_BEGIN, RNA_PROP_END, RNA_struct_identifier(), self, and STREQLEN.

Referenced by pyrna_prop_collection_contains(), and pyrna_prop_collection_subscript_str_lib_pair().

◆ pyrna_prop_collection_type_check()

static int pyrna_prop_collection_type_check ( BPy_PropertyRNA self,
PyObject *  value 
)
static

◆ pyrna_prop_collection_values()

static PyObject * pyrna_prop_collection_values ( BPy_PropertyRNA self)
static

Definition at line 4923 of file bpy_rna.c.

References pyrna_prop_collection_subscript_slice().

◆ pyrna_prop_compare()

static int pyrna_prop_compare ( BPy_PropertyRNA a,
BPy_PropertyRNA b 
)
static

Definition at line 798 of file bpy_rna.c.

References Freestyle::a, and usdtokens::b().

Referenced by pyrna_prop_richcmp().

◆ pyrna_prop_CreatePyObject()

PyObject* pyrna_prop_CreatePyObject ( PointerRNA ptr,
PropertyRNA prop 
)

◆ pyrna_prop_dealloc()

static void pyrna_prop_dealloc ( BPy_PropertyRNA self)
static

Definition at line 1183 of file bpy_rna.c.

References NULL, and self.

◆ pyrna_prop_dir()

static PyObject* pyrna_prop_dir ( BPy_PropertyRNA self)
static

◆ pyrna_prop_hash()

static long pyrna_prop_hash ( BPy_PropertyRNA self)
static

Definition at line 1101 of file bpy_rna.c.

References NULL, self, x, and y.

◆ pyrna_prop_new()

static PyObject* pyrna_prop_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  UNUSEDkwds 
)
static

Only needed for sub-typing, so a new class gets a valid BPy_StructRNA TODO: also accept useful args.

Definition at line 5897 of file bpy_rna.c.

References NULL, BPy_PropertyRNA::prop, BPy_PropertyRNA::ptr, pyrna_prop_Type, ret, and type.

◆ pyrna_prop_path_from_id()

static PyObject* pyrna_prop_path_from_id ( BPy_PropertyRNA self)
static

◆ pyrna_prop_repr()

static PyObject* pyrna_prop_repr ( BPy_PropertyRNA self)
static

Definition at line 1077 of file bpy_rna.c.

References pyrna_prop_repr_ex().

◆ pyrna_prop_repr_ex()

static PyObject* pyrna_prop_repr_ex ( BPy_PropertyRNA self,
const int  index_dim,
const int  index 
)
static

◆ pyrna_prop_richcmp()

static PyObject* pyrna_prop_richcmp ( PyObject *  a,
PyObject *  b,
int  op 
)
static

◆ pyrna_prop_str()

static PyObject* pyrna_prop_str ( BPy_PropertyRNA self)
static

◆ pyrna_prop_to_enum_bitfield()

static int pyrna_prop_to_enum_bitfield ( PointerRNA ptr,
PropertyRNA prop,
PyObject *  value,
int *  r_value,
const char *  error_prefix 
)
static

◆ pyrna_prop_to_py()

PyObject* pyrna_prop_to_py ( PointerRNA ptr,
PropertyRNA prop 
)

◆ pyrna_prop_update()

static PyObject* pyrna_prop_update ( BPy_PropertyRNA self)
static

Definition at line 3907 of file bpy_rna.c.

References BPY_context_get(), RNA_property_update(), and self.

◆ pyrna_prop_validity_check()

int pyrna_prop_validity_check ( BPy_PropertyRNA self)

Definition at line 111 of file bpy_rna.c.

References RNA_property_identifier(), and self.

◆ pyrna_py_to_prop()

static int pyrna_py_to_prop ( PointerRNA ptr,
PropertyRNA prop,
void data,
PyObject *  value,
const char *  error_prefix 
)
static

Definition at line 1533 of file bpy_rna.c.

References BKE_reports_init(), BLI_addtail(), BLI_assert, BLI_strncpy(), BPY_context_get(), bpy_intern_str_properties, BPy_reports_to_error(), BPy_StructRNA_Check, data, PointerRNA::data, ELEM, err, GHash::flag, LIB_TAG_TEMP_MAIN, MEM_callocN, NULL, PointerRNA::owner_id, PARM_OUTPUT, PARM_RNAPTR, PointerRNA_NULL, BPy_PropertyRNA::prop, PROP_BOOLEAN, PROP_BYTESTRING, PROP_COLLECTION, PROP_DIRPATH, PROP_ENUM, PROP_ENUM_FLAG, PROP_FILENAME, PROP_FILEPATH, PROP_FLOAT, PROP_ID_SELF_CHECK, PROP_INT, PROP_NEVER_NULL, PROP_POINTER, PROP_STRING, PROP_THICK_WRAP, CollectionPointerLink::ptr, BPy_StructRNA::ptr, BPy_PropertyRNA::ptr, ptr, PyC_Err_Format_Prefix(), PyC_ExceptionBuffer(), PyC_UnicodeAsByte(), pyrna_prop_collection_Type, pyrna_prop_to_enum_bitfield(), pyrna_py_to_array(), pyrna_pydict_to_props(), pyrna_string_to_enum(), pyrna_struct_CreatePyObject(), pyrna_struct_validity_check(), RNA_parameter_flag(), RNA_pointer_create(), RNA_property_array_check(), RNA_property_boolean_set(), RNA_property_collection_add(), RNA_property_collection_type_get(), RNA_property_enum_set(), RNA_property_flag(), RNA_property_float_clamp(), RNA_property_float_set(), RNA_property_identifier(), RNA_property_int_clamp(), RNA_property_int_set(), RNA_property_pointer_get(), RNA_property_pointer_set(), RNA_property_pointer_type(), RNA_property_string_maxlength(), RNA_property_string_set(), RNA_property_string_set_bytes(), RNA_property_subtype(), RNA_property_type(), RNA_property_update(), RNA_property_update_check(), RNA_struct_base_child_of(), RNA_struct_identifier(), RNA_struct_is_a(), RPT_STORE, STRINGIFY, ID::tag, type, PointerRNA::type, and UNLIKELY.

Referenced by bpy_class_call(), bpy_class_validate_recursive(), pyrna_func_call(), pyrna_prop_collection_setattro(), pyrna_pydict_to_props(), and pyrna_struct_setattro().

◆ pyrna_py_to_prop_array_index()

static int pyrna_py_to_prop_array_index ( BPy_PropertyArrayRNA self,
int  index,
PyObject *  value 
)
static

◆ pyrna_pydict_to_props()

int pyrna_pydict_to_props ( PointerRNA ptr,
PyObject *  kw,
const bool  all_args,
const char *  error_prefix 
)

◆ pyrna_register_class() [1/2]

static PyObject* pyrna_register_class ( PyObject *  self,
PyObject *  py_class 
)
static

◆ pyrna_register_class() [2/2]

static PyObject* pyrna_register_class ( PyObject *  UNUSEDself,
PyObject *  py_class 
)
static

◆ pyrna_rotation_euler_order_get()

static short pyrna_rotation_euler_order_get ( PointerRNA ptr,
const short  order_fallback,
PropertyRNA **  r_prop_eul_order 
)
static

◆ pyrna_srna_contains_pointer_prop_srna()

static int pyrna_srna_contains_pointer_prop_srna ( StructRNA srna_props,
StructRNA srna,
const char **  r_prop_identifier 
)
static

◆ pyrna_srna_ExternalType()

static PyObject* pyrna_srna_ExternalType ( StructRNA srna)
static

◆ pyrna_srna_PyBase()

static PyObject* pyrna_srna_PyBase ( StructRNA srna)
static

◆ pyrna_srna_Subtype()

static PyObject * pyrna_srna_Subtype ( StructRNA srna)
static

◆ pyrna_string_to_enum()

static int pyrna_string_to_enum ( PyObject *  item,
PointerRNA ptr,
PropertyRNA prop,
int *  r_value,
const char *  error_prefix 
)
static

Definition at line 1226 of file bpy_rna.c.

References BPY_context_get(), MEM_freeN, NULL, ptr, pyrna_enum_as_string(), and RNA_property_enum_value().

Referenced by pyrna_py_to_prop().

◆ pyrna_struct_as_pointer()

static PyObject* pyrna_struct_as_pointer ( BPy_StructRNA self)
static

Definition at line 5036 of file bpy_rna.c.

References self.

◆ pyrna_struct_as_ptr()

const PointerRNA* pyrna_struct_as_ptr ( PyObject *  py_obj,
const StructRNA srna 
)

◆ pyrna_struct_as_ptr_or_null()

const PointerRNA* pyrna_struct_as_ptr_or_null ( PyObject *  py_obj,
const StructRNA srna 
)

Definition at line 7974 of file bpy_rna.c.

References PointerRNA_NULL, and pyrna_struct_as_ptr().

Referenced by pyrna_struct_as_ptr_or_null_parse().

◆ pyrna_struct_as_ptr_or_null_parse()

int pyrna_struct_as_ptr_or_null_parse ( PyObject *  o,
void p 
)

A version of pyrna_struct_as_ptr_parse that maps Python's None to PointerRNA_NULL.

Definition at line 7993 of file bpy_rna.c.

References BLI_assert, NULL, BPy_StructRNA_Parse::ptr, pyrna_struct_as_ptr_or_null(), and BPy_StructRNA_Parse::type.

Referenced by bpy_context_temp_override().

◆ pyrna_struct_as_ptr_parse()

int pyrna_struct_as_ptr_parse ( PyObject *  o,
void p 
)

Sets BPy_StructRNA_Parse.ptr to the value in the BPy_StructRNA.ptr (from o) or raise an error if the type isn't a BPy_StructRNA.

Use with #PyArg_ParseTuple's O& formatting.

Definition at line 7982 of file bpy_rna.c.

References BLI_assert, NULL, BPy_StructRNA_Parse::ptr, pyrna_struct_as_ptr(), and BPy_StructRNA_Parse::type.

◆ pyrna_struct_as_srna()

StructRNA* pyrna_struct_as_srna ( PyObject *  self,
const bool  parent,
const char *  error_prefix 
)

◆ pyrna_struct_ass_subscript()

static int pyrna_struct_ass_subscript ( BPy_StructRNA self,
PyObject *  key,
PyObject *  value 
)
static

◆ pyrna_struct_bl_rna_find_subclass_recursive()

static PyObject* pyrna_struct_bl_rna_find_subclass_recursive ( PyObject *  cls,
const char *  id 
)
static
Note
Return value is borrowed, caller must #Py_INCREF.

Definition at line 3934 of file bpy_rna.c.

References BLI_assert, bpy_intern_str_bl_rna, PointerRNA::data, NULL, pos, BPy_StructRNA::ptr, RNA_struct_identifier(), and STREQ.

Referenced by pyrna_struct_bl_rna_get_subclass_py().

◆ pyrna_struct_bl_rna_get_subclass()

static PyObject* pyrna_struct_bl_rna_get_subclass ( PyObject *  cls,
PyObject *  args 
)
static

◆ pyrna_struct_bl_rna_get_subclass_py()

static PyObject* pyrna_struct_bl_rna_get_subclass_py ( PyObject *  cls,
PyObject *  args 
)
static

Definition at line 3975 of file bpy_rna.c.

References id, NULL, pyrna_struct_bl_rna_find_subclass_recursive(), and ret.

◆ pyrna_struct_compare()

static int pyrna_struct_compare ( BPy_StructRNA a,
BPy_StructRNA b 
)
static

Definition at line 793 of file bpy_rna.c.

References Freestyle::a, and usdtokens::b().

Referenced by pyrna_struct_richcmp().

◆ pyrna_struct_contains()

static int pyrna_struct_contains ( BPy_StructRNA self,
PyObject *  value 
)
static

◆ pyrna_struct_CreatePyObject()

PyObject* pyrna_struct_CreatePyObject ( PointerRNA ptr)

◆ pyrna_struct_dealloc()

static void pyrna_struct_dealloc ( BPy_StructRNA self)
static

Definition at line 1139 of file bpy_rna.c.

References IDP_FreeProperty(), NULL, and self.

◆ pyrna_struct_dir()

static PyObject* pyrna_struct_dir ( BPy_StructRNA self)
static

◆ pyrna_struct_get()

static PyObject* pyrna_struct_get ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_get_data()

static PyObject* pyrna_struct_get_data ( BPy_DummyPointerRNA self)
static

Definition at line 4794 of file bpy_rna.c.

References pyrna_struct_CreatePyObject(), and self.

◆ pyrna_struct_get_id_data()

static PyObject* pyrna_struct_get_id_data ( BPy_DummyPointerRNA self)
static

Definition at line 4780 of file bpy_rna.c.

References pyrna_struct_CreatePyObject(), RNA_id_pointer_create(), and self.

◆ pyrna_struct_get_rna_type()

static PyObject* pyrna_struct_get_rna_type ( BPy_PropertyRNA self)
static

Definition at line 4800 of file bpy_rna.c.

References NULL, pyrna_struct_Subtype(), RNA_pointer_create(), and self.

◆ pyrna_struct_getattro()

static PyObject* pyrna_struct_getattro ( BPy_StructRNA self,
PyObject *  pyname 
)
static

◆ pyrna_struct_hash()

static Py_hash_t pyrna_struct_hash ( BPy_StructRNA self)
static

Definition at line 1095 of file bpy_rna.c.

References self.

◆ pyrna_struct_id_properties_clear()

static PyObject* pyrna_struct_id_properties_clear ( BPy_StructRNA self)
static

◆ pyrna_struct_id_properties_ensure()

static PyObject* pyrna_struct_id_properties_ensure ( BPy_StructRNA self)
static

◆ pyrna_struct_id_properties_ui()

static PyObject* pyrna_struct_id_properties_ui ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_is_property_hidden()

static PyObject* pyrna_struct_is_property_hidden ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_is_property_overridable_library()

static PyObject* pyrna_struct_is_property_overridable_library ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_is_property_readonly()

static PyObject* pyrna_struct_is_property_readonly ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_is_property_set()

static PyObject* pyrna_struct_is_property_set ( BPy_StructRNA self,
PyObject *  args,
PyObject *  kw 
)
static

◆ pyrna_struct_items()

static PyObject* pyrna_struct_items ( BPy_PropertyRNA self)
static

◆ pyrna_struct_keys()

static PyObject* pyrna_struct_keys ( BPy_PropertyRNA self)
static

◆ pyrna_struct_meta_idprop_setattro()

static int pyrna_struct_meta_idprop_setattro ( PyObject *  cls,
PyObject *  attr,
PyObject *  value 
)
static

◆ pyrna_struct_new()

static PyObject* pyrna_struct_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  UNUSEDkwds 
)
static

only needed for sub-typing, so a new class gets a valid BPy_StructRNA TODO: also accept useful args.

Definition at line 5847 of file bpy_rna.c.

References NULL, BPy_StructRNA::ptr, pyrna_struct_Type, ret, and type.

◆ pyrna_struct_path_from_id()

static PyObject* pyrna_struct_path_from_id ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_path_resolve()

static PyObject* pyrna_struct_path_resolve ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_pop()

static PyObject* pyrna_struct_pop ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_property_overridable_library_set()

static PyObject* pyrna_struct_property_overridable_library_set ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_property_unset()

static PyObject* pyrna_struct_property_unset ( BPy_StructRNA self,
PyObject *  args 
)
static

◆ pyrna_struct_repr()

static PyObject* pyrna_struct_repr ( BPy_StructRNA self)
static

◆ pyrna_struct_richcmp()

static PyObject* pyrna_struct_richcmp ( PyObject *  a,
PyObject *  b,
int  op 
)
static

◆ pyrna_struct_setattro()

static int pyrna_struct_setattro ( BPy_StructRNA self,
PyObject *  pyname,
PyObject *  value 
)
static

◆ pyrna_struct_str()

static PyObject* pyrna_struct_str ( BPy_StructRNA self)
static

◆ pyrna_struct_subscript()

static PyObject* pyrna_struct_subscript ( BPy_StructRNA self,
PyObject *  key 
)
static

◆ pyrna_struct_Subtype()

static PyObject * pyrna_struct_Subtype ( PointerRNA ptr)
static

◆ pyrna_struct_type_extend_capi()

void pyrna_struct_type_extend_capi ( struct StructRNA srna,
struct PyMethodDef *  method,
struct PyGetSetDef *  getset 
)

Definition at line 9228 of file bpy_rna.c.

References BLI_assert, err, NULL, pyrna_srna_Subtype(), type, and UNUSED_VARS_NDEBUG.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_struct_type_recast()

static PyObject* pyrna_struct_type_recast ( BPy_StructRNA self)
static

◆ pyrna_struct_validity_check()

int pyrna_struct_validity_check ( BPy_StructRNA pysrna)

Definition at line 101 of file bpy_rna.c.

References BPy_StructRNA::ptr, and PointerRNA::type.

Referenced by pyrna_py_to_prop().

◆ pyrna_struct_values()

static PyObject* pyrna_struct_values ( BPy_PropertyRNA self)
static

◆ pyrna_subtype_set_rna()

static void pyrna_subtype_set_rna ( PyObject *  newclass,
StructRNA srna 
)
static

◆ pyrna_unregister_class() [1/2]

static PyObject* pyrna_unregister_class ( PyObject *  self,
PyObject *  py_class 
)
static

◆ pyrna_unregister_class() [2/2]

static PyObject* pyrna_unregister_class ( PyObject *  UNUSEDself,
PyObject *  py_class 
)
static

◆ pyrna_write_check()

bool pyrna_write_check ( void  )

◆ pyrna_write_set()

void pyrna_write_set ( bool  val)

◆ rna_function_arg_count()

static int rna_function_arg_count ( FunctionRNA func,
int *  min_count 
)
static

◆ rna_id_write_error()

static bool rna_id_write_error ( PointerRNA ptr,
PyObject *  key 
)
static

◆ small_dict_get_item_string()

static PyObject* small_dict_get_item_string ( PyObject *  dict,
const char *  key_lookup 
)
static

Use to replace PyDict_GetItemString() when the overhead of converting a string into a Python unicode is higher than a non hash lookup. works on small dict's such as keyword args.

Definition at line 6104 of file bpy_rna.c.

References NULL, pos, and STREQ.

Referenced by pyrna_func_call().

◆ srna_from_ptr()

static StructRNA* srna_from_ptr ( PointerRNA ptr)
static

Use for sub-typing so we know which SRNA is used for a PointerRNA.

Definition at line 7489 of file bpy_rna.c.

References PointerRNA::data, ptr, and PointerRNA::type.

Referenced by pyrna_free_types(), and pyrna_struct_Subtype().

◆ srna_from_self()

StructRNA* srna_from_self ( PyObject *  self,
const char *  error_prefix 
)

Variable Documentation

◆ bpy_context_module

BPy_StructRNA* bpy_context_module = NULL

◆ bpy_types_dict

PyObject* bpy_types_dict = NULL
static

Definition at line 7323 of file bpy_rna.c.

Referenced by pyrna_srna_ExternalType().

◆ bpy_types_module_def

struct PyModuleDef bpy_types_module_def
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
"bpy.types",
bpy_types_module_doc,
sizeof(struct BPy_TypesModule_State),
NULL,
NULL,
NULL,
NULL,
}
static struct PyMethodDef bpy_types_module_methods[]
Definition: bpy_rna.c:7858

Definition at line 7864 of file bpy_rna.c.

Referenced by BPY_rna_types().

◆ bpy_types_module_methods

struct PyMethodDef bpy_types_module_methods[]
static
Initial value:
= {
{"__getattr__", (PyCFunction)bpy_types_module_getattro, METH_O, NULL},
{"__dir__", (PyCFunction)bpy_types_module_dir, METH_NOARGS, NULL},
{NULL, NULL, 0, NULL},
}
static PyObject * bpy_types_module_dir(PyObject *self)
Definition: bpy_rna.c:7837
static PyObject * bpy_types_module_getattro(PyObject *self, PyObject *pyname)
Definition: bpy_rna.c:7804

Definition at line 7837 of file bpy_rna.c.

◆ mathutils_rna_array_cb

Mathutils_Callback mathutils_rna_array_cb
static
Initial value:
= {
}
static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype)
Definition: bpy_rna.c:423
static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int UNUSED(subtype), int index)
Definition: bpy_rna.c:477
static int mathutils_rna_generic_check(BaseMathObject *bmo)
Definition: bpy_rna.c:392
static int mathutils_rna_vector_get(BaseMathObject *bmo, int subtype)
Definition: bpy_rna.c:401
static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtype), int index)
Definition: bpy_rna.c:491
int(* BaseMathGetFunc)(BaseMathObject *, int)
Definition: mathutils.h:89
int(* BaseMathGetIndexFunc)(BaseMathObject *, int, int)
Definition: mathutils.h:93
int(* BaseMathSetIndexFunc)(BaseMathObject *, int, int)
Definition: mathutils.h:95
int(* BaseMathSetFunc)(BaseMathObject *, int)
Definition: mathutils.h:91
int(* BaseMathCheckFunc)(BaseMathObject *)
Definition: mathutils.h:87

Definition at line 525 of file bpy_rna.c.

Referenced by BPY_rna_init().

◆ mathutils_rna_array_cb_index

uchar mathutils_rna_array_cb_index = -1
static

Definition at line 384 of file bpy_rna.c.

Referenced by BPY_rna_init(), and pyrna_math_object_from_array().

◆ mathutils_rna_matrix_cb

Mathutils_Callback mathutils_rna_matrix_cb
static
Initial value:
= {
}
static int mathutils_rna_matrix_get(BaseMathObject *bmo, int UNUSED(subtype))
Definition: bpy_rna.c:536
static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype))
Definition: bpy_rna.c:550

Definition at line 583 of file bpy_rna.c.

Referenced by BPY_rna_init().

◆ mathutils_rna_matrix_cb_index

uchar mathutils_rna_matrix_cb_index = -1
static

Definition at line 534 of file bpy_rna.c.

Referenced by BPY_rna_init(), and pyrna_math_object_from_array().

◆ meth_bpy_owner_id_get

PyMethodDef meth_bpy_owner_id_get
Initial value:
= {
"_bl_owner_id_get",
(PyCFunction)pyrna_bl_owner_id_get,
METH_NOARGS,
}
static PyObject * pyrna_bl_owner_id_get(PyObject *UNUSED(self))
Definition: bpy_rna.c:9272

Definition at line 9301 of file bpy_rna.c.

Referenced by BPy_init_modules().

◆ meth_bpy_owner_id_set

PyMethodDef meth_bpy_owner_id_set
Initial value:
= {
"_bl_owner_id_set",
(PyCFunction)pyrna_bl_owner_id_set,
METH_O,
}
static PyObject * pyrna_bl_owner_id_set(PyObject *UNUSED(self), PyObject *value)
Definition: bpy_rna.c:9281

Definition at line 9307 of file bpy_rna.c.

Referenced by BPy_init_modules().

◆ meth_bpy_register_class

PyMethodDef meth_bpy_register_class
Initial value:
= {
"register_class", pyrna_register_class, METH_O, pyrna_register_class_doc}
static PyObject * pyrna_register_class(PyObject *self, PyObject *py_class)

Definition at line 8937 of file bpy_rna.c.

Referenced by BPy_init_modules().

◆ meth_bpy_unregister_class

PyMethodDef meth_bpy_unregister_class
Initial value:
= {
"unregister_class",
METH_O,
pyrna_unregister_class_doc,
}
static PyObject * pyrna_unregister_class(PyObject *self, PyObject *py_class)

Definition at line 9111 of file bpy_rna.c.

Referenced by BPy_init_modules().

◆ pyrna_func_getseters

PyGetSetDef pyrna_func_getseters[]
static
Initial value:
= {
{"__doc__", (getter)pyrna_func_doc_get, (setter)NULL, NULL, NULL},
}
static PyObject * pyrna_func_doc_get(BPy_FunctionRNA *self, void *closure)

Definition at line 4837 of file bpy_rna.c.

◆ pyrna_func_Type

PyTypeObject pyrna_func_Type

Definition at line 7003 of file bpy_rna.c.

Referenced by BPY_rna_init(), BPY_rna_types(), and pyrna_func_to_py().

◆ pyrna_prop_array_as_mapping

PyMappingMethods pyrna_prop_array_as_mapping
static
Initial value:
= {
}
static PyObject * pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject *key)
Definition: bpy_rna.c:2854
static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self)
Definition: bpy_rna.c:2169
static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self, PyObject *key, PyObject *value)
Definition: bpy_rna.c:3192

Definition at line 3252 of file bpy_rna.c.

◆ pyrna_prop_array_as_number

PyNumberMethods pyrna_prop_array_as_number
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static int pyrna_prop_array_bool(BPy_PropertyRNA *self)
Definition: bpy_rna.c:2189

Definition at line 3265 of file bpy_rna.c.

◆ pyrna_prop_array_as_sequence

PySequenceMethods pyrna_prop_array_as_sequence
static
Initial value:
= {
NULL,
NULL,
NULL,
(ssizeobjargproc)prop_subscript_ass_array_int,
NULL,
(binaryfunc)NULL,
(ssizeargfunc)NULL,
}
static int pyrna_prop_array_contains(BPy_PropertyRNA *self, PyObject *value)
Definition: bpy_rna.c:3290
static PyObject * pyrna_prop_array_subscript_int(BPy_PropertyArrayRNA *self, int keynum)
Definition: bpy_rna.c:2330
static int prop_subscript_ass_array_int(BPy_PropertyArrayRNA *self, Py_ssize_t keynum, PyObject *value)
Definition: bpy_rna.c:3172

Definition at line 3346 of file bpy_rna.c.

◆ pyrna_prop_array_methods

struct PyMethodDef pyrna_prop_array_methods[]
static
Initial value:
= {
{"foreach_get",
METH_VARARGS,
pyrna_prop_array_foreach_get_doc},
{"foreach_set",
METH_VARARGS,
pyrna_prop_array_foreach_set_doc},
{NULL, NULL, 0, NULL},
}
static PyObject * pyrna_prop_array_foreach_get(BPy_PropertyArrayRNA *self, PyObject *args)
Definition: bpy_rna.c:5620
static PyObject * pyrna_prop_array_foreach_set(BPy_PropertyArrayRNA *self, PyObject *args)
Definition: bpy_rna.c:5631

Definition at line 5662 of file bpy_rna.c.

◆ pyrna_prop_array_Type

PyTypeObject pyrna_prop_array_Type

Definition at line 6748 of file bpy_rna.c.

Referenced by BPY_rna_init(), BPY_rna_types(), and pyrna_prop_CreatePyObject().

◆ pyrna_prop_collection_as_mapping

PyMappingMethods pyrna_prop_collection_as_mapping
static
Initial value:
= {
}
static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self)
Definition: bpy_rna.c:2180
static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value)
Definition: bpy_rna.c:2769
static PyObject * pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject *key)
Definition: bpy_rna.c:2652

Definition at line 3258 of file bpy_rna.c.

◆ pyrna_prop_collection_as_number

PyNumberMethods pyrna_prop_collection_as_number
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static int pyrna_prop_collection_bool(BPy_PropertyRNA *self)
Definition: bpy_rna.c:2196

Definition at line 3277 of file bpy_rna.c.

◆ pyrna_prop_collection_as_sequence

PySequenceMethods pyrna_prop_collection_as_sequence
static
Initial value:
= {
NULL,
NULL,
NULL,
(ssizeobjargproc)
NULL ,
NULL,
(binaryfunc)NULL,
(ssizeargfunc)NULL,
}
static PyObject * pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum)
Definition: bpy_rna.c:2237
static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *key)
Definition: bpy_rna.c:3295

Definition at line 3360 of file bpy_rna.c.

◆ pyrna_prop_collection_idprop_methods

struct PyMethodDef pyrna_prop_collection_idprop_methods[]
static
Initial value:
= {
{"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL},
{"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL},
{"clear", (PyCFunction)pyrna_prop_collection_idprop_clear, METH_NOARGS, NULL},
{"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL},
}
static PyObject * pyrna_prop_collection_idprop_remove(BPy_PropertyRNA *self, PyObject *value)
Definition: bpy_rna.c:4716
static PyObject * pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObject *args)
Definition: bpy_rna.c:4753
static PyObject * pyrna_prop_collection_idprop_add(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4696
static PyObject * pyrna_prop_collection_idprop_clear(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4740

Definition at line 5662 of file bpy_rna.c.

◆ pyrna_prop_collection_idprop_Type

PyTypeObject pyrna_prop_collection_idprop_Type
static

Definition at line 6917 of file bpy_rna.c.

Referenced by BPY_rna_init(), and pyrna_prop_CreatePyObject().

◆ pyrna_prop_collection_iter_Type

PyTypeObject pyrna_prop_collection_iter_Type
static

Definition at line 7099 of file bpy_rna.c.

Referenced by BPY_rna_init(), and pyrna_prop_collection_iter_CreatePyObject().

◆ pyrna_prop_collection_methods

struct PyMethodDef pyrna_prop_collection_methods[]
static
Initial value:
= {
{"foreach_get",
METH_VARARGS,
pyrna_prop_collection_foreach_get_doc},
{"foreach_set",
METH_VARARGS,
pyrna_prop_collection_foreach_set_doc},
{"keys", (PyCFunction)pyrna_prop_collection_keys, METH_NOARGS, pyrna_prop_collection_keys_doc},
{"items",
METH_NOARGS,
pyrna_prop_collection_items_doc},
{"values",
METH_NOARGS,
pyrna_prop_collection_values_doc},
{"get", (PyCFunction)pyrna_prop_collection_get, METH_VARARGS, pyrna_prop_collection_get_doc},
{"find", (PyCFunction)pyrna_prop_collection_find, METH_O, pyrna_prop_collection_find_doc},
{NULL, NULL, 0, NULL},
}
static PyObject * pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
Definition: bpy_rna.c:5452
static PyObject * pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args)
Definition: bpy_rna.c:5052
static PyObject * pyrna_prop_collection_values(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4923
static PyObject * pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key_ob)
Definition: bpy_rna.c:5098
static PyObject * pyrna_prop_collection_keys(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4850
static PyObject * pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObject *args)
Definition: bpy_rna.c:5463
static PyObject * pyrna_prop_collection_items(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4880

Definition at line 5662 of file bpy_rna.c.

◆ pyrna_prop_collection_Type

PyTypeObject pyrna_prop_collection_Type

◆ pyrna_prop_getseters

PyGetSetDef pyrna_prop_getseters[]
static
Initial value:
= {
{"id_data",
(setter)NULL,
pyrna_struct_get_id_data_doc,
NULL},
{"data", (getter)pyrna_struct_get_data, (setter)NULL, pyrna_struct_get_data_doc, NULL},
{"rna_type",
(setter)NULL,
pyrna_struct_get_rna_type_doc,
NULL},
}
static PyObject * pyrna_struct_get_rna_type(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4800
static PyObject * pyrna_struct_get_id_data(BPy_DummyPointerRNA *self)
Definition: bpy_rna.c:4780
static PyObject * pyrna_struct_get_data(BPy_DummyPointerRNA *self)
Definition: bpy_rna.c:4794

Definition at line 4811 of file bpy_rna.c.

◆ pyrna_prop_methods

struct PyMethodDef pyrna_prop_methods[]
static
Initial value:
= {
{"path_from_id",
METH_NOARGS,
pyrna_prop_path_from_id_doc},
{"as_bytes", (PyCFunction)pyrna_prop_as_bytes, METH_NOARGS, pyrna_prop_as_bytes_doc},
{"update", (PyCFunction)pyrna_prop_update, METH_NOARGS, pyrna_prop_update_doc},
{"__dir__", (PyCFunction)pyrna_prop_dir, METH_NOARGS, NULL},
{NULL, NULL, 0, NULL},
}
static PyObject * pyrna_prop_update(BPy_PropertyRNA *self)
Definition: bpy_rna.c:3907
static PyObject * pyrna_prop_dir(BPy_PropertyRNA *self)
Definition: bpy_rna.c:4556
static PyObject * pyrna_prop_path_from_id(BPy_PropertyRNA *self)
Definition: bpy_rna.c:3843
static PyObject * pyrna_prop_as_bytes(BPy_PropertyRNA *self)
Definition: bpy_rna.c:3872

Definition at line 5662 of file bpy_rna.c.

◆ pyrna_prop_Type

PyTypeObject pyrna_prop_Type

Definition at line 6664 of file bpy_rna.c.

Referenced by BPY_rna_init(), BPY_rna_types(), pyrna_prop_CreatePyObject(), and pyrna_prop_new().

◆ pyrna_struct_as_mapping

PyMappingMethods pyrna_struct_as_mapping
static
Initial value:
= {
(lenfunc)NULL,
(binaryfunc)pyrna_struct_subscript,
(objobjargproc)pyrna_struct_ass_subscript,
}
static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObject *value)
Definition: bpy_rna.c:3424
static PyObject * pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key)
Definition: bpy_rna.c:3389

Definition at line 3458 of file bpy_rna.c.

◆ pyrna_struct_as_sequence

PySequenceMethods pyrna_struct_as_sequence
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(objobjproc)pyrna_struct_contains,
(binaryfunc)NULL,
(ssizeargfunc)NULL,
}
static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value)
Definition: bpy_rna.c:3321

Definition at line 3375 of file bpy_rna.c.

◆ pyrna_struct_getseters

PyGetSetDef pyrna_struct_getseters[]
static
Initial value:
= {
{"id_data",
(setter)NULL,
pyrna_struct_get_id_data_doc,
NULL},
}

Definition at line 4826 of file bpy_rna.c.

◆ pyrna_struct_meta_idprop_Type

PyTypeObject pyrna_struct_meta_idprop_Type

Definition at line 6487 of file bpy_rna.c.

Referenced by BPY_rna_init(), BPY_rna_types(), and pyrna_srna_Subtype().

◆ pyrna_struct_methods

struct PyMethodDef pyrna_struct_methods[]
static

Definition at line 5662 of file bpy_rna.c.

◆ pyrna_struct_Type

PyTypeObject pyrna_struct_Type

◆ rna_disallow_writes

bool rna_disallow_writes = false
static

◆ rna_module_ptr

PointerRNA* rna_module_ptr = NULL
static

Definition at line 7748 of file bpy_rna.c.

Referenced by BPY_rna_module(), and BPY_update_rna_module().