Blender V2.61 - r43446
Defines | Functions | Variables

bpy_rna.c File Reference

#include <Python.h>
#include <stddef.h>
#include <float.h>
#include "RNA_types.h"
#include "bpy_rna.h"
#include "bpy_rna_anim.h"
#include "bpy_props.h"
#include "bpy_util.h"
#include "bpy_rna_callback.h"
#include "bpy_intern_string.h"
#include "BLI_dynstr.h"
#include "BLI_string.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_utildefines.h"
#include "RNA_enum_types.h"
#include "RNA_define.h"
#include "RNA_access.h"
#include "MEM_guardedalloc.h"
#include "BKE_main.h"
#include "BKE_idcode.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_report.h"
#include "BKE_idprop.h"
#include "BKE_animsys.h"
#include "BKE_fcurve.h"
#include "../generic/idprop_py_api.h"
#include "../generic/py_capi_utils.h"
#include "../mathutils/mathutils.h"

Go to the source code of this file.

Defines

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

Functions

static PyObject * pyrna_struct_Subtype (PointerRNA *ptr)
static PyObject * pyrna_prop_collection_values (BPy_PropertyRNA *self)
int pyrna_struct_validity_check (BPy_StructRNA *pysrna)
int pyrna_prop_validity_check (BPy_PropertyRNA *self)
void BPY_id_release (struct ID *id)
static int rna_id_write_error (PointerRNA *ptr, PyObject *key)
int pyrna_write_check (void)
void pyrna_write_set (int val)
static Py_ssize_t pyrna_prop_collection_length (BPy_PropertyRNA *self)
static Py_ssize_t pyrna_prop_array_length (BPy_PropertyArrayRNA *self)
static int pyrna_py_to_prop (PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix)
static int deferred_register_prop (StructRNA *srna, PyObject *key, PyObject *item)
static PyObject * pyrna_prop_array_subscript_slice (BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, Py_ssize_t start, Py_ssize_t stop, Py_ssize_t length)
static short pyrna_rotation_euler_order_get (PointerRNA *ptr, PropertyRNA **prop_eul_order, short order_fallback)
static int mathutils_rna_generic_check (BaseMathObject *bmo)
static int mathutils_rna_vector_get (BaseMathObject *bmo, int subtype)
static int mathutils_rna_vector_set (BaseMathObject *bmo, int subtype)
static int mathutils_rna_vector_get_index (BaseMathObject *bmo, int UNUSED(subtype), int index)
static int mathutils_rna_vector_set_index (BaseMathObject *bmo, int UNUSED(subtype), int index)
static int mathutils_rna_matrix_get (BaseMathObject *bmo, int UNUSED(subtype))
static int mathutils_rna_matrix_set (BaseMathObject *bmo, int UNUSED(subtype))
PyObject * pyrna_math_object_from_array (PointerRNA *ptr, PropertyRNA *prop)
int pyrna_enum_value_from_id (EnumPropertyItem *item, const char *identifier, int *value, const char *error_prefix)
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 (BPy_PropertyRNA *self)
static PyObject * pyrna_func_repr (BPy_FunctionRNA *self)
static long pyrna_struct_hash (BPy_StructRNA *self)
static long pyrna_prop_hash (BPy_PropertyRNA *self)
static void pyrna_struct_dealloc (BPy_StructRNA *self)
static void pyrna_prop_dealloc (BPy_PropertyRNA *self)
static void pyrna_prop_array_dealloc (BPy_PropertyRNA *self)
static const char * pyrna_enum_as_string (PointerRNA *ptr, PropertyRNA *prop)
static int pyrna_string_to_enum (PyObject *item, PointerRNA *ptr, PropertyRNA *prop, int *val, const char *error_prefix)
int pyrna_set_to_enum_bitfield (EnumPropertyItem *items, PyObject *value, 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)
PyObject * pyrna_enum_bitfield_to_py (EnumPropertyItem *items, int value)
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, int all_args, const char *error_prefix)
static PyObject * pyrna_func_to_py (PointerRNA *ptr, FunctionRNA *func)
static PyObject * pyrna_prop_array_to_py_index (BPy_PropertyArrayRNA *self, int index)
static int pyrna_py_to_prop_array_index (BPy_PropertyArrayRNA *self, int index, PyObject *value)
static int pyrna_prop_array_bool (BPy_PropertyRNA *self)
static int pyrna_prop_collection_bool (BPy_PropertyRNA *self)
static PyObject * pyrna_prop_collection_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum)
static int pyrna_prop_collection_ass_subscript_int (BPy_PropertyRNA *self, Py_ssize_t keynum, PyObject *value)
static PyObject * pyrna_prop_array_subscript_int (BPy_PropertyArrayRNA *self, int keynum)
static PyObject * pyrna_prop_collection_subscript_str (BPy_PropertyRNA *self, const char *keyname)
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 short 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 int prop_subscript_ass_array_slice (PointerRNA *ptr, PropertyRNA *prop, 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 pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property keys.\n"" :rtype: list of strings\n""\n"BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_keys (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_struct_items_doc,".. method:: items()\n""\n"" Returns the items of this objects custom properties (matches pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property key, value pairs.\n"" :rtype: list of key, value tuples\n""\n"BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_items (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_struct_values_doc,".. method:: values()\n""\n"" Returns the values of this objects custom properties (matches pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property values.\n"" :rtype: list\n""\n"BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_values (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_struct_is_property_set_doc,".. method:: is_property_set(property)\n""\n"" Check if a property is set, use for testing operator properties.\n""\n"" :return: True when the property has been set.\n"" :rtype: boolean\n")
static PyObject * pyrna_struct_is_property_set (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_is_property_hidden_doc,".. method:: is_property_hidden(property)\n""\n"" Check if a property is hidden.\n""\n"" :return: True when the property is hidden.\n"" :rtype: boolean\n")
static PyObject * pyrna_struct_is_property_hidden (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_path_resolve_doc,".. method:: path_resolve(path, coerce=True)\n""\n"" Returns the property from the path, raise an exception when not found.\n""\n"" :arg path: path which this property resolves.\n"" :type path: string\n"" :arg coerce: optional argument, when True, the property will be converted\n"" into its python representation.\n"" :type coerce: boolean\n")
static PyObject * pyrna_struct_path_resolve (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_path_from_id_doc,".. method:: path_from_id(property=\"\")\n""\n"" Returns the data path from the ID to this object (string).\n""\n"" :arg property: Optional property name which can be used if the path is\n"" to a property of this object.\n"" :type property: string\n"" :return: The path from :class:`bpy.types.bpy_struct.id_data`\n"" to this struct and property (when given).\n"" :rtype: str\n")
static PyObject * pyrna_struct_path_from_id (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_prop_path_from_id_doc,".. method:: path_from_id()\n""\n"" Returns the data path from the ID to this property (string).\n""\n"" :return: The path from :class:`bpy.types.bpy_struct.id_data` to this property.\n"" :rtype: str\n")
static PyObject * pyrna_prop_path_from_id (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_struct_type_recast_doc,".. method:: type_recast()\n""\n"" Return a new instance, this is needed because types\n"" such as textures can be changed at runtime.\n""\n"" :return: a new instance of this object with the type initialized again.\n"" :rtype: subclass of :class:`bpy.types.bpy_struct`\n")
static PyObject * pyrna_struct_type_recast (BPy_StructRNA *self)
static 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)
static PyObject * pyrna_struct_getattro (BPy_StructRNA *self, PyObject *pyname)
static int pyrna_is_deferred_prop (const PyObject *value)
static int pyrna_struct_meta_idprop_setattro (PyObject *cls, PyObject *attr, PyObject *value)
static int pyrna_struct_setattro (BPy_StructRNA *self, PyObject *pyname, PyObject *value)
static PyObject * pyrna_prop_dir (BPy_PropertyRNA *self)
static PyObject * pyrna_prop_array_getattro (BPy_PropertyRNA *self, PyObject *pyname)
static PyObject * pyrna_prop_collection_getattro (BPy_PropertyRNA *self, PyObject *pyname)
static int pyrna_prop_collection_setattro (BPy_PropertyRNA *self, PyObject *pyname, PyObject *value)
static PyObject * pyrna_prop_collection_idprop_add (BPy_PropertyRNA *self)
static PyObject * pyrna_prop_collection_idprop_remove (BPy_PropertyRNA *self, PyObject *value)
static PyObject * pyrna_prop_collection_idprop_move (BPy_PropertyRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_get_id_data_doc,"The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)")
static PyObject * pyrna_struct_get_id_data (BPy_DummyPointerRNA *self)
 PyDoc_STRVAR (pyrna_struct_get_data_doc,"The data this property is using, *type* :class:`bpy.types.bpy_struct`")
static PyObject * pyrna_struct_get_data (BPy_DummyPointerRNA *self)
 PyDoc_STRVAR (pyrna_struct_get_rna_type_doc,"The property type for introspection")
static PyObject * pyrna_struct_get_rna_type (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_prop_collection_keys_doc,".. method:: keys()\n""\n"" Return the identifiers of collection members\n"" (matching pythons dict.keys() functionality).\n""\n"" :return: the identifiers for each member of this collection.\n"" :rtype: list of stings\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 pythons dict.items() functionality).\n""\n"" :return: (key, value) pairs for each member of this collection.\n"" :rtype: list of tuples\n")
static PyObject * pyrna_prop_collection_items (BPy_PropertyRNA *self)
 PyDoc_STRVAR (pyrna_prop_collection_values_doc,".. method:: values()\n""\n"" Return the values of collection\n"" (matching pythons dict.values() functionality).\n""\n"" :return: the members of this collection.\n"" :rtype: list\n")
 PyDoc_STRVAR (pyrna_struct_get_doc,".. method:: get(key, default=None)\n""\n"" Returns the value of the custom property assigned to key or default\n"" when not found (matches pythons dictionary function of the same name).\n""\n"" :arg key: The key associated with the custom property.\n"" :type key: string\n"" :arg default: Optional argument for the value to return if\n"" *key* is not found.\n"" :type default: Undefined\n""\n"BPY_DOC_ID_PROP_TYPE_NOTE)
static PyObject * pyrna_struct_get (BPy_StructRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_struct_as_pointer_doc,".. method:: as_pointer()\n""\n"" Returns the memory address which holds a pointer to blenders 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 pythons dictionary function of the same name).\n""\n"" :arg key: The identifier for the collection member.\n"" :type key: string\n"" :arg default: Optional argument for the value to return if\n"" *key* is not found.\n"" :type default: Undefined\n")
static PyObject * pyrna_prop_collection_get (BPy_PropertyRNA *self, PyObject *args)
 PyDoc_STRVAR (pyrna_prop_collection_find_doc,".. method:: find(key)\n""\n"" Returns the index of a key in a collection or -1 when not found\n"" (matches pythons string find function of the same name).\n""\n"" :arg key: The identifier for the collection member.\n"" :type key: string\n"" :return: index of the key.\n"" :rtype: int\n")
static PyObject * pyrna_prop_collection_find (BPy_PropertyRNA *self, PyObject *key_ob)
static void foreach_attr_type (BPy_PropertyRNA *self, const char *attr, RawPropertyType *raw_type, int *attr_tot, int *attr_signed)
static int foreach_parse_args (BPy_PropertyRNA *self, PyObject *args, const char **attr, PyObject **seq, int *tot, int *size, RawPropertyType *raw_type, int *attr_tot, int *attr_signed)
static int 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""\n"" .. code-block:: python\n""\n"" collection.foreach_get(someseq, attr)\n""\n"" # Python equivalent\n"" for i in range(len(seq)): someseq[i] = getattr(collection, attr)\n""\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""\n"" .. code-block:: python\n""\n"" collection.foreach_set(seq, attr)\n""\n"" # Python equivalent\n"" for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n""\n")
static PyObject * pyrna_prop_collection_foreach_set (BPy_PropertyRNA *self, PyObject *args)
static PyObject * pyrna_prop_array_iter (BPy_PropertyArrayRNA *self)
static PyObject * pyrna_prop_collection_iter (BPy_PropertyRNA *self)
static PyObject * pyrna_struct_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
static PyObject * pyrna_prop_new (PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds))
static PyObject * pyrna_param_to_py (PointerRNA *ptr, PropertyRNA *prop, void *data)
static PyObject * small_dict_get_item_string (PyObject *dict, const char *key_lookup)
static PyObject * pyrna_func_call (BPy_FunctionRNA *self, PyObject *args, PyObject *kw)
static void pyrna_prop_collection_iter_dealloc (BPy_PropertyCollectionIterRNA *self)
static PyObject * pyrna_prop_collection_iter_next (BPy_PropertyCollectionIterRNA *self)
PyObject * pyrna_prop_collection_iter_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop)
static void pyrna_subtype_set_rna (PyObject *newclass, StructRNA *srna)
static PyObject * pyrna_srna_Subtype (StructRNA *srna)
static PyObject * pyrna_srna_PyBase (StructRNA *srna)
static PyObject * pyrna_srna_ExternalType (StructRNA *srna)
static StructRNAsrna_from_ptr (PointerRNA *ptr)
PyObject * pyrna_struct_CreatePyObject (PointerRNA *ptr)
PyObject * pyrna_prop_CreatePyObject (PointerRNA *ptr, PropertyRNA *prop)
void BPY_rna_init (void)
PyObject * BPY_rna_module (void)
void BPY_update_rna_module (void)
static PyObject * pyrna_basetype_getattro (BPy_BaseTypeRNA *self, PyObject *pyname)
static PyObject * pyrna_basetype_dir (BPy_BaseTypeRNA *self)
static PyObject * pyrna_register_class (PyObject *self, PyObject *py_class)
static PyObject * pyrna_unregister_class (PyObject *self, PyObject *py_class)
PyObject * BPY_rna_types (void)
StructRNApyrna_struct_as_srna (PyObject *self, int parent, const char *error_prefix)
StructRNAsrna_from_self (PyObject *self, const char *error_prefix)
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, PyObject *py_class)
static int rna_function_arg_count (FunctionRNA *func)
static int bpy_class_validate (PointerRNA *dummyptr, void *py_data, int *have_function)
static int bpy_class_call (bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
static void bpy_class_free (void *pyob_ptr)
void pyrna_alloc_types (void)
void pyrna_free_types (void)
 PyDoc_STRVAR (pyrna_register_class_doc,".. method:: register_class(cls)\n""\n"" Register a subclass of a blender type in (:class:`bpy.types.Panel`,\n"" :class:`bpy.types.Menu`, :class:`bpy.types.Header`, :class:`bpy.types.Operator`,\n"" :class:`bpy.types.KeyingSetInfo`, :class:`bpy.types.RenderEngine`).\n""\n"" If the class has a *register* class method it will be called\n"" before registration.\n""\n"" .. note::\n""\n"" :exc:`ValueError` exception is raised if the class is not a\n"" subclass of a registerable blender class.\n""\n")
static PyObject * pyrna_register_class (PyObject *UNUSED(self), PyObject *py_class)
static int pyrna_srna_contains_pointer_prop_srna (StructRNA *srna_props, StructRNA *srna, const char **prop_identifier)
 PyDoc_STRVAR (pyrna_unregister_class_doc,".. method:: unregister_class(cls)\n""\n"" Unload the python class from blender.\n""\n"" If the class has an *unregister* class method it will be called\n"" before unregistering.\n")
static PyObject * pyrna_unregister_class (PyObject *UNUSED(self), PyObject *py_class)

Variables

static short rna_disallow_writes = FALSE
static int mathutils_rna_array_cb_index = -1
static Mathutils_Callback mathutils_rna_array_cb
static int 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 struct PyMethodDef pyrna_struct_methods []
static struct PyMethodDef pyrna_prop_methods []
static struct PyMethodDef pyrna_prop_array_methods []
static struct PyMethodDef pyrna_prop_collection_methods []
static struct PyMethodDef pyrna_prop_collection_idprop_methods []
PyTypeObject pyrna_struct_meta_idprop_Type
PyTypeObject pyrna_struct_Type
PyTypeObject pyrna_prop_Type
PyTypeObject pyrna_prop_array_Type
PyTypeObject pyrna_prop_collection_Type
static PyTypeObject pyrna_prop_collection_idprop_Type
PyTypeObject pyrna_func_Type
PyTypeObject pyrna_prop_collection_iter_Type
static PyObject * bpy_types_dict = NULL
static PointerRNArna_module_ptr = NULL
static struct PyMethodDef pyrna_basetype_methods []
static PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE
PyMethodDef meth_bpy_register_class = {"register_class", pyrna_register_class, METH_O, pyrna_register_class_doc}
PyMethodDef meth_bpy_unregister_class

Detailed Description

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

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

Definition in file bpy_rna.c.


Define Documentation

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

Definition at line 91 of file bpy_rna.c.

#define BPY_REPLACEMENT_STRING (   rna_attr,
  py_attr 
)
Value:
if (strcmp(identifier, rna_attr) == 0) {                          \
                item = PyObject_GetAttrString(py_class, py_attr);              \
                if (item && item != Py_None) {                                \
                    if (pyrna_py_to_prop(dummyptr, prop, NULL,                \
                                         item, "validating class:") != 0)     \
                    {                                                         \
                        Py_DECREF(item);                                      \
                        return -1;                                            \
                    }                                                         \
                }                                                             \
                Py_XDECREF(item);                                             \
            }                                                                 \

Referenced by bpy_class_validate().

#define MATHUTILS_CB_SUBTYPE_COLOR   3

Definition at line 381 of file bpy_rna.c.

Referenced by pyrna_math_object_from_array().

#define MATHUTILS_CB_SUBTYPE_EUL   0
#define MATHUTILS_CB_SUBTYPE_QUAT   2

Definition at line 380 of file bpy_rna.c.

Referenced by pyrna_math_object_from_array().

#define MATHUTILS_CB_SUBTYPE_VEC   1

Definition at line 379 of file bpy_rna.c.

Referenced by pyrna_math_object_from_array().

#define PROP_ALL_VECTOR_SUBTYPES
Value:

Definition at line 593 of file bpy_rna.c.

Referenced by pyrna_math_object_from_array(), and pyrna_param_to_py().

#define PYRNA_PROP_COLLECTION_ABS_INDEX (   ret_err)
Value:
if (keynum < 0) {                                                         \
        keynum_abs += RNA_property_collection_length(&self->ptr, self->prop); \
        if (keynum_abs < 0) {                                                 \
            PyErr_Format(PyExc_IndexError,                                    \
                         "bpy_prop_collection[%d]: out of range.", keynum);   \
            return ret_err;                                                   \
        }                                                                     \
    }                                                                         \

Definition at line 2022 of file bpy_rna.c.

Referenced by pyrna_prop_collection_ass_subscript_int(), and pyrna_prop_collection_subscript_int().

#define USE_MATHUTILS

Definition at line 85 of file bpy_rna.c.

#define USE_PEDANTIC_WRITE

Definition at line 84 of file bpy_rna.c.

#define USE_STRING_COERCE

Definition at line 86 of file bpy_rna.c.


Function Documentation

static int bpy_class_call ( bContext C,
PointerRNA ptr,
FunctionRNA func,
ParameterList parms 
) [static]
static void bpy_class_free ( void *  pyob_ptr) [static]

Definition at line 7042 of file bpy_rna.c.

References bpy_intern_str_bl_rna, G, G_DEBUG, and PyC_ObSpit().

Referenced by pyrna_free_types(), and pyrna_register_class().

static int bpy_class_validate ( PointerRNA dummyptr,
void *  py_data,
int *  have_function 
) [static]
void BPY_id_release ( struct ID id)

Definition at line 293 of file bpy_rna.c.

Referenced by free_libblock().

void BPY_rna_init ( void  )

Definition at line 6175 of file bpy_rna.c.

References Mathutils_RegisterCallback().

Referenced by BPy_init_modules().

PyObject* BPY_rna_module ( void  )
PyObject* BPY_rna_types ( void  )
void BPY_update_rna_module ( void  )

Definition at line 6233 of file bpy_rna.c.

References PointerRNA::data, G, and RNA_main_pointer_create().

Referenced by BPY_driver_exec(), and BPY_modules_update().

static int deferred_register_prop ( StructRNA srna,
PyObject *  key,
PyObject *  item 
) [static]
static void foreach_attr_type ( BPy_PropertyRNA self,
const char *  attr,
RawPropertyType raw_type,
int *  attr_tot,
int *  attr_signed 
) [static]
static int foreach_compat_buffer ( RawPropertyType  raw_type,
int  attr_signed,
const char *  format 
) [static]

Definition at line 4244 of file bpy_rna.c.

References PROP_RAW_CHAR, PROP_RAW_DOUBLE, PROP_RAW_FLOAT, PROP_RAW_INT, PROP_RAW_SHORT, and PROP_RAW_UNSET.

Referenced by foreach_getset().

static PyObject* foreach_getset ( BPy_PropertyRNA self,
PyObject *  args,
int  set 
) [static]
static int foreach_parse_args ( BPy_PropertyRNA self,
PyObject *  args,
const char **  attr,
PyObject **  seq,
int *  tot,
int *  size,
RawPropertyType raw_type,
int *  attr_tot,
int *  attr_signed 
) [static]
static int mathutils_rna_generic_check ( BaseMathObject bmo) [static]

Definition at line 383 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT.

static int mathutils_rna_matrix_get ( BaseMathObject bmo,
int   UNUSEDsubtype 
) [static]

Definition at line 522 of file bpy_rna.c.

References NULL, PYRNA_PROP_CHECK_INT, and RNA_property_float_get_array().

static int mathutils_rna_matrix_set ( BaseMathObject bmo,
int   UNUSEDsubtype 
) [static]
static int mathutils_rna_vector_get ( BaseMathObject bmo,
int  subtype 
) [static]
static int mathutils_rna_vector_get_index ( BaseMathObject bmo,
int   UNUSEDsubtype,
int  index 
) [static]

Definition at line 465 of file bpy_rna.c.

References NULL, PYRNA_PROP_CHECK_INT, and RNA_property_float_get_index().

static int mathutils_rna_vector_set ( BaseMathObject bmo,
int  subtype 
) [static]
static int mathutils_rna_vector_set_index ( BaseMathObject bmo,
int   UNUSEDsubtype,
int  index 
) [static]
static int prop_subscript_ass_array_int ( BPy_PropertyArrayRNA self,
Py_ssize_t  keynum,
PyObject *  value 
) [static]
static int prop_subscript_ass_array_slice ( PointerRNA ptr,
PropertyRNA prop,
int  start,
int  stop,
int  length,
PyObject *  value_orig 
) [static]
PyDoc_STRVAR ( pyrna_struct_keys_doc  ,
".. method:: keys()\n""\n"" Returns the keys of this objects custom properties (matches pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property keys.\n"" :rtype: list of strings\n""\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)
PyDoc_STRVAR ( pyrna_struct_items_doc  ,
".. method:: items()\n""\n"" Returns the items of this objects custom properties (matches pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property  key,
value pairs.\n"":rtype:list of  key,
value tuples\n""\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)
PyDoc_STRVAR ( pyrna_struct_values_doc  ,
".. method:: values()\n""\n"" Returns the values of this objects custom properties (matches pythons\n"" dictionary function of the same name).\n""\n"" :return: custom property values.\n"" :rtype: list\n""\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)
PyDoc_STRVAR ( pyrna_struct_is_property_set_doc  ,
".. method:: is_property_set(property)\n""\n"" Check if a property is  set,
use for testing operator properties.\n""\n"":return:True when the property has been set.\n"":rtype:boolean\n"   
)
PyDoc_STRVAR ( pyrna_struct_is_property_hidden_doc  ,
".. method:: is_property_hidden(property)\n""\n"" Check if a property is hidden.\n""\n"" :return: True when the property is hidden.\n"" :rtype: boolean\n"   
)
PyDoc_STRVAR ( pyrna_struct_path_resolve_doc  ,
".. method:: path_resolve(path, coerce=True)\n""\n"" Returns the property from the  path,
raise an exception when not found.\n""\n"":arg path:path which this property resolves.\n"":type path:string\n"":arg coerce:optional  argument,
when  True,
the property will be converted\n""into its python representation.\n"":type coerce:boolean\n"   
)
PyDoc_STRVAR ( pyrna_struct_path_from_id_doc  ,
".. method:: path_from_id(property=\"\")\n""\n"" Returns the data path from the ID to this object (string).\n""\n"" :arg property: Optional property name which can be used if the path is\n"" to a property of this object.\n"" :type property: string\n"" :return: The path from :class:`bpy.types.bpy_struct.id_data`\n"" to this struct and property (when given).\n"" :rtype: str\n"   
)
PyDoc_STRVAR ( pyrna_register_class_doc  ,
".. method:: register_class(cls)\n""\n"" Register a subclass of a blender type in (:class:`bpy.types.Panel`,\n"" :class:`bpy.types.Menu`, :class:`bpy.types.Header`, :class:`bpy.types.Operator`,\n"" :class:`bpy.types.KeyingSetInfo`, :class:`bpy.types.RenderEngine`).\n""\n"" If the class has a *register* class method it will be called\n"" before registration.\n""\n"" .. note::\n""\n"" :exc:`ValueError` exception is raised if the class is not a\n"" subclass of a registerable blender class.\n""\n"   
)
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 ( pyrna_unregister_class_doc  ,
".. method:: unregister_class(cls)\n""\n"" Unload the python class from blender.\n""\n"" If the class has an *unregister* class method it will be called\n"" before unregistering.\n"   
)
PyDoc_STRVAR ( pyrna_struct_type_recast_doc  ,
".. method:: type_recast()\n""\n"" Return a new  instance,
this is needed because types\n""such as textures can be changed at runtime.\n""\n"":return:a new instance of this object with the type initialized again.\n"":rtype:subclass of:class:`bpy.types.bpy_struct`\n"   
)
PyDoc_STRVAR ( pyrna_struct_get_id_data_doc  ,
"The :class:`bpy.types.ID` object this datablock is from or  None,
(not available for all data types)"   
)
PyDoc_STRVAR ( pyrna_struct_get_data_doc  ,
"The data this property is  using,
*type *:class:`bpy.types.bpy_struct`"   
)
PyDoc_STRVAR ( pyrna_struct_get_rna_type_doc  ,
"The property type for introspection"   
)
PyDoc_STRVAR ( pyrna_prop_collection_keys_doc  ,
".. method:: keys()\n""\n"" Return the identifiers of collection members\n"" (matching pythons dict.keys() functionality).\n""\n"" :return: the identifiers for each member of this collection.\n"" :rtype: list of stings\n"   
)
PyDoc_STRVAR ( pyrna_prop_collection_items_doc  ,
".. method:: items()\n""\n"" Return the identifiers of collection members\n"" (matching pythons dict.items() functionality).\n""\n"" :return: (key, value) pairs for each member of this collection.\n"" :rtype: list of tuples\n"   
)
PyDoc_STRVAR ( pyrna_prop_collection_values_doc  ,
".. method:: values()\n""\n"" Return the values of collection\n"" (matching pythons dict.values() functionality).\n""\n"" :return: the members of this collection.\n"" :rtype: list\n"   
)
PyDoc_STRVAR ( pyrna_struct_get_doc  ,
".. method:: get(key, default=None)\n""\n"" Returns the value of the custom property assigned to key or default\n"" when not found (matches pythons dictionary function of the same name).\n""\n"" :arg key: The key associated with the custom property.\n"" :type key: string\n"" :arg default: Optional argument for the value to return if\n"" *key* is not found.\n"" :type default: Undefined\n""\n"  BPY_DOC_ID_PROP_TYPE_NOTE 
)
PyDoc_STRVAR ( pyrna_struct_as_pointer_doc  ,
".. method:: as_pointer()\n""\n"" Returns the memory address which holds a pointer to blenders 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 ( 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 pythons dictionary function of the same name).\n""\n"" :arg key: The identifier for the collection member.\n"" :type key: string\n"" :arg default: Optional argument for the value to return if\n"" *key* is not found.\n"" :type default: Undefined\n"   
)
PyDoc_STRVAR ( 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 pythons string find function of the same name).\n""\n"" :arg key: The identifier for the collection member.\n"" :type key: string\n"" :return: index of the key.\n"" :rtype: int\n"   
)
PyDoc_STRVAR ( pyrna_prop_collection_foreach_get_doc  )
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""\n"" .. code-block:: python\n""\n"" collection.foreach_set(seq, attr)\n""\n"" # Python equivalent\n"" for i in range(len(seq)): setattr(collection[i], attr, seq[i])\n""\n"   
)
void pyrna_alloc_types ( void  )
static PyObject * pyrna_basetype_dir ( BPy_BaseTypeRNA *  self) [static]

Definition at line 6301 of file bpy_rna.c.

References pyrna_prop_collection_keys().

static PyObject* pyrna_basetype_getattro ( BPy_BaseTypeRNA *  self,
PyObject *  pyname 
) [static]

Definition at line 6260 of file bpy_rna.c.

References NULL, pyrna_struct_Subtype(), and RNA_property_collection_lookup_string().

Referenced by BPY_rna_types().

int pyrna_deferred_register_class ( StructRNA srna,
PyObject *  py_class 
)
static int pyrna_deferred_register_class_recursive ( StructRNA srna,
PyTypeObject *  py_class 
) [static]

Definition at line 6526 of file bpy_rna.c.

References i, len(), and pyrna_deferred_register_props().

Referenced by pyrna_deferred_register_class().

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

Definition at line 6491 of file bpy_rna.c.

References bpy_intern_str_order, and deferred_register_prop().

Referenced by pyrna_deferred_register_class_recursive().

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

Definition at line 3281 of file bpy_rna.c.

Referenced by pyrna_prop_dir(), and pyrna_struct_dir().

static void pyrna_dir_members_rna ( PyObject *  list,
PointerRNA ptr 
) [static]
static const char* pyrna_enum_as_string ( PointerRNA ptr,
PropertyRNA prop 
) [static]
PyObject* pyrna_enum_bitfield_to_py ( EnumPropertyItem items,
int  value 
)

Definition at line 1231 of file bpy_rna.c.

References NULL, RNA_enum_bitflag_identifiers(), and RNA_ENUM_BITFLAG_SIZE.

Referenced by pyop_call().

static PyObject* pyrna_enum_to_py ( PointerRNA ptr,
PropertyRNA prop,
int  val 
) [static]
int pyrna_enum_value_from_id ( EnumPropertyItem item,
const char *  identifier,
int *  value,
const char *  error_prefix 
)
void pyrna_free_types ( void  )
static PyObject* pyrna_func_call ( BPy_FunctionRNA self,
PyObject *  args,
PyObject *  kw 
) [static]
static PyObject* pyrna_func_repr ( BPy_FunctionRNA self) [static]

Definition at line 993 of file bpy_rna.c.

References RNA_function_identifier(), and RNA_struct_identifier().

static PyObject* pyrna_func_to_py ( PointerRNA ptr,
FunctionRNA func 
) [static]
static int pyrna_is_deferred_prop ( const PyObject *  value) [static]

Definition at line 3522 of file bpy_rna.c.

Referenced by deferred_register_prop(), and pyrna_struct_meta_idprop_setattro().

PyObject* pyrna_math_object_from_array ( PointerRNA ptr,
PropertyRNA prop 
)
static PyObject* pyrna_param_to_py ( PointerRNA ptr,
PropertyRNA prop,
void *  data 
) [static]
static int pyrna_prop_array_ass_subscript ( BPy_PropertyArrayRNA self,
PyObject *  key,
PyObject *  value 
) [static]
static int pyrna_prop_array_bool ( BPy_PropertyRNA self) [static]

Definition at line 1997 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT, and RNA_property_array_length().

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

Definition at line 2817 of file bpy_rna.c.

References pyrna_array_contains_py().

static void pyrna_prop_array_dealloc ( BPy_PropertyRNA self) [static]

Definition at line 1098 of file bpy_rna.c.

References NULL.

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

Definition at line 3713 of file bpy_rna.c.

static PyObject* pyrna_prop_array_iter ( BPy_PropertyArrayRNA self) [static]
static Py_ssize_t pyrna_prop_array_length ( BPy_PropertyArrayRNA self) [static]
static PyObject* pyrna_prop_array_subscript ( BPy_PropertyArrayRNA self,
PyObject *  key 
) [static]
static PyObject* pyrna_prop_array_subscript_int ( BPy_PropertyArrayRNA self,
int  keynum 
) [static]
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]
static PyObject* pyrna_prop_array_to_py_index ( BPy_PropertyArrayRNA self,
int  index 
) [static]
static int pyrna_prop_collection_ass_subscript ( BPy_PropertyRNA self,
PyObject *  key,
PyObject *  value 
) [static]
static int pyrna_prop_collection_ass_subscript_int ( BPy_PropertyRNA self,
Py_ssize_t  keynum,
PyObject *  value 
) [static]
static int pyrna_prop_collection_bool ( BPy_PropertyRNA self) [static]
static int pyrna_prop_collection_contains ( BPy_PropertyRNA self,
PyObject *  key 
) [static]
static PyObject* pyrna_prop_collection_find ( BPy_PropertyRNA self,
PyObject *  key_ob 
) [static]
static PyObject* pyrna_prop_collection_foreach_get ( BPy_PropertyRNA self,
PyObject *  args 
) [static]

Definition at line 4427 of file bpy_rna.c.

References foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

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

Definition at line 4447 of file bpy_rna.c.

References foreach_getset(), and PYRNA_PROP_CHECK_OBJ.

static PyObject* pyrna_prop_collection_get ( BPy_PropertyRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_prop_collection_getattro ( BPy_PropertyRNA self,
PyObject *  pyname 
) [static]
static PyObject* pyrna_prop_collection_idprop_add ( BPy_PropertyRNA self) [static]
static PyObject* pyrna_prop_collection_idprop_move ( BPy_PropertyRNA self,
PyObject *  args 
) [static]

Definition at line 3849 of file bpy_rna.c.

References NULL, and RNA_property_collection_move().

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

Definition at line 3832 of file bpy_rna.c.

References NULL, and RNA_property_collection_remove().

static PyObject* pyrna_prop_collection_items ( BPy_PropertyRNA self) [static]
static PyObject * pyrna_prop_collection_iter ( BPy_PropertyRNA self) [static]

Definition at line 5834 of file bpy_rna.c.

References pyrna_prop_collection_iter_CreatePyObject().

PyObject* pyrna_prop_collection_iter_CreatePyObject ( PointerRNA ptr,
PropertyRNA prop 
)

Definition at line 5821 of file bpy_rna.c.

References NULL, and RNA_property_collection_begin().

Referenced by pyrna_prop_collection_iter().

static void pyrna_prop_collection_iter_dealloc ( BPy_PropertyCollectionIterRNA self) [static]

Definition at line 5866 of file bpy_rna.c.

References RNA_property_collection_end().

static PyObject * pyrna_prop_collection_iter_next ( BPy_PropertyCollectionIterRNA self) [static]

Definition at line 5839 of file bpy_rna.c.

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

static PyObject* pyrna_prop_collection_keys ( BPy_PropertyRNA self) [static]

Definition at line 3928 of file bpy_rna.c.

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

Referenced by pyrna_basetype_dir().

static Py_ssize_t pyrna_prop_collection_length ( BPy_PropertyRNA self) [static]

Definition at line 1988 of file bpy_rna.c.

References PYRNA_PROP_CHECK_INT, and RNA_property_collection_length().

Referenced by pyrna_prop_str().

static int pyrna_prop_collection_setattro ( BPy_PropertyRNA self,
PyObject *  pyname,
PyObject *  value 
) [static]
static PyObject* pyrna_prop_collection_subscript ( BPy_PropertyRNA self,
PyObject *  key 
) [static]
static PyObject* pyrna_prop_collection_subscript_int ( BPy_PropertyRNA self,
Py_ssize_t  keynum 
) [static]
static PyObject* pyrna_prop_collection_subscript_slice ( BPy_PropertyRNA self,
Py_ssize_t  start,
Py_ssize_t  stop 
) [static]
static PyObject* pyrna_prop_collection_subscript_str ( BPy_PropertyRNA self,
const char *  keyname 
) [static]
static PyObject* pyrna_prop_collection_subscript_str_lib_pair ( BPy_PropertyRNA self,
PyObject *  key,
const char *  err_prefix,
const short  err_not_found 
) [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 int pyrna_prop_collection_type_check ( BPy_PropertyRNA self,
PyObject *  value 
) [static]
static PyObject * pyrna_prop_collection_values ( BPy_PropertyRNA self) [static]

Definition at line 4008 of file bpy_rna.c.

References pyrna_prop_collection_subscript_slice().

static int pyrna_prop_compare ( BPy_PropertyRNA a,
BPy_PropertyRNA b 
) [static]

Definition at line 763 of file bpy_rna.c.

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

Referenced by pyrna_prop_richcmp().

PyObject* pyrna_prop_CreatePyObject ( PointerRNA ptr,
PropertyRNA prop 
)
static void pyrna_prop_dealloc ( BPy_PropertyRNA self) [static]

Definition at line 1087 of file bpy_rna.c.

References NULL.

static PyObject* pyrna_prop_dir ( BPy_PropertyRNA self) [static]
static long pyrna_prop_hash ( BPy_PropertyRNA self) [static]

Definition at line 1008 of file bpy_rna.c.

References NULL.

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

Definition at line 4606 of file bpy_rna.c.

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

static PyObject* pyrna_prop_path_from_id ( BPy_PropertyRNA self) [static]
static PyObject* pyrna_prop_repr ( BPy_PropertyRNA self) [static]
static PyObject* pyrna_prop_richcmp ( PyObject *  a,
PyObject *  b,
int  op 
) [static]

Definition at line 799 of file bpy_rna.c.

References BPy_PropertyRNA_Check, NULL, and pyrna_prop_compare().

static PyObject* pyrna_prop_str ( BPy_PropertyRNA self) [static]
static int pyrna_prop_to_enum_bitfield ( PointerRNA ptr,
PropertyRNA prop,
PyObject *  value,
int *  r_value,
const char *  error_prefix 
) [static]
PyObject* pyrna_prop_to_py ( PointerRNA ptr,
PropertyRNA prop 
)
int pyrna_prop_validity_check ( BPy_PropertyRNA self)

Definition at line 109 of file bpy_rna.c.

References RNA_property_identifier().

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

Definition at line 1480 of file bpy_rna.c.

References BLI_addtail(), BPy_GetContext(), BPy_StructRNA_Check, data, PointerRNA::data, ELEM3, FALSE, i, PointerRNA::id, IFACE_, link(), MEM_callocN(), 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_OUTPUT, PROP_POINTER, PROP_RNAPTR, PROP_STRING, PROP_TRANSLATE, BPy_StructRNA::ptr, BPy_PropertyRNA::ptr, CollectionPointerLink::ptr, PyC_Err_Format_Prefix(), PyC_ExceptionBuffer(), PyC_UnicodeAsByte(), pyrna_prop_collection_Type, pyrna_prop_to_enum_bitfield(), pyrna_py_to_array(), pyrna_pydict_to_props(), pyrna_string_to_enum(), pyrna_struct_CreatePyObject(), RNA_AnyType, RNA_Operator, RNA_OperatorProperties, RNA_pointer_create(), RNA_property_array_check(), RNA_property_boolean_set(), RNA_property_collection_add(), RNA_property_collection_type_get(), RNA_property_enum_set(), RNA_property_flag(), RNA_property_float_clamp(), RNA_property_float_set(), RNA_property_identifier(), RNA_property_int_clamp(), RNA_property_int_set(), RNA_property_pointer_get(), RNA_property_pointer_set(), RNA_property_pointer_type(), RNA_property_string_set(), RNA_property_subtype(), RNA_property_type(), RNA_property_update(), RNA_property_update_check(), RNA_struct_identifier(), RNA_struct_is_a(), STRINGIFY, TRUE, PointerRNA::type, and simple_enum_gen::val.

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

static int pyrna_py_to_prop_array_index ( BPy_PropertyArrayRNA self,
int  index,
PyObject *  value 
) [static]
int pyrna_pydict_to_props ( PointerRNA ptr,
PyObject *  kw,
int  all_args,
const char *  error_prefix 
)
static PyObject* pyrna_register_class ( PyObject *  self,
PyObject *  py_class 
) [static]
static PyObject* pyrna_register_class ( PyObject *  UNUSEDself,
PyObject *  py_class 
) [static]
static short pyrna_rotation_euler_order_get ( PointerRNA ptr,
PropertyRNA **  prop_eul_order,
short  order_fallback 
) [static]
int pyrna_set_to_enum_bitfield ( EnumPropertyItem items,
PyObject *  value,
int *  r_value,
const char *  error_prefix 
)

Definition at line 1159 of file bpy_rna.c.

References hash, NULL, and pyrna_enum_value_from_id().

Referenced by pyrna_prop_to_enum_bitfield().

static int pyrna_srna_contains_pointer_prop_srna ( StructRNA srna_props,
StructRNA srna,
const char **  prop_identifier 
) [static]
static PyObject* pyrna_srna_ExternalType ( StructRNA srna) [static]
static PyObject* pyrna_srna_PyBase ( StructRNA srna) [static]

Definition at line 5914 of file bpy_rna.c.

References NULL, pyrna_srna_Subtype(), and RNA_struct_base().

Referenced by pyrna_srna_ExternalType(), and pyrna_srna_Subtype().

static PyObject * pyrna_srna_Subtype ( StructRNA srna) [static]
static int pyrna_string_to_enum ( PyObject *  item,
PointerRNA ptr,
PropertyRNA prop,
int *  val,
const char *  error_prefix 
) [static]
static PyObject* pyrna_struct_as_pointer ( BPy_StructRNA self) [static]

Definition at line 4069 of file bpy_rna.c.

StructRNA* pyrna_struct_as_srna ( PyObject *  self,
int  parent,
const char *  error_prefix 
)
static int pyrna_struct_ass_subscript ( BPy_StructRNA self,
PyObject *  key,
PyObject *  value 
) [static]
static int pyrna_struct_compare ( BPy_StructRNA a,
BPy_StructRNA b 
) [static]

Definition at line 757 of file bpy_rna.c.

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

Referenced by pyrna_struct_richcmp().

static int pyrna_struct_contains ( BPy_StructRNA self,
PyObject *  value 
) [static]
PyObject* pyrna_struct_CreatePyObject ( PointerRNA ptr)
static void pyrna_struct_dealloc ( BPy_StructRNA self) [static]

Definition at line 1042 of file bpy_rna.c.

References IDP_FreeProperty(), MEM_freeN(), and NULL.

static PyObject* pyrna_struct_dir ( BPy_StructRNA self) [static]
static PyObject* pyrna_struct_get ( BPy_StructRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_struct_get_data ( BPy_DummyPointerRNA self) [static]

Definition at line 3885 of file bpy_rna.c.

References pyrna_struct_CreatePyObject().

static PyObject* pyrna_struct_get_id_data ( BPy_DummyPointerRNA self) [static]

Definition at line 3870 of file bpy_rna.c.

References pyrna_struct_CreatePyObject(), and RNA_id_pointer_create().

static PyObject* pyrna_struct_get_rna_type ( BPy_PropertyRNA self) [static]

Definition at line 3893 of file bpy_rna.c.

References pyrna_struct_Subtype(), RNA_pointer_create(), and RNA_Property.

static PyObject* pyrna_struct_getattro ( BPy_StructRNA self,
PyObject *  pyname 
) [static]
static long pyrna_struct_hash ( BPy_StructRNA self) [static]

Definition at line 1002 of file bpy_rna.c.

static PyObject* pyrna_struct_is_property_hidden ( BPy_StructRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_struct_is_property_set ( BPy_StructRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_struct_items ( BPy_PropertyRNA self) [static]
static PyObject* pyrna_struct_keys ( BPy_PropertyRNA self) [static]

Definition at line 2986 of file bpy_rna.c.

References BPy_Wrap_GetKeys(), NULL, RNA_struct_idprops(), and RNA_struct_idprops_check().

static int pyrna_struct_meta_idprop_setattro ( PyObject *  cls,
PyObject *  attr,
PyObject *  value 
) [static]
static PyObject* pyrna_struct_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  UNUSEDkwds 
) [static]

Definition at line 4561 of file bpy_rna.c.

References NULL, BPy_StructRNA::ptr, and pyrna_struct_Type.

static PyObject* pyrna_struct_path_from_id ( BPy_StructRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_struct_path_resolve ( BPy_StructRNA self,
PyObject *  args 
) [static]
static PyObject* pyrna_struct_repr ( BPy_StructRNA self) [static]
static PyObject* pyrna_struct_richcmp ( PyObject *  a,
PyObject *  b,
int  op 
) [static]

Definition at line 770 of file bpy_rna.c.

References BPy_StructRNA_Check, NULL, and pyrna_struct_compare().

static int pyrna_struct_setattro ( BPy_StructRNA self,
PyObject *  pyname,
PyObject *  value 
) [static]
static PyObject* pyrna_struct_str ( BPy_StructRNA self) [static]
static PyObject* pyrna_struct_subscript ( BPy_StructRNA self,
PyObject *  key 
) [static]
static PyObject * pyrna_struct_Subtype ( PointerRNA ptr) [static]
static PyObject* pyrna_struct_type_recast ( BPy_StructRNA self) [static]
int pyrna_struct_validity_check ( BPy_StructRNA pysrna)

Definition at line 98 of file bpy_rna.c.

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

static PyObject* pyrna_struct_values ( BPy_PropertyRNA self) [static]
static void pyrna_subtype_set_rna ( PyObject *  newclass,
StructRNA srna 
) [static]
static PyObject* pyrna_unregister_class ( PyObject *  UNUSEDself,
PyObject *  py_class 
) [static]
static PyObject* pyrna_unregister_class ( PyObject *  self,
PyObject *  py_class 
) [static]
int pyrna_write_check ( void  )

Definition at line 342 of file bpy_rna.c.

References rna_disallow_writes.

Referenced by bpy_prop_update_cb(), pyop_call(), and pyrna_struct_meta_idprop_setattro().

void pyrna_write_set ( int  val)

Definition at line 347 of file bpy_rna.c.

References simple_enum_gen::val.

Referenced by bpy_prop_update_cb().

static int rna_function_arg_count ( FunctionRNA func) [static]
static int rna_id_write_error ( PointerRNA ptr,
PyObject *  key 
) [static]
static PyObject* small_dict_get_item_string ( PyObject *  dict,
const char *  key_lookup 
) [static]

Definition at line 4810 of file bpy_rna.c.

References NULL.

Referenced by pyrna_func_call().

static StructRNA* srna_from_ptr ( PointerRNA ptr) [static]

Definition at line 6060 of file bpy_rna.c.

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

Referenced by pyrna_free_types(), and pyrna_struct_Subtype().

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

Variable Documentation

PyObject* bpy_types_dict = NULL [static]

Definition at line 5939 of file bpy_rna.c.

int mathutils_rna_array_cb_index = -1 [static]

Definition at line 375 of file bpy_rna.c.

Initial value:

Definition at line 566 of file bpy_rna.c.

int mathutils_rna_matrix_cb_index = -1 [static]

Definition at line 520 of file bpy_rna.c.

PyMethodDef meth_bpy_register_class = {"register_class", pyrna_register_class, METH_O, pyrna_register_class_doc}

Definition at line 7150 of file bpy_rna.c.

Referenced by BPy_init_modules().

Initial value:
 {
    "unregister_class", pyrna_unregister_class, METH_O, pyrna_unregister_class_doc
}

Definition at line 7277 of file bpy_rna.c.

Referenced by BPy_init_modules().

struct PyMethodDef pyrna_basetype_methods[] [static]
Initial value:
 {
    {"__dir__", (PyCFunction)pyrna_basetype_dir, METH_NOARGS, ""},
    {NULL, NULL, 0, NULL}
}

Definition at line 6296 of file bpy_rna.c.

Referenced by BPY_rna_types().

PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE [static]

Definition at line 6321 of file bpy_rna.c.

PyTypeObject pyrna_func_Type

Definition at line 5634 of file bpy_rna.c.

Referenced by pyrna_func_to_py().

PyMappingMethods pyrna_prop_array_as_mapping [static]
Initial value:

Definition at line 2779 of file bpy_rna.c.

PyNumberMethods pyrna_prop_array_as_number [static]
Initial value:

Definition at line 2792 of file bpy_rna.c.

PySequenceMethods pyrna_prop_array_as_sequence [static]
Initial value:
 {
    (lenfunc)pyrna_prop_array_length,       
    NULL,       
    NULL,       
    (ssizeargfunc)pyrna_prop_array_subscript_int,  
    NULL,       
    (ssizeobjargproc)prop_subscript_ass_array_int,      
    NULL,       
    (objobjproc)pyrna_prop_array_contains,  
    (binaryfunc) NULL, 
    (ssizeargfunc) NULL, 
}

Definition at line 2873 of file bpy_rna.c.

struct PyMethodDef pyrna_prop_array_methods[] [static]
Initial value:
 {
    {NULL, NULL, 0, NULL}
}

Definition at line 4535 of file bpy_rna.c.

PyTypeObject pyrna_prop_array_Type

Definition at line 5381 of file bpy_rna.c.

PyMappingMethods pyrna_prop_collection_as_mapping [static]
Initial value:

Definition at line 2785 of file bpy_rna.c.

PyNumberMethods pyrna_prop_collection_as_number [static]
Initial value:

Definition at line 2804 of file bpy_rna.c.

PySequenceMethods pyrna_prop_collection_as_sequence [static]
Initial value:
 {
    (lenfunc)pyrna_prop_collection_length,      
    NULL,       
    NULL,       
    (ssizeargfunc)pyrna_prop_collection_subscript_int,  
    NULL,       
    (ssizeobjargproc) NULL , 
    NULL,       
    (objobjproc)pyrna_prop_collection_contains, 
    (binaryfunc) NULL, 
    (ssizeargfunc) NULL, 
}

Definition at line 2886 of file bpy_rna.c.

struct PyMethodDef pyrna_prop_collection_idprop_methods[] [static]
Initial value:
 {
    {"add", (PyCFunction)pyrna_prop_collection_idprop_add, METH_NOARGS, NULL},
    {"remove", (PyCFunction)pyrna_prop_collection_idprop_remove, METH_O, NULL},
    {"move", (PyCFunction)pyrna_prop_collection_idprop_move, METH_VARARGS, NULL},
    {NULL, NULL, 0, NULL}
}

Definition at line 4552 of file bpy_rna.c.

PyTypeObject pyrna_prop_collection_idprop_Type [static]

Definition at line 5549 of file bpy_rna.c.

Referenced by pyrna_prop_CreatePyObject().

Definition at line 5730 of file bpy_rna.c.

struct PyMethodDef pyrna_prop_collection_methods[] [static]
Initial value:
 {
    {"foreach_get", (PyCFunction)pyrna_prop_collection_foreach_get, METH_VARARGS, pyrna_prop_collection_foreach_get_doc},
    {"foreach_set", (PyCFunction)pyrna_prop_collection_foreach_set, METH_VARARGS, pyrna_prop_collection_foreach_set_doc},

    {"keys", (PyCFunction)pyrna_prop_collection_keys, METH_NOARGS, pyrna_prop_collection_keys_doc},
    {"items", (PyCFunction)pyrna_prop_collection_items, METH_NOARGS, pyrna_prop_collection_items_doc},
    {"values", (PyCFunction)pyrna_prop_collection_values, METH_NOARGS, pyrna_prop_collection_values_doc},

    {"get", (PyCFunction)pyrna_prop_collection_get, METH_VARARGS, pyrna_prop_collection_get_doc},
    {"find", (PyCFunction)pyrna_prop_collection_find, METH_O, pyrna_prop_collection_find_doc},
    {NULL, NULL, 0, NULL}
}

Definition at line 4539 of file bpy_rna.c.

Definition at line 5464 of file bpy_rna.c.

Referenced by pyrna_prop_CreatePyObject(), and pyrna_py_to_prop().

PyGetSetDef pyrna_prop_getseters[] [static]
Initial value:
 {
    {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL},
    {(char *)"data", (getter)pyrna_struct_get_data, (setter)NULL, (char *)pyrna_struct_get_data_doc, NULL},
    {(char *)"rna_type", (getter)pyrna_struct_get_rna_type, (setter)NULL, (char *)pyrna_struct_get_rna_type_doc, NULL},
    {NULL, NULL, NULL, NULL, NULL} 
}

Definition at line 3906 of file bpy_rna.c.

struct PyMethodDef pyrna_prop_methods[] [static]
Initial value:
 {
    {"path_from_id", (PyCFunction)pyrna_prop_path_from_id, METH_NOARGS, pyrna_prop_path_from_id_doc},
    {"__dir__", (PyCFunction)pyrna_prop_dir, METH_NOARGS, NULL},
    {NULL, NULL, 0, NULL}
}

Definition at line 4529 of file bpy_rna.c.

PyTypeObject pyrna_prop_Type

Definition at line 5297 of file bpy_rna.c.

Referenced by pyrna_prop_CreatePyObject(), and pyrna_prop_new().

PyMappingMethods pyrna_struct_as_mapping [static]
Initial value:
 {
    (lenfunc) NULL, 
    (binaryfunc) pyrna_struct_subscript,    
    (objobjargproc) pyrna_struct_ass_subscript, 
}

Definition at line 2969 of file bpy_rna.c.

PySequenceMethods pyrna_struct_as_sequence [static]
Initial value:
 {
    NULL,       
    NULL,       
    NULL,       
    NULL,        
    NULL,       
    NULL,       
    NULL,       
    (objobjproc)pyrna_struct_contains,  
    (binaryfunc) NULL, 
    (ssizeargfunc) NULL, 
}

Definition at line 2899 of file bpy_rna.c.

PyGetSetDef pyrna_struct_getseters[] [static]
Initial value:
 {
    {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)pyrna_struct_get_id_data_doc, NULL},
    {NULL, NULL, NULL, NULL, NULL} 
}

Definition at line 3913 of file bpy_rna.c.

Definition at line 5126 of file bpy_rna.c.

Referenced by BPy_init_modules().

struct PyMethodDef pyrna_struct_methods[] [static]
Initial value:
 {

    
    {"keys", (PyCFunction)pyrna_struct_keys, METH_NOARGS, pyrna_struct_keys_doc},
    {"values", (PyCFunction)pyrna_struct_values, METH_NOARGS, pyrna_struct_values_doc},
    {"items", (PyCFunction)pyrna_struct_items, METH_NOARGS, pyrna_struct_items_doc},

    {"get", (PyCFunction)pyrna_struct_get, METH_VARARGS, pyrna_struct_get_doc},

    {"as_pointer", (PyCFunction)pyrna_struct_as_pointer, METH_NOARGS, pyrna_struct_as_pointer_doc},

    
    {"keyframe_insert", (PyCFunction)pyrna_struct_keyframe_insert, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_insert_doc},
    {"keyframe_delete", (PyCFunction)pyrna_struct_keyframe_delete, METH_VARARGS|METH_KEYWORDS, pyrna_struct_keyframe_delete_doc},
    {"driver_add", (PyCFunction)pyrna_struct_driver_add, METH_VARARGS, pyrna_struct_driver_add_doc},
    {"driver_remove", (PyCFunction)pyrna_struct_driver_remove, METH_VARARGS, pyrna_struct_driver_remove_doc},

    {"is_property_set", (PyCFunction)pyrna_struct_is_property_set, METH_VARARGS, pyrna_struct_is_property_set_doc},
    {"is_property_hidden", (PyCFunction)pyrna_struct_is_property_hidden, METH_VARARGS, pyrna_struct_is_property_hidden_doc},
    {"path_resolve", (PyCFunction)pyrna_struct_path_resolve, METH_VARARGS, pyrna_struct_path_resolve_doc},
    {"path_from_id", (PyCFunction)pyrna_struct_path_from_id, METH_VARARGS, pyrna_struct_path_from_id_doc},
    {"type_recast", (PyCFunction)pyrna_struct_type_recast, METH_NOARGS, pyrna_struct_type_recast_doc},
    {"__dir__", (PyCFunction)pyrna_struct_dir, METH_NOARGS, NULL},

    
    {"callback_add", (PyCFunction)pyrna_callback_add, METH_VARARGS, NULL},
    {"callback_remove", (PyCFunction)pyrna_callback_remove, METH_VARARGS, NULL},
    {NULL, NULL, 0, NULL}
}

Definition at line 4499 of file bpy_rna.c.

PyTypeObject pyrna_struct_Type

Definition at line 5208 of file bpy_rna.c.

Referenced by pyrna_struct_new().

short rna_disallow_writes = FALSE [static]

Definition at line 313 of file bpy_rna.c.

Referenced by bpy_class_call(), and pyrna_write_check().

PointerRNA* rna_module_ptr = NULL [static]

Definition at line 6219 of file bpy_rna.c.