Blender V5.0
bpy_rna.cc File Reference
#include <Python.h>
#include <cfloat>
#include <cstddef>
#include <optional>
#include "RNA_path.hh"
#include "RNA_types.hh"
#include "BLI_dynstr.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
#include "BPY_extern.hh"
#include "BPY_extern_clog.hh"
#include "bpy_capi_utils.hh"
#include "bpy_intern_string.hh"
#include "bpy_props.hh"
#include "bpy_rna.hh"
#include "bpy_rna_anim.hh"
#include "bpy_rna_callback.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_prototypes.hh"
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_windowmanager_types.h"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_idprop.hh"
#include "BKE_idtype.hh"
#include "BKE_main.hh"
#include "BKE_report.hh"
#include "BKE_node.hh"
#include "DEG_depsgraph_query.hh"
#include "../generic/idprop_py_api.hh"
#include "../generic/idprop_py_ui_api.hh"
#include "../generic/py_capi_rna.hh"
#include "../generic/py_capi_utils.hh"
#include "../generic/python_compat.hh"
#include "../generic/python_utildefines.hh"
#include "../mathutils/mathutils.hh"

Go to the source code of this file.

Classes

struct  BPy_PropertyPointerRNA_Reference
struct  BPy_NamePropAsPyObject_Cache
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)

Functions

static PyObject * pyrna_struct_CreatePyObject_from_type (const PointerRNA *ptr, PyTypeObject *tp, void **instance)
static PyObject * pyrna_srna_Subtype (StructRNA *srna)
static PyObject * pyrna_struct_Subtype (PointerRNA *ptr)
static PyObject * pyrna_prop_collection_values (BPy_PropertyRNA *self)
static StructRNAsrna_from_ptr (PointerRNA *ptr)
int pyrna_struct_validity_check_only (const BPy_StructRNA *pysrna)
void pyrna_struct_validity_exception_only (const BPy_StructRNA *pysrna)
int pyrna_struct_validity_check (const BPy_StructRNA *pysrna)
int pyrna_prop_validity_check (const BPy_PropertyRNA *self)
void pyrna_invalidate (BPy_DummyPointerRNA *self)
static void pyrna_prop_warn_deprecated (const PointerRNA *ptr, const PropertyRNA *prop, const DeprecatedRNA *deprecated)
static PyObject * pyrna_struct_get_nameprop_as_pyobject (PointerRNA *ptr, BPy_NamePropAsPyObject_Cache &nameprop_cache)
void BPY_id_release (ID *id)
static bool rna_id_write_error (PointerRNA *ptr, PyObject *key)
bool pyrna_write_check ()
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 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, int index)
static int mathutils_rna_vector_set_index (BaseMathObject *bmo, int, int index)
static int mathutils_rna_matrix_get (BaseMathObject *bmo, int)
static int mathutils_rna_matrix_set (BaseMathObject *bmo, int)
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 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_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 void pyrna_prop_collection_string_subscript_unsupported_error (BPy_PropertyRNA *self, const char *error_prefix)
static int pyrna_prop_collection_string_subscript_supported_or_error (BPy_PropertyRNA *self, const char *error_prefix)
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, Py_ssize_t 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.types.IDPropertyGroupViewKeys`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_keys (BPy_StructRNA *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.types.IDPropertyGroupViewItems`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_items (BPy_StructRNA *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.types.IDPropertyGroupViewValues`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_values (BPy_StructRNA *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 property: Property name.\n" " :type property: str\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: bool\n" " :return: True when the property has been set.\n" " :rtype: bool\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" "\n" " :arg property: Property name.\n" " :type property: str\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" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is hidden.\n" " :rtype: bool\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" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is readonly (not writable).\n" " :rtype: bool\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" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is overridable.\n" " :rtype: bool\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" " :arg property: Property name.\n" " :type property: str\n" " :arg overridable: Overridable status to set.\n" " :type overridable: bool\n" " :return: True when the overridable status of the property was successfully set.\n" " :rtype: bool\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: str\n" " :arg coerce: optional argument, when True, the property will be converted\n" " into its Python representation.\n" " :type coerce: bool\n" " :return: Property value or property object.\n" " :rtype: Any | :class:`bpy.types.bpy_prop`\n")
static PyObject * pyrna_struct_path_resolve (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_path_from_module_doc, ".. method:: path_from_module(property=\"\", index=-1, /)\n" "\n" " Returns the full data path to this struct (as a string) from the bpy module.\n" "\n" " :arg property: Optional property name to get the full path from\n" " :type property: str\n" " :arg index: Optional index of the property.\n" " \"-1\" means that the property has no indices.\n" " :type index: int\n" " :return: The full path to the data.\n" " :rtype: str\n" "\n" " :raises ValueError:\n" " if the input data cannot be converted into a full data path.\n" "\n" " .. note:: Even if all input data is correct, this function might\n" " error out because Blender cannot derive a valid path.\n" " The incomplete path will be printed in the error message.\n")
static PyObject * pyrna_struct_path_from_module (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_prop_path_from_module_doc, ".. method:: path_from_module()\n" "\n" " Returns the full data path to this struct (as a string) from the bpy module.\n" "\n" " :return: The full path to the data.\n" " :rtype: str\n" "\n" " :raises ValueError:\n" " if the input data cannot be converted into a full data path.\n" "\n" " .. note:: Even if all input data is correct, this function might\n" " error out because Blender cannot derive a valid path.\n" " The incomplete path will be printed in the error message.\n")
static PyObject * pyrna_prop_path_from_module (BPy_PropertyRNA *self)
 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: str\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: :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: str\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: str\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)
 PyDoc_STRVAR (pyrna_struct_get_ancestors_doc, ".. method:: rna_ancestors()\n" "\n" " Return the chain of data containing this struct, if known.\n" " The first item is the root (typically an ID), the last one is the immediate parent.\n" " May be empty.\n" "\n" " :return: a list of this object's ancestors.\n" " :rtype: list[:class:`bpy.types.bpy_struct`]\n")
static PyObject * pyrna_struct_get_ancestors (BPy_StructRNA *self)
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:`idprop.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" " :type key: str.\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)
 PyDoc_STRVAR (pyrna_prop_collection_idprop_add_doc, ".. method:: add()\n" "\n" " This is a function to add a new item to a collection.\n" "\n" " :return: A newly created item.\n" " :rtype: Any\n")
static PyObject * pyrna_prop_collection_idprop_add (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_prop_collection_idprop_remove_doc, ".. method:: remove(index)\n" "\n" " This is a function to remove an item from a collection.\n" "\n" " :arg index: Index of the item to be removed.\n" " :type index: int\n")
static PyObject * pyrna_prop_collection_idprop_remove (BPy_PropertyRNA *self, PyObject *value)
 PyDoc_STRVAR (pyrna_prop_collection_idprop_clear_doc, ".. method:: clear()\n" "\n" " This is a function to remove all items from a collection.\n")
static PyObject * pyrna_prop_collection_idprop_clear (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_prop_collection_idprop_move_doc, ".. method:: move(src_index, dst_index)\n" "\n" " This is a function to move an item in a collection.\n" "\n" " :arg src_index: Source item index.\n" " :type src_index: int\n" " :arg dst_index: Destination item index.\n" " :type dst_index: int\n")
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 data-block is from or None, " "(not available for all data types)\n" "\n" ":type: :class:`bpy.types.ID`, (readonly)\n")
static PyObject * pyrna_struct_get_id_data (BPy_DummyPointerRNA *self, void *)
 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, void *)
 PyDoc_STRVAR (pyrna_struct_get_rna_type_doc, "The property type for introspection.")
static PyObject * pyrna_struct_get_rna_type (BPy_PropertyRNA *self, void *)
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[str]\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[tuple[str, :class:`bpy.types.bpy_struct`]]\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[:class:`bpy.types.bpy_struct` | None]\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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" " :return: Custom property value or default.\n" " :rtype: Any\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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" " :return: Custom property value or default.\n" " :rtype: Any\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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\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: str\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, bool *r_is_empty)
static int foreach_parse_args (BPy_PropertyRNA *self, PyObject *args, const char *function_name, const char **r_attr, PyObject **r_seq, int *r_tot, size_t *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_param_to_py (PointerRNA *ptr, PropertyRNA *prop, void *data)
static PyObject * kwnames_get_item_string (PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames, Py_ssize_t nkw, const char *parm_name)
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_vectorcall (PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
static void pyrna_subtype_set_rna (PyObject *newclass, StructRNA *srna)
static PyObject * pyrna_srna_PyBase (StructRNA *srna)
void BPY_rna_types_dict_set (PyObject *dict)
static PyObject * pyrna_srna_ExternalType (StructRNA *srna)
PyObject * pyrna_struct_CreatePyObject (PointerRNA *ptr)
PyObject * pyrna_struct_CreatePyObject_with_primitive_support (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 BPY_rna_exit ()
PyObject * BPY_rna_module ()
void BPY_update_rna_module ()
RNA Class Registration: Deferred
static int deferred_register_prop (StructRNA *srna, PyObject *key, PyObject *item)
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_register_arg_count (FunctionRNA *func, int *min_count)
RNA Struct Access: #StructRNA

Utilities for accessing & creating StructRNA on demand.

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)
RNA Class Registration: Utilities

Mainly helpers for register_class & unregister_class.

static int bpy_class_validate_recursive (PointerRNA *dummy_ptr, StructRNA *srna, void *py_data, bool *have_function)
static int bpy_class_validate (PointerRNA *dummy_ptr, void *py_data, bool *have_function)
static int bpy_class_call (bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
static void bpy_class_free_ex (PyObject *self, bool decref)
static void bpy_class_free (void *pyob_ptr)
static PyTypeObject * bpy_class_check_any_bases_registered (PyTypeObject *cls)
static PyTypeObject * bpy_class_check_any_subclasses_registered (PyTypeObject *cls)
void pyrna_alloc_types ()
void BPY_free_srna_pytype (StructRNA *srna)
RNA Support for extended via the C-API
void pyrna_struct_type_extend_capi (StructRNA *srna, PyMethodDef *method, PyGetSetDef *getset)

Variables

BPy_StructRNAbpy_context_module = nullptr
static const char * BPy_capsule_PointerRNA_identifier = "BPy_PointerRNA_PyCapsule"
static const char * BPy_PropertyPointerRNA_capsule_identifier = "BPy_PropertyPointerRNA_PyCapsule"
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 PyMethodDef pyrna_struct_methods []
static PyMethodDef pyrna_prop_methods []
static PyMethodDef pyrna_prop_array_methods []
static PyMethodDef pyrna_prop_collection_methods []
static PyMethodDef pyrna_prop_collection_idprop_methods []
PyTypeObject pyrna_struct_meta_idprop_Type
static PyObject * bpy_types_dict = nullptr
static PointerRNArna_module_ptr = nullptr

RNA Class Register Method

#define BPY_TYPEDEF_REGISTERABLE_DOC
PyMethodDef meth_bpy_register_class
static PyObject * pyrna_register_class (PyObject *self, PyObject *py_class)
 PyDoc_STRVAR (pyrna_register_class_doc, ".. function:: register_class(cls)\n" "\n" " Register a subclass of a Blender type class.\n" "\n" " :arg cls: Registerable Blender class type.\n" " :type cls: " BPY_TYPEDEF_REGISTERABLE_DOC "\n" "\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 int pyrna_srna_contains_pointer_prop_srna (StructRNA *srna_props, StructRNA *srna, const char **r_prop_identifier)

BPY RNA Struct Type

These BPy_StructRNA objects should be created the standard way (calling their type objects using #PyObject_CallOneArg or similar). One and only one arg is expected currently.

This special handling allows to construct an object from a python-defined derived type of bpy_struct, using an existing base struct object as source of data.

It also allows internal bpy_rna.cc code to pass the private #BPy_RNANoInit_object token to create property objects without initializing them, which avoids double-initialization from functions like pyrna_struct_CreatePyObject etc.

Note
: Subclassing from Python isn't common since it's NOT related to registerable sub-classes. eg:
>>> class MyObSubclass(bpy.types.Object):
... def test_func(self):
... print(100)
...
>>> myob = MyObSubclass(bpy.context.object)
>>> myob.test_func()
100
PyTypeObject pyrna_struct_Type
static PyObject * pyrna_struct_new (PyTypeObject *type, PyObject *args, PyObject *)
static int pyrna_struct_init (PyObject *self, PyObject *args, PyObject *)
static void pyrna_struct_dealloc (PyObject *self)

BPY RNA Property Types

These BPy_PropertyRNA objects should be created the standard way (calling their type objects using #PyObject_CallOneArg or similar). One and only one arg is expected currently.

This special handling allows to construct an object from a python-defined derived type of bpy_property, using an existing base property object as source of data.

It also allows internal bpy_rna.cc code to pass the private #BPy_RNANoInit_object token to create property objects without initializing them, which avoids double-initialization from functions like pyrna_prop_CreatePyObject etc.

Note
: This isn't common since it's NOT related to registerable subclasses. eg:

TODO Add python code example of using this overriding feature.

PyTypeObject pyrna_prop_Type
PyTypeObject pyrna_prop_array_Type
PyTypeObject pyrna_prop_collection_Type
static PyTypeObject pyrna_prop_collection_idprop_Type
static PyTypeObject pyrna_prop_collection_iter_Type
static PyObject * pyrna_prop_collection_iter (PyObject *self)
static PyObject * pyrna_property_new (PyTypeObject *type, PyObject *args, PyObject *)
static int pyrna_property_init (PyObject *self, PyObject *args, PyObject *)
static void pyrna_property_dealloc (PyObject *self)
static int pyrna_property_array_init (PyObject *self, PyObject *args, PyObject *)
static PyObject * pyrna_prop_collection_iter_new (PyTypeObject *type, PyObject *, PyObject *)
static int pyrna_prop_collection_iter_init (PyObject *self, PyObject *, PyObject *)
static void pyrna_prop_collection_iter_dealloc (PyObject *self)
static PyObject * pyrna_prop_collection_iter_next (PyObject *self)
static PyObject * pyrna_prop_collection_iter_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop)

BPY RNA Function

PyTypeObject pyrna_func_Type
static PyObject * pyrna_func_CreatePyObject (const PointerRNA *ptr, FunctionRNA *func)
static void pyrna_func_dealloc (PyObject *self)

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

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

RNA Class Unregister Method

PyMethodDef meth_bpy_unregister_class
static PyObject * pyrna_unregister_class (PyObject *self, PyObject *py_class)
 PyDoc_STRVAR (pyrna_unregister_class_doc, ".. function:: unregister_class(cls)\n" "\n" " Unload the Python class from blender.\n" "\n" " :arg cls: Blender type class, \n" " see :mod:`bpy.utils.register_class` for classes which can \n" " be registered.\n" " :type cls: " BPY_TYPEDEF_REGISTERABLE_DOC "\n" "\n" " .. note::\n" "\n" " If the class has an *unregister* class method it will be called\n" " before unregistering.\n")

Exported Methods

PyMethodDef meth_bpy_owner_id_get
PyMethodDef meth_bpy_owner_id_set
static PyObject * pyrna_bl_owner_id_get (PyObject *)
static PyObject * pyrna_bl_owner_id_set (PyObject *, PyObject *value)

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.cc.

Macro Definition Documentation

◆ BPY_DOC_ID_PROP_TYPE_NOTE

#define BPY_DOC_ID_PROP_TYPE_NOTE
Value:
" .. note::\n" \
"\n" \
" Limited to: :ref:`bpy_types-custom_properties`.\n"

The bpy_types-custom_properties references is created as part of API doc generation. When expanded line reads: "Limited to: Types with Custom Property Support".

Definition at line 138 of file bpy_rna.cc.

Referenced by PyDoc_STRVAR(), PyDoc_STRVAR(), PyDoc_STRVAR(), PyDoc_STRVAR(), and PyDoc_STRVAR().

◆ BPY_TYPEDEF_REGISTERABLE_DOC

#define BPY_TYPEDEF_REGISTERABLE_DOC
Value:
"type[" \
":class:`bpy.types.Panel` | " \
":class:`bpy.types.UIList` | " \
":class:`bpy.types.Menu` | " \
":class:`bpy.types.Header` | " \
":class:`bpy.types.Operator` | " \
":class:`bpy.types.KeyingSetInfo` | " \
":class:`bpy.types.RenderEngine` | " \
":class:`bpy.types.AssetShelf` | " \
":class:`bpy.types.FileHandler` | " \
":class:`bpy.types.PropertyGroup` | " \
":class:`bpy.types.AddonPreferences` | " \
":class:`bpy.types.NodeTree` | " \
":class:`bpy.types.Node` | " \
":class:`bpy.types.NodeSocket`" \
"]"

Definition at line 10100 of file bpy_rna.cc.

Referenced by PyDoc_STRVAR(), and PyDoc_STRVAR().

◆ MATHUTILS_CB_SUBTYPE_COLOR

#define MATHUTILS_CB_SUBTYPE_COLOR   3

Definition at line 511 of file bpy_rna.cc.

Referenced by pyrna_math_object_from_array().

◆ MATHUTILS_CB_SUBTYPE_EUL

#define MATHUTILS_CB_SUBTYPE_EUL   0

◆ MATHUTILS_CB_SUBTYPE_QUAT

#define MATHUTILS_CB_SUBTYPE_QUAT   2

Definition at line 510 of file bpy_rna.cc.

Referenced by pyrna_math_object_from_array().

◆ MATHUTILS_CB_SUBTYPE_VEC

#define MATHUTILS_CB_SUBTYPE_VEC   1

Definition at line 509 of file bpy_rna.cc.

Referenced by pyrna_math_object_from_array().

◆ PROP_ALL_VECTOR_SUBTYPES

#define PROP_ALL_VECTOR_SUBTYPES
Value:
case PROP_XYZ: \
@ PROP_DIRECTION
Definition RNA_types.hh:262
@ PROP_XYZ
Definition RNA_types.hh:269
@ PROP_ACCELERATION
Definition RNA_types.hh:264
@ PROP_COORDS
Definition RNA_types.hh:274
@ PROP_TRANSLATION
Definition RNA_types.hh:261
@ PROP_XYZ_LENGTH
Definition RNA_types.hh:270
@ PROP_VELOCITY
Definition RNA_types.hh:263

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 739 of file bpy_rna.cc.

Referenced by pyrna_math_object_from_array(), and pyrna_param_to_py().

◆ 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.value(), 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
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)

Definition at line 2305 of file bpy_rna.cc.

Referenced by pyrna_prop_collection_ass_subscript_int(), and pyrna_prop_collection_subscript_int().

◆ USE_MATHUTILS

#define USE_MATHUTILS

Definition at line 78 of file bpy_rna.cc.

◆ USE_PEDANTIC_WRITE

#define USE_PEDANTIC_WRITE

Definition at line 77 of file bpy_rna.cc.

◆ 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 88 of file bpy_rna.cc.

◆ USE_STRING_COERCE

#define USE_STRING_COERCE

Definition at line 79 of file bpy_rna.cc.

Function Documentation

◆ bpy_class_call()

◆ bpy_class_check_any_bases_registered()

PyTypeObject * bpy_class_check_any_bases_registered ( PyTypeObject * cls)
static
Returns
the first base-class which is already registered or null.

Definition at line 9986 of file bpy_rna.cc.

References BLI_assert, bpy_class_check_any_bases_registered(), bpy_intern_str_bl_rna, StructRNA::flag, i, and STRUCT_RUNTIME.

Referenced by bpy_class_check_any_bases_registered(), and pyrna_register_class().

◆ bpy_class_check_any_subclasses_registered()

PyTypeObject * bpy_class_check_any_subclasses_registered ( PyTypeObject * cls)
static
Returns
the first sub-class which is already registered or null.

Definition at line 10016 of file bpy_rna.cc.

References BLI_assert, bpy_class_check_any_subclasses_registered(), bpy_intern_str_bl_rna, StructRNA::flag, pos, and STRUCT_RUNTIME.

Referenced by bpy_class_check_any_subclasses_registered(), and pyrna_register_class().

◆ bpy_class_free()

void bpy_class_free ( void * pyob_ptr)
static

Definition at line 9974 of file bpy_rna.cc.

References bpy_class_free_ex().

Referenced by pyrna_register_class().

◆ bpy_class_free_ex()

void bpy_class_free_ex ( PyObject * self,
bool decref )
static
Parameters
decrefWhen true, decrease the reference.

Definition at line 9929 of file bpy_rna.cc.

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

Referenced by bpy_class_free(), and BPY_free_srna_pytype().

◆ bpy_class_validate()

int bpy_class_validate ( PointerRNA * dummy_ptr,
void * py_data,
bool * have_function )
static

Definition at line 9571 of file bpy_rna.cc.

References bpy_class_validate_recursive(), and PointerRNA::type.

Referenced by pyrna_register_class().

◆ bpy_class_validate_recursive()

◆ BPY_free_srna_pytype()

void BPY_free_srna_pytype ( StructRNA * srna)

Free (actually dereference) the Python type object representing the given #StrucRNA type, if it is defined.

Definition at line 10084 of file bpy_rna.cc.

References bpy_class_free_ex(), RNA_struct_py_type_get(), and RNA_struct_py_type_set().

Referenced by RNA_bpy_exit(), and WM_operatortype_remove_ptr().

◆ BPY_id_release()

void BPY_id_release ( ID * id)

Definition at line 397 of file bpy_rna.cc.

Referenced by BKE_libblock_free_data_py().

◆ BPY_rna_exit()

void BPY_rna_exit ( )

Definition at line 8680 of file bpy_rna.cc.

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

Referenced by BPY_python_end().

◆ BPY_rna_init()

◆ BPY_rna_module()

PyObject * BPY_rna_module ( )
nodiscard

◆ BPY_rna_types()

◆ BPY_rna_types_dict_set()

void BPY_rna_types_dict_set ( PyObject * dict)

Set the _bpy_types.py modules __dict__, needed for instancing RNA types.

Definition at line 8237 of file bpy_rna.cc.

References bpy_types_dict.

Referenced by BPy_init_modules().

◆ BPY_rna_types_finalize_external_types()

void BPY_rna_types_finalize_external_types ( PyObject * submodule)

◆ bpy_types_module_dir()

PyObject * bpy_types_module_dir ( PyObject * self)
static

Definition at line 8792 of file bpy_rna.cc.

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

◆ bpy_types_module_free()

void bpy_types_module_free ( void * self)
static

Definition at line 8839 of file bpy_rna.cc.

References self, and state.

◆ bpy_types_module_getattro()

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

◆ BPY_update_rna_module()

void BPY_update_rna_module ( )

Definition at line 8715 of file bpy_rna.cc.

References G_MAIN, RNA_main_pointer_create(), and rna_module_ptr.

Referenced by BPY_driver_exec(), and BPY_modules_update().

◆ deferred_register_prop()

◆ foreach_attr_type()

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

◆ foreach_compat_buffer()

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

◆ foreach_getset()

◆ foreach_parse_args()

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

◆ kwnames_get_item_string()

PyObject * kwnames_get_item_string ( PyObject *const * args,
Py_ssize_t nargs,
PyObject * kwnames,
Py_ssize_t nkw,
const char * parm_name )
inlinestatic

Definition at line 6688 of file bpy_rna.cc.

References i.

Referenced by pyrna_func_vectorcall().

◆ mathutils_rna_generic_check()

int mathutils_rna_generic_check ( BaseMathObject * bmo)
static

Definition at line 513 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, and self.

◆ mathutils_rna_matrix_get()

int mathutils_rna_matrix_get ( BaseMathObject * bmo,
int  )
static

Definition at line 658 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, RNA_property_float_get_array(), and self.

◆ mathutils_rna_matrix_set()

◆ mathutils_rna_vector_get()

int mathutils_rna_vector_get ( BaseMathObject * bmo,
int subtype )
static

◆ mathutils_rna_vector_get_index()

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

Definition at line 599 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, RNA_property_float_get_index(), and self.

◆ mathutils_rna_vector_set()

◆ mathutils_rna_vector_set_index()

◆ prop_subscript_ass_array_int()

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

◆ prop_subscript_ass_array_slice()

◆ prop_subscript_ass_array_slice__as_seq_fast()

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

◆ prop_subscript_ass_array_slice__bool_recursive()

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()

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()

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/45]

PyDoc_STRVAR ( bpy_types_module_doc ,
"Access to internal Blender types."  )

◆ PyDoc_STRVAR() [2/45]

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/45]

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/45]

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/45]

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: str\n" " :return: index of the key.\n" " :rtype: int\n"  )

◆ PyDoc_STRVAR() [6/45]

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/45]

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/45]

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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n"  )

◆ PyDoc_STRVAR() [9/45]

PyDoc_STRVAR ( pyrna_prop_collection_idprop_add_doc ,
".. method:: add()\n" "\n" " This is a function to add a new item to a collection.\n" "\n" " :return: A newly created item.\n" " :rtype: Any\n"  )

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

◆ PyDoc_STRVAR() [10/45]

PyDoc_STRVAR ( pyrna_prop_collection_idprop_clear_doc ,
".. method:: clear()\n" "\n" " This is a function to remove all items from a collection.\n"  )

◆ PyDoc_STRVAR() [11/45]

PyDoc_STRVAR ( pyrna_prop_collection_idprop_move_doc ,
".. method:: move(src_index, dst_index)\n" "\n" " This is a function to move an item in a collection.\n" "\n" " :arg src_index: Source item index.\n" " :type src_index: int\n" " :arg dst_index: Destination item index.\n" " :type dst_index: int\n"  )

◆ PyDoc_STRVAR() [12/45]

PyDoc_STRVAR ( pyrna_prop_collection_idprop_remove_doc ,
".. method:: remove(index)\n" "\n" " This is a function to remove an item from a collection.\n" "\n" " :arg index: Index of the item to be removed.\n" " :type index: int\n"  )

◆ PyDoc_STRVAR() [13/45]

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]\n" [tuple[str, :class:`bpy.types.bpy_struct`] )

◆ PyDoc_STRVAR() [14/45]

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\n" [str] )

◆ PyDoc_STRVAR() [15/45]

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" [:class:`bpy.types.bpy_struct`|None] )

◆ PyDoc_STRVAR() [16/45]

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() [17/45]

PyDoc_STRVAR ( pyrna_prop_path_from_module_doc ,
".. method:: path_from_module()\n" "\n" " Returns the full data path to this struct (as a string) from the bpy module.\n" "\n" " :return: The full path to the data.\n" " :rtype: str\n" "\n" " :raises ValueError:\n" " if the input data cannot be converted into a full data path.\n" "\n" " .. note:: Even if all input data is correct,
this function might\n" " error out because Blender cannot derive a valid path.\n" " The incomplete path will be printed in the error message.\n"  )

◆ PyDoc_STRVAR() [18/45]

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() [19/45]

PyDoc_STRVAR ( pyrna_register_class_doc ,
".. function:: register_class(cls)\n" "\n" " Register a subclass of a Blender type class.\n" "\n" " :arg cls: Registerable Blender class type.\n" " :type cls: " BPY_TYPEDEF_REGISTERABLE_DOC "\n" "\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!

NOTE(@ideasman42): 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). This should still be fixed.

References BPY_TYPEDEF_REGISTERABLE_DOC.

◆ PyDoc_STRVAR() [20/45]

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() [21/45]

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: str\n" " :return: The RNA type or default when not found.\n" " :rtype: :class:`bpy.types.Struct` subclass\n"  )

◆ PyDoc_STRVAR() [22/45]

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: str\n" " :return: The class or default when not found.\n" " :rtype: type\n"  )

◆ PyDoc_STRVAR() [23/45]

PyDoc_STRVAR ( pyrna_struct_get_ancestors_doc ,
".. method:: rna_ancestors()\n" "\n" " Return the chain of data containing this struct,
if known.\n" " The first item is the roottypically an ID,
the last one is the immediate parent.\n" " May be empty.\n" "\n" " :return:a list of this object 's ancestors.\n" " :rtype:list\n" [:class:`bpy.types.bpy_struct`] )

◆ PyDoc_STRVAR() [24/45]

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

◆ PyDoc_STRVAR() [25/45]

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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" " :return: Custom property value or default.\n" " :rtype: Any\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE )

◆ PyDoc_STRVAR() [26/45]

PyDoc_STRVAR ( pyrna_struct_get_id_data_doc ,
"The :class:`bpy.types.ID` object this data-block is from or None,
" "(not available for all data types)\n" "\n" ":type::class:`bpy.types.ID` ,
(readonly)\n"  )

◆ PyDoc_STRVAR() [27/45]

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

◆ PyDoc_STRVAR() [28/45]

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() [29/45]

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:`idprop.types.IDPropertyGroup`\n"  )

◆ PyDoc_STRVAR() [30/45]

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" " :type key: str.\n" " :rtype: :class:`bpy.types.IDPropertyUIManager`\n"  )

◆ PyDoc_STRVAR() [31/45]

PyDoc_STRVAR ( pyrna_struct_is_property_hidden_doc ,
".. method:: is_property_hidden(property, /)\n" "\n" " Check if a property is hidden.\n" "\n" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is hidden.\n" " :rtype: bool\n"  )

◆ PyDoc_STRVAR() [32/45]

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" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is overridable.\n" " :rtype: bool\n"  )

◆ PyDoc_STRVAR() [33/45]

PyDoc_STRVAR ( pyrna_struct_is_property_readonly_doc ,
".. method:: is_property_readonly(property, /)\n" "\n" " Check if a property is readonly.\n" "\n" " :arg property: Property name.\n" " :type property: str\n" " :return: True when the property is readonly (not writable).\n" " :rtype: bool\n"  )

◆ PyDoc_STRVAR() [34/45]

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 property:Property name.\n" " :type property:str\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:bool\n" " :return:True when the property has been set.\n" " :rtype:bool\n"  )

◆ PyDoc_STRVAR() [35/45]

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.types.IDPropertyGroupViewItems`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE )

◆ PyDoc_STRVAR() [36/45]

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.types.IDPropertyGroupViewKeys`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE )

◆ PyDoc_STRVAR() [37/45]

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: str\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() [38/45]

PyDoc_STRVAR ( pyrna_struct_path_from_module_doc ,
".. method:: path_from_module(property=\"\", index=-1, /)\n" "\n" " Returns the full data path to this struct (as a string) from the bpy module.\n" "\n" " :arg property: Optional property name to get the full path from\n" " :type property: str\n" " :arg index: Optional index of the property.\n" " \"-1\" means that the property has no indices.\n" " :type index: int\n" " :return: The full path to the data.\n" " :rtype: str\n" "\n" " :raises ValueError:\n" " if the input data cannot be converted into a full data path.\n" "\n" " .. note:: Even if all input data is correct,
this function might\n" " error out because Blender cannot derive a valid path.\n" " The incomplete path will be printed in the error message.\n"  )

◆ PyDoc_STRVAR() [39/45]

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:str\n" " :arg coerce:optional argument,
when True,
the property will be converted\n" " into its Python representation.\n" " :type coerce:bool\n" " :return:Property value or property object.\n" " :rtype:Any|:class:`bpy.types.bpy_prop`\n"  )

◆ PyDoc_STRVAR() [40/45]

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: str\n" " :arg default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" " :return: Custom property value or default.\n" " :rtype: Any\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE )

◆ PyDoc_STRVAR() [41/45]

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" " :arg property: Property name.\n" " :type property: str\n" " :arg overridable: Overridable status to set.\n" " :type overridable: bool\n" " :return: True when the overridable status of the property was successfully set.\n" " :rtype: bool\n"  )

◆ PyDoc_STRVAR() [42/45]

PyDoc_STRVAR ( pyrna_struct_property_unset_doc ,
".. method:: property_unset(property, /)\n" "\n" " Unset a property,
will use default value afterward.\n" "\n" " :arg property:Property name.\n" " :type property:str\n"  )

◆ PyDoc_STRVAR() [43/45]

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::class:`bpy.types.bpy_struct`\n"  )

◆ PyDoc_STRVAR() [44/45]

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.types.IDPropertyGroupViewValues`\n" "\n" BPY_DOC_ID_PROP_TYPE_NOTE )

◆ PyDoc_STRVAR() [45/45]

PyDoc_STRVAR ( pyrna_unregister_class_doc ,
".. function:: unregister_class(cls)\n" "\n" " Unload the Python class from blender.\n" "\n" " :arg cls: Blender type class,
\n" " see :mod:`bpy.utils.register_class` for classes which can \n" " be registered.\n" " :type cls:" BPY_TYPEDEF_REGISTERABLE_DOC "\n" "\n" " .. note::\n" "\n" " If the class has an *unregister *class method it will be called\n" " before unregistering.\n"  )

◆ pyprop_array_foreach_getset()

◆ pyrna_alloc_types()

void pyrna_alloc_types ( )

◆ pyrna_bl_owner_id_get()

PyObject * pyrna_bl_owner_id_get ( PyObject * )
static

Definition at line 10559 of file bpy_rna.cc.

References name, and RNA_struct_state_owner_get().

◆ pyrna_bl_owner_id_set()

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

Definition at line 10568 of file bpy_rna.cc.

References name, and RNA_struct_state_owner_set().

◆ pyrna_deferred_register_class()

◆ pyrna_deferred_register_class_from_type_hints()

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 9167 of file bpy_rna.cc.

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

Referenced by pyrna_deferred_register_class().

◆ pyrna_deferred_register_class_recursive()

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

◆ pyrna_deferred_register_props()

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

◆ pyrna_dir_members_py()

◆ pyrna_dir_members_py__add_keys()

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

Definition at line 4421 of file bpy_rna.cc.

References Py_DECREF().

Referenced by pyrna_dir_members_py().

◆ pyrna_dir_members_rna()

◆ pyrna_enum_as_string()

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

◆ pyrna_enum_to_py()

◆ pyrna_func_CreatePyObject()

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

◆ pyrna_func_dealloc()

void pyrna_func_dealloc ( PyObject * self)
static

Definition at line 8124 of file bpy_rna.cc.

References BPy_FunctionRNA::ptr, and self.

◆ pyrna_func_doc_get()

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

◆ pyrna_func_error_prefix()

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 6713 of file bpy_rna.cc.

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

Referenced by pyrna_func_vectorcall().

◆ pyrna_func_repr()

PyObject * pyrna_func_repr ( BPy_FunctionRNA * self)
static

Definition at line 1209 of file bpy_rna.cc.

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

◆ pyrna_func_vectorcall()

◆ pyrna_id_CheckPyObject()

bool pyrna_id_CheckPyObject ( PyObject * obj)
nodiscard

Definition at line 8622 of file bpy_rna.cc.

References BPy_StructRNA_Check, ptr, and RNA_struct_is_ID().

Referenced by idp_from_PyObject(), and pyrna_id_FromPyObject().

◆ pyrna_id_CreatePyObject()

◆ pyrna_id_FromPyObject()

◆ pyrna_invalidate()

void pyrna_invalidate ( BPy_DummyPointerRNA * self)

Definition at line 178 of file bpy_rna.cc.

References self.

Referenced by BPY_DECREF_RNA_INVALIDATE().

◆ pyrna_math_object_from_array()

◆ pyrna_param_to_py()

◆ pyrna_prop_array_ass_subscript()

◆ pyrna_prop_array_bool()

int pyrna_prop_array_bool ( BPy_PropertyRNA * self)
static

Definition at line 2288 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, RNA_property_array_length(), and self.

◆ pyrna_prop_array_contains()

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

Definition at line 3461 of file bpy_rna.cc.

References pyrna_array_contains_py(), and self.

◆ pyrna_prop_array_foreach_get()

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

Definition at line 6234 of file bpy_rna.cc.

References pyprop_array_foreach_getset(), PYRNA_PROP_CHECK_OBJ, and self.

◆ pyrna_prop_array_foreach_set()

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

Definition at line 6247 of file bpy_rna.cc.

References pyprop_array_foreach_getset(), PYRNA_PROP_CHECK_OBJ, and self.

◆ pyrna_prop_array_getattro()

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

Definition at line 5032 of file bpy_rna.cc.

References self.

◆ pyrna_prop_array_iter()

PyObject * pyrna_prop_array_iter ( BPy_PropertyArrayRNA * self)
static

◆ pyrna_prop_array_length()

◆ pyrna_prop_array_repr()

PyObject * pyrna_prop_array_repr ( BPy_PropertyArrayRNA * self)
static

Definition at line 1204 of file bpy_rna.cc.

References pyrna_prop_repr_ex(), and self.

◆ pyrna_prop_array_subscript()

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

◆ pyrna_prop_array_subscript_int()

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

◆ pyrna_prop_array_subscript_slice()

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 2686 of file bpy_rna.cc.

References BLI_assert_msg, count, length(), PROP_BOOLEAN, PROP_FLOAT, PROP_INT, ptr, Py_DECREF(), 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(), RNA_property_type(), and self.

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

◆ pyrna_prop_array_to_py_index()

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

◆ pyrna_prop_as_bytes()

PyObject * pyrna_prop_as_bytes ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_collection_ass_subscript()

◆ pyrna_prop_collection_ass_subscript_int()

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

◆ pyrna_prop_collection_bool()

int pyrna_prop_collection_bool ( BPy_PropertyRNA * self)
static

Definition at line 2295 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, RNA_property_collection_is_empty(), and self.

◆ pyrna_prop_collection_contains()

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

◆ pyrna_prop_collection_find()

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

◆ pyrna_prop_collection_foreach_get()

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

Definition at line 6053 of file bpy_rna.cc.

References foreach_getset(), PYRNA_PROP_CHECK_OBJ, and self.

◆ pyrna_prop_collection_foreach_set()

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

Definition at line 6066 of file bpy_rna.cc.

References foreach_getset(), PYRNA_PROP_CHECK_OBJ, and self.

◆ pyrna_prop_collection_get()

◆ pyrna_prop_collection_getattro()

◆ pyrna_prop_collection_idprop_add()

PyObject * pyrna_prop_collection_idprop_add ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_collection_idprop_clear()

PyObject * pyrna_prop_collection_idprop_clear ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_collection_idprop_move()

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

◆ pyrna_prop_collection_idprop_remove()

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

◆ pyrna_prop_collection_items()

PyObject * pyrna_prop_collection_items ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_collection_iter()

PyObject * pyrna_prop_collection_iter ( PyObject * self)
static

◆ pyrna_prop_collection_iter_CreatePyObject()

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

◆ pyrna_prop_collection_iter_dealloc()

void pyrna_prop_collection_iter_dealloc ( PyObject * self)
static

◆ pyrna_prop_collection_iter_init()

int pyrna_prop_collection_iter_init ( PyObject * self,
PyObject * args,
PyObject *  )
static

◆ pyrna_prop_collection_iter_new()

PyObject * pyrna_prop_collection_iter_new ( PyTypeObject * type,
PyObject * args,
PyObject *  )
static

Definition at line 7874 of file bpy_rna.cc.

References BPy_PropertyCollectionIterRNA::iter, and self.

◆ pyrna_prop_collection_iter_next()

PyObject * pyrna_prop_collection_iter_next ( PyObject * self)
static

◆ pyrna_prop_collection_keys()

PyObject * pyrna_prop_collection_keys ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_collection_length()

Py_ssize_t pyrna_prop_collection_length ( BPy_PropertyRNA * self)
static

Definition at line 2279 of file bpy_rna.cc.

References PYRNA_PROP_CHECK_INT, RNA_property_collection_length(), and self.

Referenced by pyrna_prop_str().

◆ pyrna_prop_collection_setattro()

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

◆ pyrna_prop_collection_string_subscript_supported_or_error()

int pyrna_prop_collection_string_subscript_supported_or_error ( BPy_PropertyRNA * self,
const char * error_prefix )
static

◆ pyrna_prop_collection_string_subscript_unsupported_error()

void pyrna_prop_collection_string_subscript_unsupported_error ( BPy_PropertyRNA * self,
const char * error_prefix )
static

◆ pyrna_prop_collection_subscript()

◆ pyrna_prop_collection_subscript_int()

◆ pyrna_prop_collection_subscript_is_valid_or_error()

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 nullptr).

Definition at line 2318 of file bpy_rna.cc.

References BLI_assert, BPy_StructRNA_Check, BPy_StructRNA::ptr, and UNLIKELY.

Referenced by pyrna_prop_collection_subscript_int(), and pyrna_prop_collection_subscript_str().

◆ pyrna_prop_collection_subscript_slice()

◆ pyrna_prop_collection_subscript_str()

◆ pyrna_prop_collection_subscript_str_lib_pair()

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()

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 2542 of file bpy_rna.cc.

References BLI_findstring(), ID::lib, lib, Main::libraries, ID::name, offsetof, 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()

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

◆ pyrna_prop_collection_values()

PyObject * pyrna_prop_collection_values ( BPy_PropertyRNA * self)
static

Definition at line 5409 of file bpy_rna.cc.

References pyrna_prop_collection_subscript_slice(), and self.

◆ pyrna_prop_compare()

int pyrna_prop_compare ( BPy_PropertyRNA * a,
BPy_PropertyRNA * b )
static

Definition at line 920 of file bpy_rna.cc.

References b, BPy_PropertyRNA::prop, and BPy_PropertyRNA::ptr.

Referenced by pyrna_prop_richcmp().

◆ pyrna_prop_CreatePyObject()

◆ pyrna_prop_dir()

◆ pyrna_prop_hash()

long pyrna_prop_hash ( BPy_PropertyRNA * self)
static

Definition at line 1223 of file bpy_rna.cc.

References Py_HashPointer, self, x, and y.

◆ pyrna_prop_path_from_id()

PyObject * pyrna_prop_path_from_id ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_path_from_module()

PyObject * pyrna_prop_path_from_module ( BPy_PropertyRNA * self)
static

◆ pyrna_prop_repr()

PyObject * pyrna_prop_repr ( BPy_PropertyRNA * self)
static

Definition at line 1199 of file bpy_rna.cc.

References pyrna_prop_repr_ex(), and self.

◆ pyrna_prop_repr_ex()

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

◆ pyrna_prop_richcmp()

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

Definition at line 959 of file bpy_rna.cc.

References ATTR_FALLTHROUGH, b, BPy_PropertyRNA_Check, and pyrna_prop_compare().

◆ pyrna_prop_str()

◆ pyrna_prop_to_enum_bitfield()

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

◆ pyrna_prop_to_py()

◆ pyrna_prop_update()

PyObject * pyrna_prop_update ( BPy_PropertyRNA * self)
static

Definition at line 4260 of file bpy_rna.cc.

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

◆ pyrna_prop_validity_check()

int pyrna_prop_validity_check ( const BPy_PropertyRNA * self)
nodiscard

Definition at line 166 of file bpy_rna.cc.

References RNA_property_identifier(), and self.

◆ pyrna_prop_warn_deprecated()

void pyrna_prop_warn_deprecated ( const PointerRNA * ptr,
const PropertyRNA * prop,
const DeprecatedRNA * deprecated )
static

◆ pyrna_property_array_init()

◆ pyrna_property_dealloc()

void pyrna_property_dealloc ( PyObject * self)
static

Definition at line 7726 of file bpy_rna.cc.

References BPy_PropertyRNA::ptr, and self.

◆ pyrna_property_init()

int pyrna_property_init ( PyObject * self,
PyObject * args,
PyObject *  )
static

◆ pyrna_property_new()

PyObject * pyrna_property_new ( PyTypeObject * type,
PyObject * args,
PyObject *  )
static

Definition at line 7636 of file bpy_rna.cc.

References BLI_assert, BPy_PropertyRNA::ptr, pyrna_prop_Type, and self.

◆ pyrna_py_to_prop()

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

Definition at line 1600 of file bpy_rna.cc.

References Vector< T, InlineBufferCapacity, Allocator >::append(), BKE_reports_init(), BLI_assert, BLI_path_is_rel(), BLI_strncpy(), BLI_strncpy_utf8(), BPY_context_get(), bpy_intern_str_properties, BPy_reports_to_error(), BPy_StructRNA_Check, data, ELEM, flag, i, ID_TAG_TEMP_MAIN, CollectionVector::items, 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_PATH_SUPPORTS_BLEND_RELATIVE, PROP_POINTER, PROP_STRING, PROP_THICK_WRAP, BPy_PropertyRNA::ptr, BPy_StructRNA::ptr, ptr, Py_DECREF(), PyC_Err_Format_Prefix(), PyC_ExceptionBuffer(), PyC_UnicodeAsBytes(), pyrna_prop_collection_Type, pyrna_prop_to_enum_bitfield(), pyrna_prop_warn_deprecated(), 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_discrete(), RNA_property_array_check(), RNA_property_boolean_set(), RNA_property_collection_add(), RNA_property_collection_type_get(), RNA_property_deprecated(), 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_PRINT_HANDLED_BY_OWNER, RPT_STORE, SNPRINTF_UTF8, STRINGIFY, ID::tag, PointerRNA::type, and UNLIKELY.

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

◆ pyrna_py_to_prop_array_index()

◆ pyrna_pydict_to_props()

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

◆ pyrna_register_class()

◆ pyrna_rotation_euler_order_get()

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

◆ pyrna_srna_contains_pointer_prop_srna()

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

◆ pyrna_srna_ExternalType()

PyObject * pyrna_srna_ExternalType ( StructRNA * srna)
static

Return the #PyTypeObject or null,

Returns
borrowed reference.

Definition at line 8247 of file bpy_rna.cc.

References BLI_assert, bpy_intern_str___slots__, BPY_LOG_RNA, bpy_types_dict, CLOG_ERROR, CLOG_TRACE, PyC_ObSpitStr(), pyrna_srna_PyBase(), and RNA_struct_identifier().

Referenced by pyrna_srna_Subtype().

◆ pyrna_srna_PyBase()

PyObject * pyrna_srna_PyBase ( StructRNA * srna)
static
Returns
borrowed reference.

Definition at line 8209 of file bpy_rna.cc.

References Py_DECREF(), pyrna_srna_Subtype(), pyrna_struct_Type, and RNA_struct_base().

Referenced by pyrna_srna_ExternalType(), and pyrna_srna_Subtype().

◆ pyrna_srna_Subtype()

◆ pyrna_string_to_enum()

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

◆ pyrna_struct_as_pointer()

PyObject * pyrna_struct_as_pointer ( BPy_StructRNA * self)
static

Definition at line 5532 of file bpy_rna.cc.

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 )

◆ pyrna_struct_as_ptr_or_null_parse()

int pyrna_struct_as_ptr_or_null_parse ( PyObject * o,
void * p )
nodiscard

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

Definition at line 9045 of file bpy_rna.cc.

References BLI_assert, 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 )
nodiscard

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 9034 of file bpy_rna.cc.

References BLI_assert, 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 )
nodiscard

◆ pyrna_struct_ass_subscript()

◆ pyrna_struct_bl_rna_find_subclass_recursive()

PyObject * pyrna_struct_bl_rna_find_subclass_recursive ( PyObject * cls,
const char * id )
static

◆ pyrna_struct_bl_rna_get_subclass()

◆ pyrna_struct_bl_rna_get_subclass_py()

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

Definition at line 4331 of file bpy_rna.cc.

References pyrna_struct_bl_rna_find_subclass_recursive(), and ret.

◆ pyrna_struct_compare()

int pyrna_struct_compare ( BPy_StructRNA * a,
BPy_StructRNA * b )
static

Definition at line 915 of file bpy_rna.cc.

References b, and BPy_StructRNA::ptr.

Referenced by pyrna_struct_richcmp().

◆ pyrna_struct_contains()

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

◆ pyrna_struct_CreatePyObject()

◆ pyrna_struct_CreatePyObject_from_type()

PyObject * pyrna_struct_CreatePyObject_from_type ( const PointerRNA * ptr,
PyTypeObject * tp,
void ** instance )
static

A lower level version of pyrna_struct_CreatePyObject, use this when type (tp) needs to be set to a non-standard value.

Returns
new reference.

Definition at line 8427 of file bpy_rna.cc.

References BLI_assert, BPy_capsule_PointerRNA_identifier, BPY_LOG_RNA, CLOG_WARN, BPy_StructRNA::ptr, ptr, Py_DECREF(), pyrna_struct_Type, and RNA_struct_identifier().

Referenced by pyrna_struct_CreatePyObject(), and pyrna_subtype_set_rna().

◆ pyrna_struct_CreatePyObject_with_primitive_support()

PyObject * pyrna_struct_CreatePyObject_with_primitive_support ( PointerRNA * ptr)
nodiscard

Definition at line 8532 of file bpy_rna.cc.

References data, ptr, PyC_UnicodeFromBytes(), and pyrna_struct_CreatePyObject().

Referenced by bpy_app_generic_callback().

◆ pyrna_struct_dealloc()

void pyrna_struct_dealloc ( PyObject * self)
static

Definition at line 7339 of file bpy_rna.cc.

References BLI_assert, IDP_FreeProperty(), BPy_StructRNA::ptr, and self.

◆ pyrna_struct_dir()

◆ pyrna_struct_get()

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

◆ pyrna_struct_get_ancestors()

PyObject * pyrna_struct_get_ancestors ( BPy_StructRNA * self)
static

◆ pyrna_struct_get_data()

PyObject * pyrna_struct_get_data ( BPy_DummyPointerRNA * self,
void *  )
static

Definition at line 5287 of file bpy_rna.cc.

References pyrna_struct_CreatePyObject(), and self.

◆ pyrna_struct_get_id_data()

PyObject * pyrna_struct_get_id_data ( BPy_DummyPointerRNA * self,
void *  )
static

Definition at line 5272 of file bpy_rna.cc.

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

◆ pyrna_struct_get_nameprop_as_pyobject()

◆ pyrna_struct_get_rna_type()

PyObject * pyrna_struct_get_rna_type ( BPy_PropertyRNA * self,
void *  )
static

Definition at line 5296 of file bpy_rna.cc.

References pyrna_struct_Subtype(), RNA_pointer_create_discrete(), and self.

◆ pyrna_struct_getattro()

◆ pyrna_struct_hash()

Py_hash_t pyrna_struct_hash ( BPy_StructRNA * self)
static

Definition at line 1217 of file bpy_rna.cc.

References Py_HashPointer, and self.

◆ pyrna_struct_id_properties_clear()

PyObject * pyrna_struct_id_properties_clear ( BPy_StructRNA * self)
static

◆ pyrna_struct_id_properties_ensure()

PyObject * pyrna_struct_id_properties_ensure ( BPy_StructRNA * self)
static

◆ pyrna_struct_id_properties_ui()

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

◆ pyrna_struct_init()

int pyrna_struct_init ( PyObject * self,
PyObject * args,
PyObject *  )
static

◆ pyrna_struct_is_property_hidden()

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

◆ pyrna_struct_is_property_overridable_library()

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

◆ pyrna_struct_is_property_readonly()

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

◆ pyrna_struct_is_property_set()

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

◆ pyrna_struct_items()

PyObject * pyrna_struct_items ( BPy_StructRNA * self)
static

◆ pyrna_struct_keys()

PyObject * pyrna_struct_keys ( BPy_StructRNA * self)
static

◆ pyrna_struct_meta_idprop_setattro()

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

◆ pyrna_struct_new()

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

Definition at line 7237 of file bpy_rna.cc.

References BLI_assert, BPy_StructRNA::ptr, pyrna_struct_Type, and self.

◆ pyrna_struct_path_from_id()

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

◆ pyrna_struct_path_from_module()

◆ pyrna_struct_path_resolve()

◆ pyrna_struct_pop()

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

◆ pyrna_struct_property_overridable_library_set()

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

◆ pyrna_struct_property_unset()

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

◆ pyrna_struct_repr()

◆ pyrna_struct_richcmp()

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

Definition at line 928 of file bpy_rna.cc.

References ATTR_FALLTHROUGH, b, BPy_StructRNA_Check, and pyrna_struct_compare().

◆ pyrna_struct_setattro()

◆ pyrna_struct_str()

PyObject * pyrna_struct_str ( BPy_StructRNA * self)
static

◆ pyrna_struct_subscript()

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

◆ pyrna_struct_Subtype()

PyObject * pyrna_struct_Subtype ( PointerRNA * ptr)
static

◆ pyrna_struct_type_extend_capi()

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

Definition at line 10511 of file bpy_rna.cc.

References BLI_assert, Py_DECREF(), pyrna_srna_Subtype(), and UNUSED_VARS_NDEBUG.

Referenced by BPY_rna_types_extend_capi().

◆ pyrna_struct_type_recast()

PyObject * pyrna_struct_type_recast ( BPy_StructRNA * self)
static

◆ pyrna_struct_validity_check()

int pyrna_struct_validity_check ( const BPy_StructRNA * pysrna)
nodiscard

Definition at line 157 of file bpy_rna.cc.

References BPy_StructRNA::ptr, and pyrna_struct_validity_exception_only().

Referenced by pyrna_py_to_prop().

◆ pyrna_struct_validity_check_only()

int pyrna_struct_validity_check_only ( const BPy_StructRNA * pysrna)
nodiscard

Definition at line 143 of file bpy_rna.cc.

References BPy_StructRNA::ptr.

◆ pyrna_struct_validity_exception_only()

void pyrna_struct_validity_exception_only ( const BPy_StructRNA * pysrna)

Definition at line 151 of file bpy_rna.cc.

Referenced by pyrna_struct_validity_check().

◆ pyrna_struct_values()

PyObject * pyrna_struct_values ( BPy_StructRNA * self)
static

◆ pyrna_subtype_set_rna()

◆ pyrna_unregister_class()

◆ pyrna_write_check()

◆ pyrna_write_set()

void pyrna_write_set ( bool val)

◆ rna_function_register_arg_count()

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

◆ rna_id_write_error()

◆ srna_from_ptr()

StructRNA * srna_from_ptr ( PointerRNA * ptr)
static

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

Definition at line 8402 of file bpy_rna.cc.

References ptr.

Referenced by BPY_rna_types_finalize_external_types(), and pyrna_struct_Subtype().

◆ srna_from_self()

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

Variable Documentation

◆ BPy_capsule_PointerRNA_identifier

const char* BPy_capsule_PointerRNA_identifier = "BPy_PointerRNA_PyCapsule"
static

'Name' identifier for PyCapsule objects used internally by bpy_rna.cc to pass a PointerRNA pointer as argument when creating BPy_StructRNA objects.

Definition at line 102 of file bpy_rna.cc.

Referenced by pyrna_struct_CreatePyObject_from_type(), and pyrna_struct_init().

◆ bpy_context_module

◆ BPy_PropertyPointerRNA_capsule_identifier

const char* BPy_PropertyPointerRNA_capsule_identifier = "BPy_PropertyPointerRNA_PyCapsule"
static

'Name' identifier for PyCapsule objects used internally by bpy_rna.cc to pass a BPy_PropertyPointerRNA_Reference pointer as argument when creating BPy_PropertyRNA and similar objects.

Definition at line 114 of file bpy_rna.cc.

Referenced by pyrna_prop_collection_iter_CreatePyObject(), pyrna_prop_collection_iter_init(), pyrna_prop_CreatePyObject(), pyrna_property_array_init(), and pyrna_property_init().

◆ bpy_types_dict

PyObject* bpy_types_dict = nullptr
static

Check if we have a native Python subclass, use it when it exists return a borrowed reference.

Definition at line 8236 of file bpy_rna.cc.

Referenced by BPY_rna_types_dict_set(), BPY_rna_types_finalize_external_types(), and pyrna_srna_ExternalType().

◆ bpy_types_module_def

PyModuleDef bpy_types_module_def
static
Initial value:
= {
"bpy.types",
bpy_types_module_doc,
nullptr,
nullptr,
nullptr,
}
static void bpy_types_module_free(void *self)
Definition bpy_rna.cc:8839
static PyMethodDef bpy_types_module_methods[]
Definition bpy_rna.cc:8825

Definition at line 8856 of file bpy_rna.cc.

Referenced by BPY_rna_types().

◆ bpy_types_module_methods

PyMethodDef bpy_types_module_methods[]
static
Initial value:
= {
{"__getattr__", (PyCFunction)bpy_types_module_getattro, METH_O, nullptr},
{"__dir__", (PyCFunction)bpy_types_module_dir, METH_NOARGS, nullptr},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * bpy_types_module_getattro(PyObject *self, PyObject *pyname)
Definition bpy_rna.cc:8756
static PyObject * bpy_types_module_dir(PyObject *self)
Definition bpy_rna.cc:8792

Definition at line 8825 of file bpy_rna.cc.

◆ 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.cc:544
static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int, int index)
Definition bpy_rna.cc:599
static int mathutils_rna_generic_check(BaseMathObject *bmo)
Definition bpy_rna.cc:513
static int mathutils_rna_vector_get(BaseMathObject *bmo, int subtype)
Definition bpy_rna.cc:522
static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int, int index)
Definition bpy_rna.cc:613
int(*)(BaseMathObject *, int) BaseMathGetFunc
Definition mathutils.hh:105
int(*)(BaseMathObject *, int) BaseMathSetFunc
Definition mathutils.hh:107
int(*)(BaseMathObject *, int, int) BaseMathSetIndexFunc
Definition mathutils.hh:111
int(*)(BaseMathObject *) BaseMathCheckFunc
Definition mathutils.hh:103
int(*)(BaseMathObject *, int, int) BaseMathGetIndexFunc
Definition mathutils.hh:109

Definition at line 647 of file bpy_rna.cc.

Referenced by BPY_rna_init().

◆ mathutils_rna_array_cb_index

uchar mathutils_rna_array_cb_index = -1
static

Definition at line 505 of file bpy_rna.cc.

Referenced by BPY_rna_init(), and pyrna_math_object_from_array().

◆ mathutils_rna_matrix_cb

Mathutils_Callback mathutils_rna_matrix_cb
static
Initial value:
= {
nullptr,
nullptr,
}
static int mathutils_rna_matrix_set(BaseMathObject *bmo, int)
Definition bpy_rna.cc:672
static int mathutils_rna_matrix_get(BaseMathObject *bmo, int)
Definition bpy_rna.cc:658

Definition at line 705 of file bpy_rna.cc.

Referenced by BPY_rna_init().

◆ mathutils_rna_matrix_cb_index

uchar mathutils_rna_matrix_cb_index = -1
static

Definition at line 656 of file bpy_rna.cc.

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,
nullptr,
}
static PyObject * pyrna_bl_owner_id_get(PyObject *)
Definition bpy_rna.cc:10559

Definition at line 10598 of file bpy_rna.cc.

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,
nullptr,
}
static PyObject * pyrna_bl_owner_id_set(PyObject *, PyObject *value)
Definition bpy_rna.cc:10568

Definition at line 10604 of file bpy_rna.cc.

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 bpy_rna.cc:10149

Definition at line 10147 of file bpy_rna.cc.

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 bpy_rna.cc:10384

Definition at line 10378 of file bpy_rna.cc.

Referenced by BPy_init_modules().

◆ pyrna_func_getseters

PyGetSetDef pyrna_func_getseters[]
static
Initial value:
= {
{"__doc__", (getter)pyrna_func_doc_get, (setter) nullptr, nullptr, nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr}
}
static PyObject * pyrna_func_doc_get(BPy_FunctionRNA *self, void *closure)
Definition bpy_rna.cc:7065

Definition at line 5332 of file bpy_rna.cc.

◆ pyrna_func_Type

PyTypeObject pyrna_func_Type

Definition at line 8048 of file bpy_rna.cc.

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

◆ pyrna_prop_array_as_mapping

PyMappingMethods pyrna_prop_array_as_mapping
static
Initial value:
= {
}
static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self)
Definition bpy_rna.cc:2268
static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self, PyObject *key, PyObject *value)
Definition bpy_rna.cc:3331
static PyObject * pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject *key)
Definition bpy_rna.cc:2985

Definition at line 3397 of file bpy_rna.cc.

◆ pyrna_prop_array_as_number

PyNumberMethods pyrna_prop_array_as_number
static
Initial value:
= {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
static int pyrna_prop_array_bool(BPy_PropertyRNA *self)
Definition bpy_rna.cc:2288

Definition at line 3410 of file bpy_rna.cc.

◆ pyrna_prop_array_as_sequence

PySequenceMethods pyrna_prop_array_as_sequence
static
Initial value:
= {
nullptr,
nullptr,
nullptr,
(ssizeobjargproc)prop_subscript_ass_array_int,
nullptr,
nullptr,
nullptr,
}
static int pyrna_prop_array_contains(BPy_PropertyRNA *self, PyObject *value)
Definition bpy_rna.cc:3461
static PyObject * pyrna_prop_array_subscript_int(BPy_PropertyArrayRNA *self, Py_ssize_t keynum)
Definition bpy_rna.cc:2451
static int prop_subscript_ass_array_int(BPy_PropertyArrayRNA *self, Py_ssize_t keynum, PyObject *value)
Definition bpy_rna.cc:3311

Definition at line 3522 of file bpy_rna.cc.

◆ pyrna_prop_array_methods

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},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * pyrna_prop_array_foreach_set(BPy_PropertyArrayRNA *self, PyObject *args)
Definition bpy_rna.cc:6247
static PyObject * pyrna_prop_array_foreach_get(BPy_PropertyArrayRNA *self, PyObject *args)
Definition bpy_rna.cc:6234

Definition at line 6440 of file bpy_rna.cc.

◆ pyrna_prop_array_Type

PyTypeObject pyrna_prop_array_Type

◆ pyrna_prop_collection_as_mapping

PyMappingMethods pyrna_prop_collection_as_mapping
static
Initial value:
= {
}
static PyObject * pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject *key)
Definition bpy_rna.cc:2782
static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self)
Definition bpy_rna.cc:2279
static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, PyObject *value)
Definition bpy_rna.cc:2900

Definition at line 3403 of file bpy_rna.cc.

◆ pyrna_prop_collection_as_number

PyNumberMethods pyrna_prop_collection_as_number
static

Definition at line 3422 of file bpy_rna.cc.

◆ pyrna_prop_collection_as_sequence

PySequenceMethods pyrna_prop_collection_as_sequence
static
Initial value:
= {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *key)
Definition bpy_rna.cc:3466
static PyObject * pyrna_prop_collection_subscript_int(BPy_PropertyRNA *self, Py_ssize_t keynum)
Definition bpy_rna.cc:2357

Definition at line 3536 of file bpy_rna.cc.

◆ pyrna_prop_collection_idprop_methods

PyMethodDef pyrna_prop_collection_idprop_methods[]
static
Initial value:
= {
{"add",
METH_NOARGS,
pyrna_prop_collection_idprop_add_doc},
{"remove",
METH_O,
pyrna_prop_collection_idprop_remove_doc},
{"clear",
METH_NOARGS,
pyrna_prop_collection_idprop_clear_doc},
{"move",
METH_VARARGS,
pyrna_prop_collection_idprop_move_doc},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * pyrna_prop_collection_idprop_clear(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5217
static PyObject * pyrna_prop_collection_idprop_add(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5158
static PyObject * pyrna_prop_collection_idprop_move(BPy_PropertyRNA *self, PyObject *args)
Definition bpy_rna.cc:5241
static PyObject * pyrna_prop_collection_idprop_remove(BPy_PropertyRNA *self, PyObject *value)
Definition bpy_rna.cc:5187

Definition at line 6478 of file bpy_rna.cc.

◆ pyrna_prop_collection_idprop_Type

PyTypeObject pyrna_prop_collection_idprop_Type
static

Definition at line 7580 of file bpy_rna.cc.

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

◆ pyrna_prop_collection_iter_Type

PyTypeObject pyrna_prop_collection_iter_Type
static

Definition at line 7818 of file bpy_rna.cc.

Referenced by BPY_rna_init(), and pyrna_prop_collection_iter_CreatePyObject().

◆ pyrna_prop_collection_methods

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},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args)
Definition bpy_rna.cc:5550
static PyObject * pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
Definition bpy_rna.cc:6053
static PyObject * pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObject *args)
Definition bpy_rna.cc:6066
static PyObject * pyrna_prop_collection_values(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5409
static PyObject * pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key_ob)
Definition bpy_rna.cc:5603
static PyObject * pyrna_prop_collection_keys(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5347
static PyObject * pyrna_prop_collection_items(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5372

Definition at line 6453 of file bpy_rna.cc.

◆ pyrna_prop_collection_Type

PyTypeObject pyrna_prop_collection_Type

◆ pyrna_prop_getseters

PyGetSetDef pyrna_prop_getseters[]
static
Initial value:
= {
{"id_data",
(setter) nullptr,
pyrna_struct_get_id_data_doc,
nullptr},
{"data", (getter)pyrna_struct_get_data, (setter) nullptr, pyrna_struct_get_data_doc, nullptr},
{"rna_type",
(setter) nullptr,
pyrna_struct_get_rna_type_doc,
nullptr},
{nullptr, nullptr, nullptr, nullptr, nullptr}
}
static PyObject * pyrna_struct_get_id_data(BPy_DummyPointerRNA *self, void *)
Definition bpy_rna.cc:5272
static PyObject * pyrna_struct_get_data(BPy_DummyPointerRNA *self, void *)
Definition bpy_rna.cc:5287
static PyObject * pyrna_struct_get_rna_type(BPy_PropertyRNA *self, void *)
Definition bpy_rna.cc:5296

Definition at line 5306 of file bpy_rna.cc.

◆ pyrna_prop_methods

PyMethodDef pyrna_prop_methods[]
static
Initial value:
= {
{"path_from_id",
METH_NOARGS,
pyrna_prop_path_from_id_doc},
{"path_from_module",
METH_NOARGS,
pyrna_prop_path_from_module_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, nullptr},
{nullptr, nullptr, 0, nullptr},
}
static PyObject * pyrna_prop_dir(BPy_PropertyRNA *self)
Definition bpy_rna.cc:5010
static PyObject * pyrna_prop_as_bytes(BPy_PropertyRNA *self)
Definition bpy_rna.cc:4223
static PyObject * pyrna_prop_update(BPy_PropertyRNA *self)
Definition bpy_rna.cc:4260
static PyObject * pyrna_prop_path_from_id(BPy_PropertyRNA *self)
Definition bpy_rna.cc:4196
static PyObject * pyrna_prop_path_from_module(BPy_PropertyRNA *self)
Definition bpy_rna.cc:4099

Definition at line 6425 of file bpy_rna.cc.

◆ pyrna_prop_Type

PyTypeObject pyrna_prop_Type

◆ pyrna_struct_as_mapping

PyMappingMethods pyrna_struct_as_mapping
static
Initial value:
= {
(lenfunc) nullptr,
}
static PyObject * pyrna_struct_subscript(BPy_StructRNA *self, PyObject *key)
Definition bpy_rna.cc:3565
static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObject *value)
Definition bpy_rna.cc:3600

Definition at line 3635 of file bpy_rna.cc.

◆ pyrna_struct_as_sequence

PySequenceMethods pyrna_struct_as_sequence
static
Initial value:
= {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
(objobjproc)pyrna_struct_contains,
nullptr,
nullptr,
}
static int pyrna_struct_contains(BPy_StructRNA *self, PyObject *value)
Definition bpy_rna.cc:3497

Definition at line 3551 of file bpy_rna.cc.

◆ pyrna_struct_getseters

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

Definition at line 5321 of file bpy_rna.cc.

◆ pyrna_struct_meta_idprop_Type

PyTypeObject pyrna_struct_meta_idprop_Type

Sub-classes of pyrna_struct_Type which support idprop definitions use this as a meta-class.

Note
tp_base member is set to &PyType_Type on initialization.

Definition at line 7080 of file bpy_rna.cc.

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

◆ pyrna_struct_methods

PyMethodDef pyrna_struct_methods[]
static

Definition at line 6311 of file bpy_rna.cc.

◆ pyrna_struct_Type

◆ rna_disallow_writes

◆ rna_module_ptr

PointerRNA* rna_module_ptr = nullptr
static

Definition at line 8702 of file bpy_rna.cc.

Referenced by BPY_rna_module(), and BPY_update_rna_module().