|
Blender V5.3
|
#include <Python.h>#include <cfloat>#include <cstddef>#include <optional>#include "DNA_listBase.h"#include "RNA_path.hh"#include "RNA_types.hh"#include "BLI_alloca.hh"#include "BLI_dynstr.hh"#include "BLI_listbase.hh"#include "BLI_math_rotation_c.hh"#include "BLI_path_utils.hh"#include "BLI_string.hh"#include "BLI_string_utf8.hh"#include "BLI_utildefines.hh"#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 | blender::BPy_PropertyPointerRNA_Reference |
| struct | blender::BPy_NamePropAsPyObject_Cache |
| struct | blender::BPy_TypesModule_State |
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
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 * | blender::pyrna_struct_CreatePyObject_from_type (const PointerRNA *ptr, PyTypeObject *tp, void **instance) |
| static PyObject * | blender::pyrna_srna_Subtype (StructRNA *srna) |
| static PyObject * | blender::pyrna_struct_Subtype (PointerRNA *ptr) |
| static PyObject * | blender::pyrna_prop_collection_values (BPy_PropertyRNA *self) |
| static StructRNA * | blender::srna_from_ptr (PointerRNA *ptr) |
| int | blender::pyrna_struct_validity_check_only (const BPy_StructRNA *pysrna) |
| void | blender::pyrna_struct_validity_exception_only (const BPy_StructRNA *pysrna) |
| int | blender::pyrna_struct_validity_check (const BPy_StructRNA *pysrna) |
| int | blender::pyrna_prop_validity_check (const BPy_PropertyRNA *self) |
| void | blender::pyrna_invalidate (BPy_DummyPointerRNA *self) |
| static void | blender::pyrna_prop_warn_deprecated (const PointerRNA *ptr, const PropertyRNA *prop, const DeprecatedRNA *deprecated) |
| static bool | blender::pyrna_status_ok_or_error (eRNAStatus status, const char *error_prefix) |
| static PyObject * | blender::pyrna_struct_get_nameprop_as_pyobject (PointerRNA *ptr, BPy_NamePropAsPyObject_Cache &nameprop_cache) |
| void | blender::BPY_id_release (ID *id) |
| static bool | blender::rna_id_write_error (PointerRNA *ptr, PyObject *key) |
| bool | blender::pyrna_write_check () |
| void | blender::pyrna_write_set (bool val) |
| void | blender::pyrna_context_init (bContext *C) |
| void | blender::pyrna_context_clear (bContext *C) |
| static Py_ssize_t | blender::pyrna_prop_collection_length (BPy_PropertyRNA *self) |
| static Py_ssize_t | blender::pyrna_prop_array_length (BPy_PropertyArrayRNA *self) |
| static int | blender::pyrna_py_to_prop (PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix, PyObject **r_value_coerce) |
| static PyObject * | blender::pyrna_prop_array_subscript_slice (BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length, Py_ssize_t array_length) |
| static short | blender::pyrna_rotation_euler_order_get (PointerRNA *ptr, const short order_fallback, PropertyRNA **r_prop_eul_order) |
| static int | blender::mathutils_rna_generic_check (BaseMathObject *bmo) |
| static int | blender::mathutils_rna_vector_get (BaseMathObject *bmo, int subtype) |
| static int | blender::mathutils_rna_vector_set (BaseMathObject *bmo, int subtype) |
| static int | blender::mathutils_rna_vector_get_index (BaseMathObject *bmo, int, int index) |
| static int | blender::mathutils_rna_vector_set_index (BaseMathObject *bmo, int, int index) |
| static int | blender::mathutils_rna_matrix_get (BaseMathObject *bmo, int) |
| static int | blender::mathutils_rna_matrix_set (BaseMathObject *bmo, int) |
| PyObject * | blender::pyrna_math_object_from_array (PointerRNA *ptr, PropertyRNA *prop) |
| static int | blender::pyrna_struct_compare (BPy_StructRNA *a, BPy_StructRNA *b) |
| static int | blender::pyrna_prop_compare (BPy_PropertyRNA *a, BPy_PropertyRNA *b) |
| static PyObject * | blender::pyrna_struct_richcmp (PyObject *a, PyObject *b, int op) |
| static PyObject * | blender::pyrna_prop_richcmp (PyObject *a, PyObject *b, int op) |
| static PyObject * | blender::pyrna_struct_str (BPy_StructRNA *self) |
| static PyObject * | blender::pyrna_struct_repr (BPy_StructRNA *self) |
| static PyObject * | blender::pyrna_prop_str (BPy_PropertyRNA *self) |
| static PyObject * | blender::pyrna_prop_repr_ex (BPy_PropertyRNA *self, const int index_dim, const int index) |
| static PyObject * | blender::pyrna_prop_repr (BPy_PropertyRNA *self) |
| static PyObject * | blender::pyrna_prop_array_repr (BPy_PropertyArrayRNA *self) |
| static PyObject * | blender::pyrna_func_repr (BPy_FunctionRNA *self) |
| static Py_hash_t | blender::pyrna_struct_hash (BPy_StructRNA *self) |
| static long | blender::pyrna_prop_hash (BPy_PropertyRNA *self) |
| static const char * | blender::pyrna_enum_as_string (PointerRNA *ptr, PropertyRNA *prop) |
| static int | blender::pyrna_string_to_enum (PyObject *item, PointerRNA *ptr, PropertyRNA *prop, int *r_value, const char *error_prefix) |
| static int | blender::pyrna_prop_to_enum_bitfield (PointerRNA *ptr, PropertyRNA *prop, PyObject *value, int *r_value, const char *error_prefix) |
| static PyObject * | blender::pyrna_enum_to_py (PointerRNA *ptr, PropertyRNA *prop, int val) |
| PyObject * | blender::pyrna_prop_to_py (PointerRNA *ptr, PropertyRNA *prop) |
| int | blender::pyrna_pydict_to_props (PointerRNA *ptr, PyObject *kw, const bool all_args, const char *error_prefix) |
| static PyObject * | blender::pyrna_prop_array_to_py_index (BPy_PropertyArrayRNA *self, int index) |
| static int | blender::pyrna_py_to_prop_array_index (BPy_PropertyArrayRNA *self, int index, PyObject *value) |
| static int | blender::pyrna_prop_array_bool (BPy_PropertyRNA *self) |
| static int | blender::pyrna_prop_collection_bool (BPy_PropertyRNA *self) |
| static int | blender::pyrna_prop_collection_subscript_is_valid_or_error (const PyObject *value) |
| static void | blender::pyrna_prop_collection_string_subscript_unsupported_error (BPy_PropertyRNA *self, const char *error_prefix) |
| static int | blender::pyrna_prop_collection_string_subscript_supported_or_error (BPy_PropertyRNA *self, const char *error_prefix) |
| static PyObject * | blender::pyrna_prop_collection_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum) |
| static int | blender::pyrna_prop_collection_ass_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum, PyObject *value) |
| static PyObject * | blender::pyrna_prop_array_subscript_int (BPy_PropertyArrayRNA *self, Py_ssize_t keynum) |
| static PyObject * | blender::pyrna_prop_collection_subscript_str (BPy_PropertyRNA *self, const char *keyname) |
| static int | blender::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 * | blender::pyrna_prop_collection_subscript_str_lib_pair (BPy_PropertyRNA *self, PyObject *key, const char *err_prefix, const bool err_not_found) |
| static PyObject * | blender::pyrna_prop_collection_subscript_slice (BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop) |
| static PyObject * | blender::pyrna_prop_collection_subscript (BPy_PropertyRNA *self, PyObject *key) |
| static int | blender::pyrna_prop_collection_type_check (BPy_PropertyRNA *self, PyObject *value) |
| static int | blender::pyrna_prop_collection_ass_subscript (BPy_PropertyRNA *self, PyObject *key, PyObject *value) |
| static PyObject * | blender::pyrna_prop_array_subscript (BPy_PropertyArrayRNA *self, PyObject *key) |
| static PyObject * | blender::prop_subscript_ass_array_slice__as_seq_fast (PyObject *value, int length) |
| static int | blender::prop_subscript_ass_array_slice__float_recursive (PyObject **value_items, float *value, int totdim, const int dimsize[], const float range[2]) |
| static int | blender::prop_subscript_ass_array_slice__int_recursive (PyObject **value_items, int *value, int totdim, const int dimsize[], const int range[2]) |
| static int | blender::prop_subscript_ass_array_slice__bool_recursive (PyObject **value_items, bool *value, int totdim, const int dimsize[]) |
| static int | blender::prop_subscript_ass_array_slice (PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int start, int step, int slice_length, int array_length, PyObject *value_orig) |
| static int | blender::prop_subscript_ass_array_int (BPy_PropertyArrayRNA *self, Py_ssize_t keynum, PyObject *value) |
| static int | blender::pyrna_prop_array_ass_subscript (BPy_PropertyArrayRNA *self, PyObject *key, PyObject *value) |
| static int | blender::pyrna_prop_array_contains (BPy_PropertyRNA *self, PyObject *value) |
| static int | blender::pyrna_prop_collection_contains (BPy_PropertyRNA *self, PyObject *key) |
| static int | blender::pyrna_struct_contains (BPy_StructRNA *self, PyObject *value) |
| static PyObject * | blender::pyrna_struct_subscript (BPy_StructRNA *self, PyObject *key) |
| static int | blender::pyrna_struct_ass_subscript (BPy_StructRNA *self, PyObject *key, PyObject *value) |
| blender::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 * | blender::pyrna_struct_keys (BPy_StructRNA *self) |
| blender::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 * | blender::pyrna_struct_items (BPy_StructRNA *self) |
| blender::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 * | blender::pyrna_struct_values (BPy_StructRNA *self) |
| blender::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" " :param property: Property name.\n" " :type property: str\n" " :param 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 * | blender::pyrna_struct_is_property_set (BPy_StructRNA *self, PyObject *args, PyObject *kw) |
| blender::PyDoc_STRVAR (pyrna_struct_property_unset_doc, ".. method:: property_unset(property, /)\n" "\n" " Unset a property, will use default value afterward.\n" "\n" " :param property: Property name.\n" " :type property: str\n") | |
| static PyObject * | blender::pyrna_struct_property_unset (BPy_StructRNA *self, PyObject *args) |
| blender::PyDoc_STRVAR (pyrna_struct_is_property_hidden_doc, ".. method:: is_property_hidden(property, /)\n" "\n" " Check if a property is hidden.\n" "\n" " :param property: Property name.\n" " :type property: str\n" " :return: True when the property is hidden.\n" " :rtype: bool\n") | |
| static PyObject * | blender::pyrna_struct_is_property_hidden (BPy_StructRNA *self, PyObject *args) |
| blender::PyDoc_STRVAR (pyrna_struct_is_property_readonly_doc, ".. method:: is_property_readonly(property, /)\n" "\n" " Check if a property is readonly.\n" "\n" " :param property: Property name.\n" " :type property: str\n" " :return: True when the property is readonly (not writable).\n" " :rtype: bool\n") | |
| static PyObject * | blender::pyrna_struct_is_property_readonly (BPy_StructRNA *self, PyObject *args) |
| blender::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" " :param property: Property name.\n" " :type property: str\n" " :return: True when the property is overridable.\n" " :rtype: bool\n") | |
| static PyObject * | blender::pyrna_struct_is_property_overridable_library (BPy_StructRNA *self, PyObject *args) |
| blender::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" " :param property: Property name.\n" " :type property: str\n" " :param 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 * | blender::pyrna_struct_property_overridable_library_set (BPy_StructRNA *self, PyObject *args) |
| blender::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" " :param path: path which this property resolves.\n" " :type path: str\n" " :param 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 * | blender::pyrna_struct_path_resolve (BPy_StructRNA *self, PyObject *args) |
| blender::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" " :param property: Optional property name to get the full path from\n" " :type property: str\n" " :param 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 * | blender::pyrna_struct_path_from_module (BPy_StructRNA *self, PyObject *args) |
| blender::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 * | blender::pyrna_prop_path_from_module (BPy_PropertyRNA *self) |
| blender::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" " :param 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 * | blender::pyrna_struct_path_from_id (BPy_StructRNA *self, PyObject *args) |
| blender::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 * | blender::pyrna_prop_path_from_id (BPy_PropertyRNA *self) |
| blender::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 * | blender::pyrna_prop_as_bytes (BPy_PropertyRNA *self) |
| blender::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 * | blender::pyrna_prop_update (BPy_PropertyRNA *self) |
| blender::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 * | blender::pyrna_struct_type_recast (BPy_StructRNA *self) |
| static PyObject * | blender::pyrna_struct_bl_rna_find_subclass_recursive (PyObject *cls, const char *id) |
| blender::PyDoc_STRVAR (pyrna_struct_bl_rna_get_subclass_py_doc, ".. classmethod:: bl_rna_get_subclass_py(id, default=None, /)\n" "\n" " :param id: The RNA type identifier.\n" " :type id: str\n" " :param default: The value to return when not found.\n" " :type default: type | None\n" " :return: The class or default when not found.\n" " :rtype: type\n") | |
| static PyObject * | blender::pyrna_struct_bl_rna_get_subclass_py (PyObject *cls, PyObject *args) |
| blender::PyDoc_STRVAR (pyrna_struct_bl_rna_get_subclass_doc, ".. classmethod:: bl_rna_get_subclass(id, default=None, /)\n" "\n" " :param id: The RNA type identifier.\n" " :type id: str\n" " :param default: The value to return when not found.\n" " :type default: :class:`bpy.types.Struct` | None\n" " :return: The RNA type or default when not found.\n" " :rtype: :class:`bpy.types.Struct`\n") | |
| static PyObject * | blender::pyrna_struct_bl_rna_get_subclass (PyObject *cls, PyObject *args) |
| blender::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 * | blender::pyrna_struct_get_ancestors (BPy_StructRNA *self) |
| static void | blender::pyrna_dir_members_py__add_keys (PyObject *list, PyObject *dict) |
| static void | blender::pyrna_dir_members_py (PyObject *list, PyObject *self) |
| static void | blender::pyrna_dir_members_rna (PyObject *list, PointerRNA *ptr) |
| static PyObject * | blender::pyrna_struct_dir (BPy_StructRNA *self) |
| blender::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 * | blender::pyrna_struct_id_properties_ensure (BPy_StructRNA *self) |
| blender::PyDoc_STRVAR (pyrna_struct_id_properties_ui_doc, ".. method:: id_properties_ui(key, /)\n" "\n" " :param key: String name of the property.\n" " :type key: str\n" " :return: An object used to manage an IDProperty's UI data.\n" " :rtype: :class:`idprop.types.IDPropertyUIManager` | None\n") | |
| static PyObject * | blender::pyrna_struct_id_properties_ui (BPy_StructRNA *self, PyObject *args) |
| blender::PyDoc_STRVAR (pyrna_struct_id_properties_clear_doc, ".. method:: id_properties_clear()\n" "\n" " Remove the parent group for an RNA struct's custom IDProperties.\n") | |
| static PyObject * | blender::pyrna_struct_id_properties_clear (BPy_StructRNA *self) |
| static PyObject * | blender::pyrna_struct_getattro (BPy_StructRNA *self, PyObject *pyname) |
| static int | blender::pyrna_struct_meta_idprop_setattro (PyObject *cls, PyObject *attr, PyObject *value) |
| static int | blender::pyrna_struct_setattro (BPy_StructRNA *self, PyObject *pyname, PyObject *value) |
| static PyObject * | blender::pyrna_prop_dir (BPy_PropertyRNA *self) |
| static PyObject * | blender::pyrna_prop_array_getattro (BPy_PropertyRNA *self, PyObject *pyname) |
| static PyObject * | blender::pyrna_prop_collection_getattro (BPy_PropertyRNA *self, PyObject *pyname) |
| static int | blender::pyrna_prop_collection_setattro (BPy_PropertyRNA *self, PyObject *pyname, PyObject *value) |
| blender::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 * | blender::pyrna_prop_collection_idprop_add (BPy_PropertyRNA *self) |
| blender::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" " :param index: Index of the item to be removed.\n" " :type index: int\n") | |
| static PyObject * | blender::pyrna_prop_collection_idprop_remove (BPy_PropertyRNA *self, PyObject *value) |
| blender::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 * | blender::pyrna_prop_collection_idprop_clear (BPy_PropertyRNA *self) |
| blender::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" " :param src_index: Source item index.\n" " :type src_index: int\n" " :param dst_index: Destination item index.\n" " :type dst_index: int\n") | |
| static PyObject * | blender::pyrna_prop_collection_idprop_move (BPy_PropertyRNA *self, PyObject *args) |
| blender::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) (readonly)\n" "\n" ":type: :class:`bpy.types.ID`\n") | |
| static PyObject * | blender::pyrna_struct_get_id_data (BPy_DummyPointerRNA *self, void *) |
| blender::PyDoc_STRVAR (pyrna_struct_get_data_doc, "The data this property is using, (readonly)\n" "\n" ":type: :class:`bpy.types.bpy_struct`\n") | |
| static PyObject * | blender::pyrna_struct_get_data (BPy_DummyPointerRNA *self, void *) |
| blender::PyDoc_STRVAR (pyrna_struct_get_rna_type_doc, "The property type for introspection.\n" "\n" ":type: :class:`bpy.types.Property`\n") | |
| static PyObject * | blender::pyrna_struct_get_rna_type (BPy_PropertyRNA *self, void *) |
| static PyObject * | blender::pyrna_func_doc_get (BPy_FunctionRNA *self, void *closure) |
| blender::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 * | blender::pyrna_prop_collection_keys (BPy_PropertyRNA *self) |
| blender::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 * | blender::pyrna_prop_collection_items (BPy_PropertyRNA *self) |
| blender::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") | |
| blender::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" " :param key: The key associated with the custom property.\n" " :type key: str\n" " :param 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 * | blender::pyrna_struct_get (BPy_StructRNA *self, PyObject *args) |
| blender::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" " :param key: The key associated with the custom property.\n" " :type key: str\n" " :param 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 * | blender::pyrna_struct_pop (BPy_StructRNA *self, PyObject *args) |
| blender::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 * | blender::pyrna_struct_as_pointer (BPy_StructRNA *self) |
| blender::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" " :param key: The identifier for the collection member.\n" "\n" " For ``bpy.data`` collections a ``(name, library)`` tuple can also be used.\n" " *library* is the library filepath or ``None`` for data in the current file.\n" " :type key: str | tuple[str, str | None]\n" " :param default: Optional argument for the value to return if\n" " *key* is not found.\n" " :type default: Any\n" " :return: The collection member or default.\n" " :rtype: :class:`bpy_struct`\n") | |
| static PyObject * | blender::pyrna_prop_collection_get (BPy_PropertyRNA *self, PyObject *args) |
| blender::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" " :param key: The identifier for the collection member.\n" " :type key: str\n" " :return: index of the key.\n" " :rtype: int\n") | |
| static PyObject * | blender::pyrna_prop_collection_find (BPy_PropertyRNA *self, PyObject *key_ob) |
| static bool | blender::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 | blender::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 | blender::foreach_compat_buffer (RawPropertyType raw_type, int attr_signed, const char *format) |
| static PyObject * | blender::foreach_getset (BPy_PropertyRNA *self, PyObject *args, int set) |
| blender::PyDoc_STRVAR (pyrna_prop_collection_foreach_get_doc, ".. method:: foreach_get(attr, seq)\n" "\n" " Fast access to a basic-type attribute within a collection.\n" "\n" " :param attr: Name of the item attribute to read (for example ``co``, ``normal`` or\n" " ``select``). The attribute must be a basic type (bool, int or float).\n" "\n" " For geometry attribute types, see :attr:`Attribute.data_type`.\n" " :type attr: str\n" " :param seq: Writable sequence or buffer receiving flattened values.\n" " For array attributes, the length must be ``len(collection) * array_length``.\n" " :type seq: MutableSequence[bool | int | float] | Buffer\n") | |
| static PyObject * | blender::pyrna_prop_collection_foreach_get (BPy_PropertyRNA *self, PyObject *args) |
| blender::PyDoc_STRVAR (pyrna_prop_collection_foreach_set_doc, ".. method:: foreach_set(attr, seq)\n" "\n" " Fast access to a basic-type attribute within a collection.\n" "\n" " :param attr: Name of the item attribute to write (for example ``co`` or\n" " ``select``). The attribute must be a basic type (bool, int or float).\n" "\n" " For geometry attribute types, see :attr:`Attribute.data_type`.\n" " :type attr: str\n" " :param seq: Sequence or buffer containing flattened values.\n" " For array attributes, the length must be ``len(collection) * array_length``.\n" " :type seq: Sequence[bool | int | float] | Buffer\n") | |
| static PyObject * | blender::pyrna_prop_collection_foreach_set (BPy_PropertyRNA *self, PyObject *args) |
| static PyObject * | blender::pyprop_array_foreach_getset (BPy_PropertyArrayRNA *self, PyObject *args, const bool do_set) |
| blender::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" "\n" " :param seq: Buffer to read element values into, must match the length of this array.\n" " :type seq: MutableSequence[Any]\n") | |
| static PyObject * | blender::pyrna_prop_array_foreach_get (BPy_PropertyArrayRNA *self, PyObject *args) |
| blender::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" "\n" " :param seq: Element values to write, must match the length of this array.\n" " :type seq: Sequence[Any]\n") | |
| static PyObject * | blender::pyrna_prop_array_foreach_set (BPy_PropertyArrayRNA *self, PyObject *args) |
| static PyObject * | blender::pyrna_prop_array_iter (BPy_PropertyArrayRNA *self) |
| static PyObject * | blender::pyrna_param_to_py (PointerRNA *ptr, PropertyRNA *prop, void *data) |
| static PyObject * | blender::kwnames_get_item_string (PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames, Py_ssize_t nkw, const char *parm_name) |
| static void | blender::pyrna_func_error_prefix (BPy_FunctionRNA *self, PropertyRNA *parm, const int parm_index, char *error, const size_t error_maxncpy) |
| static PyObject * | blender::pyrna_func_vectorcall (PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames) |
| static void | blender::pyrna_subtype_set_rna (PyObject *newclass, StructRNA *srna) |
| static PyObject * | blender::pyrna_srna_PyBase (StructRNA *srna) |
| void | blender::BPY_rna_types_dict_set (PyObject *dict) |
| static PyObject * | blender::pyrna_srna_ExternalType (StructRNA *srna) |
| PyObject * | blender::pyrna_struct_CreatePyObject (PointerRNA *ptr) |
| PyObject * | blender::pyrna_struct_CreatePyObject_with_primitive_support (PointerRNA *ptr) |
| PyObject * | blender::pyrna_prop_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop) |
| PyObject * | blender::pyrna_id_CreatePyObject (ID *id) |
| bool | blender::pyrna_id_FromPyObject (PyObject *obj, ID **id) |
| bool | blender::pyrna_id_CheckPyObject (PyObject *obj) |
| void | blender::BPY_rna_init () |
| void | blender::BPY_rna_exit () |
| PyObject * | blender::BPY_rna_module () |
| void | blender::BPY_update_rna_module () |
Generic Python Utilities | |
Could be moved to the PyC_* API, currently they're only needed locally. | |
| static PyObject * | blender::pyweakref_get_ref (PyObject *ref) |
RNA Class Registration: Deferred | |
| static int | blender::deferred_register_prop (StructRNA *srna, PyObject *key, PyObject *item) |
| static int | blender::pyrna_deferred_register_class_from_type_hints (StructRNA *srna, PyTypeObject *py_class) |
| static int | blender::pyrna_deferred_register_props (StructRNA *srna, PyObject *class_dict) |
| static int | blender::pyrna_deferred_register_class_recursive (StructRNA *srna, PyTypeObject *py_class) |
| int | blender::pyrna_deferred_register_class (StructRNA *srna, PyTypeObject *py_class) |
| static int | blender::rna_function_register_arg_count (FunctionRNA *func, int *min_count) |
RNA Struct Access: #StructRNA | |
Utilities for accessing & creating StructRNA on demand. | |
| StructRNA * | blender::pyrna_struct_as_srna (PyObject *self, const bool parent, const char *error_prefix) |
| const PointerRNA * | blender::pyrna_struct_as_ptr (PyObject *py_obj, const StructRNA *srna) |
| const PointerRNA * | blender::pyrna_struct_as_ptr_or_null (PyObject *py_obj, const StructRNA *srna) |
| int | blender::pyrna_struct_as_ptr_parse (PyObject *o, void *p) |
| int | blender::pyrna_struct_as_ptr_or_null_parse (PyObject *o, void *p) |
| StructRNA * | blender::srna_from_self (PyObject *self, const char *error_prefix) |
RNA Class Registration: Utilities | |
Mainly helpers for register_class & unregister_class. | |
| static int | blender::bpy_class_validate_recursive (PointerRNA *dummy_ptr, StructRNA *srna, void *py_data, bool *have_function) |
| static int | blender::bpy_class_validate (PointerRNA *dummy_ptr, void *py_data, bool *have_function) |
| static int | blender::bpy_class_call (bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) |
| static void | blender::bpy_class_free_ex (PyObject *self, bool decref) |
| static void | blender::bpy_class_free (void *pyob_ptr) |
| static PyTypeObject * | blender::bpy_class_check_any_bases_registered (PyTypeObject *cls) |
| static PyTypeObject * | blender::bpy_class_check_any_subclasses_registered (PyTypeObject *cls) |
| void | blender::pyrna_alloc_types () |
| void | blender::BPY_free_srna_pytype (StructRNA *srna) |
RNA Support for extended via the C-API | |
| void | blender::pyrna_struct_type_extend_capi (StructRNA *srna, PyMethodDef *method, PyGetSetDef *getset) |
RNA Class Register Method | |
| #define | BPY_TYPEDEF_REGISTERABLE_DOC |
| PyMethodDef | blender::meth_bpy_register_class |
| static PyObject * | blender::pyrna_register_class (PyObject *self, PyObject *py_class) |
| blender::PyDoc_STRVAR (pyrna_register_class_doc, ".. function:: register_class(cls)\n" "\n" " Register a subclass of a Blender type class.\n" "\n" " :param 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 | blender::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.
>>> class MyObSubclass(bpy.types.Object):
... def test_func(self):
... print(100)
...
>>> myob = MyObSubclass(bpy.context.object)
>>> myob.test_func()
100
| |
| PyTypeObject | blender::pyrna_struct_Type |
| static PyObject * | blender::pyrna_struct_new (PyTypeObject *type, PyObject *args, PyObject *) |
| static int | blender::pyrna_struct_init (PyObject *self, PyObject *args, PyObject *) |
| static void | blender::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.
TODO Add python code example of using this overriding feature. | |
| PyTypeObject | blender::pyrna_prop_Type |
| PyTypeObject | blender::pyrna_prop_array_Type |
| PyTypeObject | blender::pyrna_prop_collection_Type |
| static PyTypeObject | blender::pyrna_prop_collection_idprop_Type |
| static PyTypeObject | blender::pyrna_prop_collection_iter_Type |
| static PyObject * | blender::pyrna_prop_collection_iter (PyObject *self) |
| static PyObject * | blender::pyrna_property_new (PyTypeObject *type, PyObject *args, PyObject *) |
| static int | blender::pyrna_property_init (PyObject *self, PyObject *args, PyObject *) |
| static void | blender::pyrna_property_dealloc (PyObject *self) |
| static int | blender::pyrna_property_array_init (PyObject *self, PyObject *args, PyObject *) |
| static PyObject * | blender::pyrna_prop_collection_iter_new (PyTypeObject *type, PyObject *, PyObject *) |
| static int | blender::pyrna_prop_collection_iter_init (PyObject *self, PyObject *, PyObject *) |
| static void | blender::pyrna_prop_collection_iter_dealloc (PyObject *self) |
| static PyObject * | blender::pyrna_prop_collection_iter_next (PyObject *self) |
| static PyObject * | blender::pyrna_prop_collection_iter_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop) |
BPY RNA Function | |
| PyTypeObject | blender::pyrna_func_Type |
| static PyObject * | blender::pyrna_func_CreatePyObject (const PointerRNA *ptr, FunctionRNA *func) |
| static void | blender::pyrna_func_dealloc (PyObject *self) |
RNA Types Module <tt>bpy.types</tt> | |
| static PyMethodDef | blender::bpy_types_module_methods [] |
| static PyModuleDef | blender::bpy_types_module_def |
| static PyObject * | blender::bpy_types_module_getattro (PyObject *self, PyObject *pyname) |
| static PyObject * | blender::bpy_types_module_dir (PyObject *self) |
| static void | blender::bpy_types_module_free (void *self) |
| blender::PyDoc_STRVAR (bpy_types_module_doc, "Access to internal Blender types.") | |
| PyObject * | blender::BPY_rna_types () |
| void | blender::BPY_rna_types_finalize_external_types (PyObject *submodule) |
RNA Class Unregister Method | |
| PyMethodDef | blender::meth_bpy_unregister_class |
| static PyObject * | blender::pyrna_unregister_class (PyObject *self, PyObject *py_class) |
| blender::PyDoc_STRVAR (pyrna_unregister_class_doc, ".. function:: unregister_class(cls)\n" "\n" " Unload the Python class from blender.\n" "\n" " :param cls: Blender type class, \n" " see :func:`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 | blender::meth_bpy_owner_id_get |
| PyMethodDef | blender::meth_bpy_owner_id_set |
| static PyObject * | blender::pyrna_bl_owner_id_get (PyObject *) |
| static PyObject * | blender::pyrna_bl_owner_id_set (PyObject *, PyObject *value) |
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.
| #define BPY_DOC_ID_PROP_TYPE_NOTE |
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 171 of file bpy_rna.cc.
Referenced by blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), and blender::PyDoc_STRVAR().
| #define BPY_TYPEDEF_REGISTERABLE_DOC |
Definition at line 10498 of file bpy_rna.cc.
Referenced by blender::PyDoc_STRVAR(), and blender::PyDoc_STRVAR().
| #define MATHUTILS_CB_SUBTYPE_COLOR 3 |
Definition at line 590 of file bpy_rna.cc.
Referenced by blender::pyrna_math_object_from_array().
| #define MATHUTILS_CB_SUBTYPE_EUL 0 |
Definition at line 587 of file bpy_rna.cc.
Referenced by blender::mathutils_rna_vector_get(), blender::mathutils_rna_vector_set(), and blender::pyrna_math_object_from_array().
| #define MATHUTILS_CB_SUBTYPE_QUAT 2 |
Definition at line 589 of file bpy_rna.cc.
Referenced by blender::pyrna_math_object_from_array().
| #define MATHUTILS_CB_SUBTYPE_VEC 1 |
Definition at line 588 of file bpy_rna.cc.
Referenced by blender::pyrna_math_object_from_array().
| #define PROP_ALL_VECTOR_SUBTYPES |
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 818 of file bpy_rna.cc.
Referenced by blender::pyrna_math_object_from_array(), and blender::pyrna_param_to_py().
| #define PYRNA_PROP_COLLECTION_ABS_INDEX | ( | ret_err | ) |
Definition at line 2413 of file bpy_rna.cc.
Referenced by blender::pyrna_prop_collection_ass_subscript_int(), and blender::pyrna_prop_collection_subscript_int().
| #define USE_MATHUTILS |
Definition at line 82 of file bpy_rna.cc.
| #define USE_PEDANTIC_WRITE |
Definition at line 81 of file bpy_rna.cc.
| #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 92 of file bpy_rna.cc.
| #define USE_STRING_COERCE |
Definition at line 83 of file bpy_rna.cc.