Blender V2.61 - r43446
|
#include <Python.h>
#include "RNA_types.h"
#include "bpy_props.h"
#include "bpy_rna.h"
#include "bpy_util.h"
#include "BLI_utildefines.h"
#include "BKE_idprop.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "MEM_guardedalloc.h"
#include "../generic/py_capi_utils.h"
Go to the source code of this file.
Defines | |
#define | BPY_DATA_CB_SLOT_SIZE 1 |
#define | BPY_DATA_CB_SLOT_UPDATE 0 |
#define | BPY_PROPDEF_HEAD(_func) |
#define | BPY_PROPDEF_CHECK(_func, _property_flag_items) |
#define | BPY_PROPDEF_SUBTYPE_CHECK(_func, _property_flag_items, _subtype) |
#define | BPY_PROPDEF_NAME_DOC |
#define | BPY_PROPDEF_DESC_DOC |
#define | BPY_PROPDEF_UNIT_DOC |
#define | BPY_PROPDEF_UPDATE_DOC |
#define | ASSIGN_STATIC(_name) pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name) |
Functions | |
static PyObject * | pyrna_struct_as_instance (PointerRNA *ptr) |
static void | printf_func_error (PyObject *py_func) |
static PyObject * | bpy_prop_deferred_return (PyObject *func, PyObject *kw) |
static void | bpy_prop_update_cb (struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop) |
static int | bpy_prop_callback_check (PyObject *py_func, int argcount) |
static int | bpy_prop_callback_assign (struct PropertyRNA *prop, PyObject *update_cb) |
static int | py_long_as_int (PyObject *py_long, int *r_int) |
PyDoc_STRVAR (BPy_BoolProperty_doc,".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new boolean property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"" :type subtype: string\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_BoolProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_BoolVectorProperty_doc,".. function:: BoolVectorProperty(name=\"\", description=\"\", default=(False, False, False), options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector boolean property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of booleans the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"" :type subtype: string\n"" :arg size: Vector dimensions in [1, and "STRINGIFY(PYRNA_STACK_ARRAY)"].\n"" :type size: int\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_BoolVectorProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_IntProperty_doc,".. function:: IntProperty(name=\"\", description=\"\", default=0, min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, step=1, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new int property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"" :type subtype: string\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_IntProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_IntVectorProperty_doc,".. function:: IntVectorProperty(name=\"\", description=\"\", default=(0, 0, 0), min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector int property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of ints the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"" :type subtype: string\n"" :arg size: Vector dimensions in [1, and "STRINGIFY(PYRNA_STACK_ARRAY)"].\n"" :type size: int\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_IntVectorProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_FloatProperty_doc,".. function:: FloatProperty(name=\"\", description=\"\", default=0.0, min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', unit='NONE', update=None)\n""\n"" Returns a new float property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"" :type subtype: string\n"BPY_PROPDEF_UNIT_DOC BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_FloatProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_FloatVectorProperty_doc,".. function:: FloatVectorProperty(name=\"\", description=\"\", default=(0.0, 0.0, 0.0), min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector float property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of floats the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"" :type subtype: string\n"BPY_PROPDEF_UNIT_DOC" :arg size: Vector dimensions in [1, and "STRINGIFY(PYRNA_STACK_ARRAY)"].\n"" :type size: int\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_FloatVectorProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_StringProperty_doc,".. function:: StringProperty(name=\"\", description=\"\", default=\"\", maxlen=0, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new string property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"" :arg subtype: Enumerator in ['FILE_PATH', 'DIR_PATH', 'FILENAME', 'NONE'].\n"" :type subtype: string\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_StringProperty (PyObject *self, PyObject *args, PyObject *kw) |
static EnumPropertyItem * | enum_items_from_py (PyObject *seq_fast, PyObject *def, int *defvalue, const short is_enum_flag) |
static EnumPropertyItem * | bpy_props_enum_itemf (struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, int *free) |
PyDoc_STRVAR (BPy_EnumProperty_doc,".. function:: EnumProperty(items, name=\"\", description=\"\", default=\"\", options={'ANIMATABLE'}, update=None)\n""\n"" Returns a new enumerator property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: The default value for this enum, A string when *ENUM_FLAG*\n"" is disabled otherwise a set which may only contain string identifiers\n"" used in *items*.\n"" :type default: string or set\n"" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG'].\n"" :type options: set\n"" :arg items: sequence of enum items formatted:\n"" [(identifier, name, description, number), ...] where the identifier is used\n"" for python access and other values are used for the interface.\n"" Note the item is optional.\n"" For dynamic values a callback can be passed which returns a list in\n"" the same format as the static list.\n"" This function must take 2 arguments (self, context)\n"" :type items: sequence of string triplets or a function\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_EnumProperty (PyObject *self, PyObject *args, PyObject *kw) |
static StructRNA * | pointer_type_from_py (PyObject *value, const char *error_prefix) |
PyDoc_STRVAR (BPy_PointerProperty_doc,".. function:: PointerProperty(type=\"\", description=\"\", options={'ANIMATABLE'}, update=None)\n""\n"" Returns a new pointer property definition.\n""\n"" :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n"" :type type: class\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n"BPY_PROPDEF_UPDATE_DOC) | |
static PyObject * | BPy_PointerProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_CollectionProperty_doc,".. function:: CollectionProperty(items, type=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n""\n"" Returns a new collection property definition.\n""\n"" :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n"" :type type: class\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'].\n"" :type options: set\n") | |
static PyObject * | BPy_CollectionProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyDoc_STRVAR (BPy_RemoveProperty_doc,".. function:: RemoveProperty(attr)\n""\n"" Removes a dynamically defined property.\n""\n"" :arg attr: Property name.\n"" :type attr: string\n") | |
static PyObject * | BPy_RemoveProperty (PyObject *self, PyObject *args, PyObject *kw) |
PyObject * | BPY_rna_props (void) |
Variables | |
BPy_StructRNA * | bpy_context_module |
static EnumPropertyItem | property_flag_items [] |
static EnumPropertyItem | property_flag_enum_items [] |
static EnumPropertyItem | property_subtype_string_items [] |
static EnumPropertyItem | property_subtype_number_items [] |
static EnumPropertyItem | property_subtype_array_items [] |
static PyObject * | pymeth_BoolProperty = NULL |
static PyObject * | pymeth_BoolVectorProperty = NULL |
static PyObject * | pymeth_IntProperty = NULL |
static PyObject * | pymeth_IntVectorProperty = NULL |
static PyObject * | pymeth_FloatProperty = NULL |
static PyObject * | pymeth_FloatVectorProperty = NULL |
static PyObject * | pymeth_StringProperty = NULL |
static PyObject * | pymeth_EnumProperty = NULL |
static PyObject * | pymeth_PointerProperty = NULL |
static PyObject * | pymeth_CollectionProperty = NULL |
static PyObject * | pymeth_RemoveProperty = NULL |
static struct PyMethodDef | props_methods [] |
static struct PyModuleDef | props_module |
This file defines 'bpy.props' module used so scripts can define their own rna properties for use with python operators or adding new properties to existing blender types.
Definition in file bpy_props.c.
#define ASSIGN_STATIC | ( | _name | ) | pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name) |
Referenced by BPY_rna_props().
#define BPY_DATA_CB_SLOT_SIZE 1 |
Definition at line 53 of file bpy_props.c.
Referenced by bpy_prop_callback_assign().
#define BPY_DATA_CB_SLOT_UPDATE 0 |
Definition at line 55 of file bpy_props.c.
Referenced by bpy_prop_callback_assign(), and bpy_prop_update_cb().
#define BPY_PROPDEF_CHECK | ( | _func, | |
_property_flag_items | |||
) |
if (id_len >= MAX_IDPROP_NAME) { \ PyErr_Format(PyExc_TypeError, \ #_func"(): '%.200s' too long, max length is %d", \ id, MAX_IDPROP_NAME - 1); \ return NULL; \ } \ if (RNA_def_property_free_identifier(srna, id) == -1) { \ PyErr_Format(PyExc_TypeError, \ #_func"(): '%s' is defined as a non-dynamic type", \ id); \ return NULL; \ } \ if (pyopts && pyrna_set_to_enum_bitfield(_property_flag_items, \ pyopts, \ &opts, \ #_func"(options={ ...}):")) \ { \ return NULL; \ } \
Definition at line 309 of file bpy_props.c.
Referenced by BPy_CollectionProperty(), BPy_EnumProperty(), and BPy_PointerProperty().
#define BPY_PROPDEF_DESC_DOC |
" :arg description: Text used for the tooltip and api documentation.\n" \ " :type description: string\n" \
Definition at line 348 of file bpy_props.c.
#define BPY_PROPDEF_HEAD | ( | _func | ) |
if (PyTuple_GET_SIZE(args) == 1) { \ PyObject *ret; \ self = PyTuple_GET_ITEM(args, 0); \ args = PyTuple_New(0); \ ret = BPy_##_func(self, args, kw); \ Py_DECREF(args); \ return ret; \ } \ else if (PyTuple_GET_SIZE(args) > 1) { \ PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \ return NULL; \ } \ srna = srna_from_self(self, #_func"(...):"); \ if (srna == NULL) { \ if (PyErr_Occurred()) \ return NULL; \ return bpy_prop_deferred_return(pymeth_##_func, kw); \ } \
Definition at line 287 of file bpy_props.c.
Referenced by BPy_BoolProperty(), BPy_BoolVectorProperty(), BPy_CollectionProperty(), BPy_EnumProperty(), BPy_FloatProperty(), BPy_FloatVectorProperty(), BPy_IntProperty(), BPy_IntVectorProperty(), BPy_PointerProperty(), and BPy_StringProperty().
#define BPY_PROPDEF_NAME_DOC |
" :arg name: Name used in the user interface.\n" \ " :type name: string\n" \
Definition at line 343 of file bpy_props.c.
#define BPY_PROPDEF_SUBTYPE_CHECK | ( | _func, | |
_property_flag_items, | |||
_subtype | |||
) |
BPY_PROPDEF_CHECK(_func, _property_flag_items) \ if (pysubtype && RNA_enum_value_from_id(_subtype, \ pysubtype, \ &subtype) == 0) \ { \ PyErr_Format(PyExc_TypeError, \ #_func"(subtype='%s'): invalid subtype", \ pysubtype); \ return NULL; \ } \
Definition at line 330 of file bpy_props.c.
Referenced by BPy_BoolProperty(), BPy_BoolVectorProperty(), BPy_FloatProperty(), BPy_FloatVectorProperty(), BPy_IntProperty(), BPy_IntVectorProperty(), and BPy_StringProperty().
#define BPY_PROPDEF_UNIT_DOC |
" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n" \ " :type unit: string\n" \
Definition at line 353 of file bpy_props.c.
#define BPY_PROPDEF_UPDATE_DOC |
" :arg update: function to be called when this value is modified,\n" \ " This function must take 2 values (self, context) and return None.\n" \ " :type update: function\n" \
Definition at line 358 of file bpy_props.c.
static PyObject* BPy_BoolProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 389 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_BOOLEAN, PROP_HIDDEN, PROP_NONE, PROP_SKIP_SAVE, RNA_def_property(), RNA_def_property_boolean_default(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_ui_text(), wmOperatorType::srna, and update_cb().
static PyObject* BPy_BoolVectorProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 457 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, FALSE, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_BOOLEAN, PROP_HIDDEN, PROP_NONE, PROP_SKIP_SAVE, PyC_AsArray(), PYRNA_STACK_ARRAY, RNA_def_property(), RNA_def_property_array(), RNA_def_property_boolean_array_default(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_ui_text(), size(), wmOperatorType::srna, STRINGIFY, and update_cb().
static PyObject* BPy_CollectionProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 1363 of file bpy_props.c.
References BPY_PROPDEF_CHECK, BPY_PROPDEF_HEAD, wmOperatorType::description, wmOperatorType::name, NULL, pointer_type_from_py(), wmOperatorType::prop, PROP_ANIMATABLE, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_collection_runtime(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), and wmOperatorType::srna.
static PyObject* BPy_EnumProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 1157 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_CHECK, BPY_PROPDEF_HEAD, bpy_props_enum_itemf(), wmOperatorType::description, DummyRNA_NULL_items, enum_items_from_py(), FALSE, MEM_freeN(), wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_ENUM_FLAG, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_enum(), RNA_def_enum_flag(), RNA_def_enum_funcs(), RNA_def_enum_py_data(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), wmOperatorType::srna, TRUE, and update_cb().
static PyObject* BPy_FloatProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 689 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, FLT_MAX, max, MAX2, min, MIN2, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_FLOAT, PROP_HIDDEN, PROP_NONE, PROP_SKIP_SAVE, PROP_UNIT_NONE, property_unit_items, RNA_def_property(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_float_default(), RNA_def_property_range(), RNA_def_property_ui_range(), RNA_def_property_ui_text(), RNA_enum_value_from_id(), wmOperatorType::srna, step(), and update_cb().
static PyObject* BPy_FloatVectorProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 770 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, FALSE, FLT_MAX, max, MAX2, min, MIN2, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_FLOAT, PROP_HIDDEN, PROP_NONE, PROP_SKIP_SAVE, PROP_UNIT_NONE, property_unit_items, PyC_AsArray(), PYRNA_STACK_ARRAY, RNA_def_property(), RNA_def_property_array(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_float_array_default(), RNA_def_property_range(), RNA_def_property_ui_range(), RNA_def_property_ui_text(), RNA_enum_value_from_id(), size(), wmOperatorType::srna, step(), STRINGIFY, and update_cb().
static PyObject* BPy_IntProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 535 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, max, MAX2, min, MIN2, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_HIDDEN, PROP_INT, PROP_NONE, PROP_SKIP_SAVE, RNA_def_property(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_int_default(), RNA_def_property_range(), RNA_def_property_ui_range(), RNA_def_property_ui_text(), wmOperatorType::srna, step(), and update_cb().
static PyObject* BPy_IntVectorProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 605 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, FALSE, max, MAX2, min, MIN2, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_HIDDEN, PROP_INT, PROP_NONE, PROP_SKIP_SAVE, PyC_AsArray(), PYRNA_STACK_ARRAY, RNA_def_property(), RNA_def_property_array(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_int_array_default(), RNA_def_property_range(), RNA_def_property_ui_range(), RNA_def_property_ui_text(), size(), wmOperatorType::srna, step(), STRINGIFY, and update_cb().
static PyObject* BPy_PointerProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 1302 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_CHECK, BPY_PROPDEF_HEAD, wmOperatorType::description, wmOperatorType::name, NULL, pointer_type_from_py(), wmOperatorType::prop, PROP_ANIMATABLE, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_pointer_runtime(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), wmOperatorType::srna, and update_cb().
static int bpy_prop_callback_assign | ( | struct PropertyRNA * | prop, |
PyObject * | update_cb | ||
) | [static] |
Definition at line 258 of file bpy_props.c.
References BPY_DATA_CB_SLOT_SIZE, BPY_DATA_CB_SLOT_UPDATE, bpy_prop_update_cb(), MEM_callocN(), PROP_CONTEXT_PROPERTY_UPDATE, RNA_def_property_flag(), RNA_def_property_update_runtime(), RNA_def_py_data(), and update_cb().
Referenced by BPy_BoolProperty(), BPy_BoolVectorProperty(), BPy_EnumProperty(), BPy_FloatProperty(), BPy_FloatVectorProperty(), BPy_IntProperty(), BPy_IntVectorProperty(), BPy_PointerProperty(), and BPy_StringProperty().
static int bpy_prop_callback_check | ( | PyObject * | py_func, |
int | argcount | ||
) | [static] |
Definition at line 234 of file bpy_props.c.
Referenced by BPy_BoolProperty(), BPy_BoolVectorProperty(), BPy_EnumProperty(), BPy_FloatProperty(), BPy_FloatVectorProperty(), BPy_IntProperty(), BPy_IntVectorProperty(), BPy_PointerProperty(), and BPy_StringProperty().
static PyObject* bpy_prop_deferred_return | ( | PyObject * | func, |
PyObject * | kw | ||
) | [static] |
Definition at line 167 of file bpy_props.c.
References NULL.
static void bpy_prop_update_cb | ( | struct bContext * | C, |
struct PointerRNA * | ptr, | ||
struct PropertyRNA * | prop | ||
) | [static] |
Definition at line 184 of file bpy_props.c.
References BLI_assert, bpy_context_clear(), bpy_context_set(), BPY_DATA_CB_SLOT_UPDATE, FALSE, NULL, printf_func_error(), pyrna_struct_as_instance(), pyrna_write_check(), pyrna_write_set(), RNA_property_py_data_get(), and TRUE.
Referenced by bpy_prop_callback_assign().
static EnumPropertyItem* bpy_props_enum_itemf | ( | struct bContext * | C, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int * | free | ||
) | [static] |
Definition at line 1069 of file bpy_props.c.
References bpy_context_clear(), bpy_context_set(), DummyRNA_NULL_items, enum_items_from_py(), err, NULL, printf_func_error(), PROP_ENUM_FLAG, pyrna_struct_as_instance(), RNA_property_enum_py_data_get(), and RNA_property_flag().
Referenced by BPy_EnumProperty().
static PyObject* BPy_RemoveProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 1413 of file bpy_props.c.
References NULL, RNA_def_property_free_identifier(), wmOperatorType::srna, and srna_from_self().
PyObject* BPY_rna_props | ( | void | ) |
Definition at line 1484 of file bpy_props.c.
References ASSIGN_STATIC.
Referenced by BPy_init_modules().
static PyObject* BPy_StringProperty | ( | PyObject * | self, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 858 of file bpy_props.c.
References bpy_prop_callback_assign(), bpy_prop_callback_check(), BPY_PROPDEF_HEAD, BPY_PROPDEF_SUBTYPE_CHECK, wmOperatorType::description, wmOperatorType::name, NULL, wmOperatorType::prop, PROP_ANIMATABLE, PROP_HIDDEN, PROP_NONE, PROP_SKIP_SAVE, PROP_STRING, RNA_def_property(), RNA_def_property_clear_flag(), RNA_def_property_duplicate_pointers(), RNA_def_property_flag(), RNA_def_property_string_default(), RNA_def_property_string_maxlength(), RNA_def_property_ui_text(), wmOperatorType::srna, and update_cb().
static EnumPropertyItem* enum_items_from_py | ( | PyObject * | seq_fast, |
PyObject * | def, | ||
int * | defvalue, | ||
const short | is_enum_flag | ||
) | [static] |
Definition at line 922 of file bpy_props.c.
References EnumPropertyItem::description, i, EnumPropertyItem::identifier, MEM_callocN(), MEM_freeN(), MEM_mallocN(), EnumPropertyItem::name, NULL, py_long_as_int(), RNA_ENUM_BITFLAG_SIZE, STRINGIFY, and EnumPropertyItem::value.
Referenced by BPy_EnumProperty(), and bpy_props_enum_itemf().
static StructRNA* pointer_type_from_py | ( | PyObject * | value, |
const char * | error_prefix | ||
) | [static] |
Definition at line 1257 of file bpy_props.c.
References NULL, PyC_ExceptionBuffer(), RNA_PropertyGroup, RNA_struct_is_a(), wmOperatorType::srna, and srna_from_self().
Referenced by BPy_CollectionProperty(), and BPy_PointerProperty().
static void printf_func_error | ( | PyObject * | py_func | ) | [static] |
Definition at line 149 of file bpy_props.c.
Referenced by bpy_prop_update_cb(), and bpy_props_enum_itemf().
static int py_long_as_int | ( | PyObject * | py_long, |
int * | r_int | ||
) | [static] |
Definition at line 274 of file bpy_props.c.
Referenced by enum_items_from_py().
PyDoc_STRVAR | ( | BPy_EnumProperty_doc | , |
".. function:: EnumProperty(items, name=\"\", description=\"\", default=\"\", options={'ANIMATABLE'}, update=None)\n""\n"" Returns a new enumerator property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: The default value for this | enum, | ||
A string when *ENUM_FLAG *\n""is disabled otherwise a set which may only contain string identifiers\n""used in *items *.\n"":type default:string or set\n"":arg options:Enumerator in.\n"":type options:set\n"":arg items:sequence of enum items formatted:\n""where the identifier is used\n""for python access and other values are used for the interface.\n""Note the item is optional.\n""For dynamic values a callback can be passed which returns a list in\n""the same format as the static list.\n""This function must take 2 arguments(self, context)\n"":type items:sequence of string triplets or a function\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG'][(identifier, name, description, number),...] | ||
) |
PyDoc_STRVAR | ( | BPy_FloatProperty_doc | , |
".. function:: FloatProperty(name=\"\", description=\"\", default=0.0, min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', unit='NONE', update=None)\n""\n"" Returns a new float property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n"BPY_PROPDEF_UNIT_DOC | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'] | ||
) |
PyDoc_STRVAR | ( | BPy_BoolProperty_doc | , |
".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new boolean property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'] | ||
) |
PyDoc_STRVAR | ( | BPy_CollectionProperty_doc | , |
".. function:: CollectionProperty(items, type=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n""\n"" Returns a new collection property definition.\n""\n"" :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n"" :type type: class\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n" | ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'] | ||
) |
PyDoc_STRVAR | ( | BPy_BoolVectorProperty_doc | , |
".. function:: BoolVectorProperty(name=\"\", description=\"\", default=(False, False, False), options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector boolean property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of booleans the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n"" :arg size: Vector dimensions in .\n"" :type size: int\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'][1, and"STRINGIFY(PYRNA_STACK_ARRAY)"] | ||
) |
PyDoc_STRVAR | ( | BPy_StringProperty_doc | , |
".. function:: StringProperty(name=\"\", description=\"\", default=\"\", maxlen=0, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new string property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['FILE_PATH', 'DIR_PATH', 'FILENAME', 'NONE'] | ||
) |
PyDoc_STRVAR | ( | BPy_PointerProperty_doc | , |
".. function:: PointerProperty(type=\"\", description=\"\", options={'ANIMATABLE'}, update=None)\n""\n"" Returns a new pointer property definition.\n""\n"" :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n"" :type type: class\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE'] | ||
) |
PyDoc_STRVAR | ( | BPy_RemoveProperty_doc | , |
".. function:: RemoveProperty(attr)\n""\n"" Removes a dynamically defined property.\n""\n"" :arg attr: Property name.\n"" :type attr: string\n" | |||
) |
PyDoc_STRVAR | ( | BPy_FloatVectorProperty_doc | , |
".. function:: FloatVectorProperty(name=\"\", description=\"\", default=(0.0, 0.0, 0.0), min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector float property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of floats the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n"BPY_PROPDEF_UNIT_DOC" :arg size: Vector dimensions in .\n"" :type size: int\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'][1, and"STRINGIFY(PYRNA_STACK_ARRAY)"] | ||
) |
PyDoc_STRVAR | ( | BPy_IntProperty_doc | , |
".. function:: IntProperty(name=\"\", description=\"\", default=0, min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, step=1, options={'ANIMATABLE'}, subtype='NONE', update=None)\n""\n"" Returns a new int property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'] | ||
) |
PyDoc_STRVAR | ( | BPy_IntVectorProperty_doc | , |
".. function:: IntVectorProperty(name=\"\", description=\"\", default=(0, 0, 0), min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, options={'ANIMATABLE'}, subtype='NONE', size=3, update=None)\n""\n"" Returns a new vector int property definition.\n""\n"BPY_PROPDEF_NAME_DOC BPY_PROPDEF_DESC_DOC" :arg default: sequence of ints the length of *size*.\n"" :type default: sequence\n"" :arg options: Enumerator in .\n"" :type options: set\n"" :arg subtype: Enumerator in .\n"" :type subtype: string\n"" :arg size: Vector dimensions in .\n"" :type size: int\n" | BPY_PROPDEF_UPDATE_DOC['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE']['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'][1, and"STRINGIFY(PYRNA_STACK_ARRAY)"] | ||
) |
static PyObject* pyrna_struct_as_instance | ( | PointerRNA * | ptr | ) | [static] |
Definition at line 124 of file bpy_props.c.
References PointerRNA::data, NULL, pyrna_struct_CreatePyObject(), and RNA_struct_instance().
Referenced by bpy_prop_update_cb(), and bpy_props_enum_itemf().
Definition at line 81 of file bpy_interface.c.
Referenced by BPy_init_modules().
EnumPropertyItem property_flag_enum_items[] [static] |
{ {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, {PROP_ENUM_FLAG, "ENUM_FLAG", 0, "Enum Flag", ""}, {0, NULL, 0, NULL, NULL}}
Definition at line 65 of file bpy_props.c.
EnumPropertyItem property_flag_items[] [static] |
{ {PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""}, {PROP_SKIP_SAVE, "SKIP_SAVE", 0, "Skip Save", ""}, {PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""}, {0, NULL, 0, NULL, NULL}}
Definition at line 59 of file bpy_props.c.
EnumPropertyItem property_subtype_array_items[] [static] |
{ {PROP_COLOR, "COLOR", 0, "Color", ""}, {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, {PROP_VELOCITY, "VELOCITY", 0, "Velocity", ""}, {PROP_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, {PROP_EULER, "EULER", 0, "Euler", ""}, {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""}, {PROP_AXISANGLE, "AXISANGLE", 0, "Axis Angle", ""}, {PROP_XYZ, "XYZ", 0, "XYZ", ""}, {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Color Gamma", ""}, {PROP_LAYER, "LAYER", 0, "Layer", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}
Definition at line 94 of file bpy_props.c.
EnumPropertyItem property_subtype_number_items[] [static] |
{ {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, {PROP_TIME, "TIME", 0, "Time", ""}, {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}
Definition at line 83 of file bpy_props.c.
EnumPropertyItem property_subtype_string_items[] [static] |
{ {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, {PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""}, {PROP_FILENAME, "FILENAME", 0, "Filename", ""}, {PROP_BYTESTRING, "BYTE_STRING", 0, "Byte String", ""}, {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}
Definition at line 73 of file bpy_props.c.
struct PyMethodDef props_methods[] [static] |
{ {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolProperty_doc}, {"BoolVectorProperty", (PyCFunction)BPy_BoolVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_BoolVectorProperty_doc}, {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntProperty_doc}, {"IntVectorProperty", (PyCFunction)BPy_IntVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_IntVectorProperty_doc}, {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatProperty_doc}, {"FloatVectorProperty", (PyCFunction)BPy_FloatVectorProperty, METH_VARARGS|METH_KEYWORDS, BPy_FloatVectorProperty_doc}, {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, BPy_StringProperty_doc}, {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, BPy_EnumProperty_doc}, {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, BPy_PointerProperty_doc}, {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, BPy_CollectionProperty_doc}, {"RemoveProperty", (PyCFunction)BPy_RemoveProperty, METH_VARARGS|METH_KEYWORDS, BPy_RemoveProperty_doc}, {NULL, NULL, 0, NULL} }
Definition at line 1458 of file bpy_props.c.
struct PyModuleDef props_module [static] |
{ PyModuleDef_HEAD_INIT, "bpy.props", "This module defines properties to extend blenders internal data, the result of these functions" " is used to assign properties to classes registered with blender and can't be used directly.", -1, props_methods, NULL, NULL, NULL, NULL }
Definition at line 1474 of file bpy_props.c.
PyObject* pymeth_BoolProperty = NULL [static] |
Definition at line 112 of file bpy_props.c.
PyObject* pymeth_BoolVectorProperty = NULL [static] |
Definition at line 113 of file bpy_props.c.
PyObject* pymeth_CollectionProperty = NULL [static] |
Definition at line 121 of file bpy_props.c.
PyObject* pymeth_EnumProperty = NULL [static] |
Definition at line 119 of file bpy_props.c.
PyObject* pymeth_FloatProperty = NULL [static] |
Definition at line 116 of file bpy_props.c.
PyObject* pymeth_FloatVectorProperty = NULL [static] |
Definition at line 117 of file bpy_props.c.
PyObject* pymeth_IntProperty = NULL [static] |
Definition at line 114 of file bpy_props.c.
PyObject* pymeth_IntVectorProperty = NULL [static] |
Definition at line 115 of file bpy_props.c.
PyObject* pymeth_PointerProperty = NULL [static] |
Definition at line 120 of file bpy_props.c.
PyObject* pymeth_RemoveProperty = NULL [static] |
Definition at line 122 of file bpy_props.c.
PyObject* pymeth_StringProperty = NULL [static] |
Definition at line 118 of file bpy_props.c.