26 #define PY_SSIZE_T_CLEAN
49 #include "../generic/py_capi_utils.h"
60 {
PROP_PROPORTIONAL,
"PROPORTIONAL", 0,
"Adjust values proportionally to eachother",
""},
64 "Update on every keystroke in textedit 'mode'",
69 #define BPY_PROPDEF_OPTIONS_DOC \
70 " :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'LIBRARY_EDITABLE', " \
72 "'TEXTEDIT_UPDATE'].\n" \
73 " :type options: set\n"
84 #define BPY_PROPDEF_OPTIONS_ENUM_DOC \
85 " :arg options: Enumerator in ['HIDDEN', 'SKIP_SAVE', 'ANIMATABLE', 'ENUM_FLAG', " \
86 "'LIBRARY_EDITABLE'].\n" \
87 " :type options: set\n"
91 "LIBRARY_OVERRIDABLE",
93 "Library Overridable",
94 "Make that property editable in library overrides of linked data-blocks"},
98 #define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC \
99 " :arg override: Enumerator in ['LIBRARY_OVERRIDABLE'].\n" \
100 " :type override: set\n"
104 "LIBRARY_OVERRIDABLE",
106 "Library Overridable",
107 "Make that property editable in library overrides of linked data-blocks"},
112 "Do not use the names of the items, only their indices in the collection"},
117 "Allow users to add new items in that collection in library overrides"},
121 #define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC \
122 " :arg override: Enumerator in ['LIBRARY_OVERRIDABLE', 'NO_PROPERTY_NAME', " \
123 "'USE_INSERTION'].\n" \
124 " :type override: set\n"
133 {
PROP_PASSWORD,
"PASSWORD", 0,
"Password",
"A string that is displayed hidden ('********')"},
139 #define BPY_PROPDEF_SUBTYPE_STRING_DOC \
140 " :arg subtype: Enumerator in ['FILE_PATH', 'DIR_PATH', 'FILE_NAME', 'BYTE_STRING', " \
141 "'PASSWORD', 'NONE'].\n" \
142 " :type subtype: string\n"
160 #define BPY_PROPDEF_SUBTYPE_NUMBER_DOC \
161 " :arg subtype: Enumerator in ['PIXEL', 'UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', " \
162 "'TIME', 'DISTANCE', 'DISTANCE_CAMERA', 'POWER', 'TEMPERATURE', 'NONE'].\n" \
163 " :type subtype: string\n"
178 {
PROP_COORDS,
"COORDINATES", 0,
"Vector Coordinates",
""},
186 #define BPY_PROPDEF_SUBTYPE_ARRAY_DOC \
187 " :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', " \
188 "'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', " \
189 "'XYZ', 'XYZ_LENGTH', 'COLOR_GAMMA', 'COORDINATES', 'LAYER', 'LAYER_MEMBER', 'NONE'].\n" \
190 " :type subtype: string\n"
262 #define BPY_PROP_STORE_PY_DATA_SIZE \
263 (sizeof(((struct BPyPropStore *)NULL)->py_data) / sizeof(PyObject *))
265 #define ASSIGN_PYOBJECT_INCREF(a, b) \
267 BLI_assert((a) == NULL); \
282 if (prop_store ==
NULL) {
283 prop_store =
MEM_callocN(
sizeof(*prop_store), __func__);
296 if (prop_store ==
NULL) {
319 PyObject_GC_UnTrack(
self);
321 PyObject_GC_Del(
self);
338 return PyUnicode_FromFormat(
"<%.200s, %R, %R>", Py_TYPE(
self)->tp_name,
self->fn,
self->kw);
363 PyObject *
ret =
self->fn;
374 PyObject *
ret =
self->kw;
386 "Intermediate storage for properties before registration.\n"
390 " This is not part of the stable API and may change between releases.");
393 PyVarObject_HEAD_INIT(
NULL, 0)
395 .tp_name =
"_PropertyDeferred",
401 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
403 .tp_doc = bpy_prop_deferred_doc,
421 PyObject_GC_Track(
self);
422 return (PyObject *)
self;
442 PyObject *
self =
NULL;
496 PyGILState_STATE gilstate;
513 args = PyTuple_New(2);
515 PyTuple_SET_ITEM(args, 0,
self);
520 ret = PyObject_CallObject(py_func, args);
528 if (
ret != Py_None) {
529 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
556 PyGILState_STATE gilstate;
570 gilstate = PyGILState_Ensure();
575 args = PyTuple_New(1);
577 PyTuple_SET_ITEM(args, 0,
self);
579 ret = PyObject_CallObject(py_func, args);
590 if (value_i == -1 && PyErr_Occurred()) {
595 value = (bool)value_i;
602 PyGILState_Release(gilstate);
619 PyGILState_STATE gilstate;
632 gilstate = PyGILState_Ensure();
637 args = PyTuple_New(2);
639 PyTuple_SET_ITEM(args, 0,
self);
641 PyTuple_SET_ITEM(args, 1, PyBool_FromLong(value));
643 ret = PyObject_CallObject(py_func, args);
651 if (
ret != Py_None) {
652 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
660 PyGILState_Release(gilstate);
677 PyGILState_STATE gilstate;
691 gilstate = PyGILState_Ensure();
696 args = PyTuple_New(1);
698 PyTuple_SET_ITEM(args, 0,
self);
700 ret = PyObject_CallObject(py_func, args);
707 for (i = 0; i <
len; i++) {
712 if (
PyC_AsArray(values,
ret,
len, &PyBool_Type,
false,
"BoolVectorProperty get") == -1) {
715 for (i = 0; i <
len; i++) {
723 PyGILState_Release(gilstate);
741 PyGILState_STATE gilstate;
755 gilstate = PyGILState_Ensure();
760 args = PyTuple_New(2);
762 PyTuple_SET_ITEM(args, 0,
self);
765 PyTuple_SET_ITEM(args, 1, py_values);
767 ret = PyObject_CallObject(py_func, args);
775 if (
ret != Py_None) {
776 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
784 PyGILState_Release(gilstate);
805 PyGILState_STATE gilstate;
819 gilstate = PyGILState_Ensure();
824 args = PyTuple_New(1);
826 PyTuple_SET_ITEM(args, 0,
self);
828 ret = PyObject_CallObject(py_func, args);
837 value = PyC_Long_AsI32(
ret);
839 if (value == -1 && PyErr_Occurred()) {
848 PyGILState_Release(gilstate);
865 PyGILState_STATE gilstate;
878 gilstate = PyGILState_Ensure();
883 args = PyTuple_New(2);
885 PyTuple_SET_ITEM(args, 0,
self);
887 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
889 ret = PyObject_CallObject(py_func, args);
897 if (
ret != Py_None) {
898 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
906 PyGILState_Release(gilstate);
923 PyGILState_STATE gilstate;
937 gilstate = PyGILState_Ensure();
942 args = PyTuple_New(1);
944 PyTuple_SET_ITEM(args, 0,
self);
946 ret = PyObject_CallObject(py_func, args);
953 for (i = 0; i <
len; i++) {
958 if (
PyC_AsArray(values,
ret,
len, &PyLong_Type,
false,
"IntVectorProperty get") == -1) {
961 for (i = 0; i <
len; i++) {
969 PyGILState_Release(gilstate);
987 PyGILState_STATE gilstate;
1001 gilstate = PyGILState_Ensure();
1006 args = PyTuple_New(2);
1008 PyTuple_SET_ITEM(args, 0,
self);
1011 PyTuple_SET_ITEM(args, 1, py_values);
1013 ret = PyObject_CallObject(py_func, args);
1021 if (
ret != Py_None) {
1022 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1030 PyGILState_Release(gilstate);
1051 PyGILState_STATE gilstate;
1065 gilstate = PyGILState_Ensure();
1070 args = PyTuple_New(1);
1072 PyTuple_SET_ITEM(args, 0,
self);
1074 ret = PyObject_CallObject(py_func, args);
1083 value = PyFloat_AsDouble(
ret);
1085 if (value == -1.0f && PyErr_Occurred()) {
1094 PyGILState_Release(gilstate);
1111 PyGILState_STATE gilstate;
1124 gilstate = PyGILState_Ensure();
1129 args = PyTuple_New(2);
1131 PyTuple_SET_ITEM(args, 0,
self);
1133 PyTuple_SET_ITEM(args, 1, PyFloat_FromDouble(value));
1135 ret = PyObject_CallObject(py_func, args);
1143 if (
ret != Py_None) {
1144 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1152 PyGILState_Release(gilstate);
1169 PyGILState_STATE gilstate;
1183 gilstate = PyGILState_Ensure();
1188 args = PyTuple_New(1);
1190 PyTuple_SET_ITEM(args, 0,
self);
1192 ret = PyObject_CallObject(py_func, args);
1199 for (i = 0; i <
len; i++) {
1204 if (
PyC_AsArray(values,
ret,
len, &PyFloat_Type,
false,
"FloatVectorProperty get") == -1) {
1207 for (i = 0; i <
len; i++) {
1215 PyGILState_Release(gilstate);
1225 const float *values)
1232 PyObject *py_values;
1233 PyGILState_STATE gilstate;
1247 gilstate = PyGILState_Ensure();
1252 args = PyTuple_New(2);
1254 PyTuple_SET_ITEM(args, 0,
self);
1257 PyTuple_SET_ITEM(args, 1, py_values);
1259 ret = PyObject_CallObject(py_func, args);
1267 if (
ret != Py_None) {
1268 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1276 PyGILState_Release(gilstate);
1297 PyGILState_STATE gilstate;
1310 gilstate = PyGILState_Ensure();
1315 args = PyTuple_New(1);
1317 PyTuple_SET_ITEM(args, 0,
self);
1319 ret = PyObject_CallObject(py_func, args);
1327 else if (!PyUnicode_Check(
ret)) {
1329 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1342 PyGILState_Release(gilstate);
1357 PyGILState_STATE gilstate;
1371 gilstate = PyGILState_Ensure();
1376 args = PyTuple_New(1);
1378 PyTuple_SET_ITEM(args, 0,
self);
1380 ret = PyObject_CallObject(py_func, args);
1388 else if (!PyUnicode_Check(
ret)) {
1390 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1396 Py_ssize_t length_ssize_t = 0;
1397 PyUnicode_AsUTF8AndSize(
ret, &length_ssize_t);
1403 PyGILState_Release(gilstate);
1422 PyGILState_STATE gilstate;
1436 gilstate = PyGILState_Ensure();
1441 args = PyTuple_New(2);
1443 PyTuple_SET_ITEM(args, 0,
self);
1445 py_value = PyUnicode_FromString(value);
1447 PyErr_SetString(PyExc_ValueError,
"the return value must be a string");
1451 PyTuple_SET_ITEM(args, 1, py_value);
1454 ret = PyObject_CallObject(py_func, args);
1462 if (
ret != Py_None) {
1463 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1471 PyGILState_Release(gilstate);
1491 PyObject *py_candidate;
1497 const PyGILState_STATE gilstate = PyGILState_Ensure();
1509 args = PyTuple_New(2);
1510 PyTuple_SET_ITEM(args, 0, py_self);
1511 PyTuple_SET_ITEM(args, 1, py_candidate);
1513 ret = PyObject_CallObject(py_func, args);
1526 PyGILState_Release(gilstate);
1547 PyGILState_STATE gilstate;
1561 gilstate = PyGILState_Ensure();
1566 args = PyTuple_New(1);
1568 PyTuple_SET_ITEM(args, 0,
self);
1570 ret = PyObject_CallObject(py_func, args);
1579 value = PyC_Long_AsI32(
ret);
1581 if (value == -1 && PyErr_Occurred()) {
1590 PyGILState_Release(gilstate);
1607 PyGILState_STATE gilstate;
1620 gilstate = PyGILState_Ensure();
1625 args = PyTuple_New(2);
1627 PyTuple_SET_ITEM(args, 0,
self);
1629 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
1631 ret = PyObject_CallObject(py_func, args);
1639 if (
ret != Py_None) {
1640 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1648 PyGILState_Release(gilstate);
1659 if (PyLong_CheckExact(py_long)) {
1660 *r_int = (int)PyLong_AS_LONG(py_long);
1669 static size_t strswapbufcpy(
char *buf,
const char **orig)
1671 const char *src = *orig;
1675 while ((*dst = *src)) {
1703 const bool is_enum_flag)
1707 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
1708 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
1709 Py_ssize_t totbuf = 0;
1712 const char *def_string_cmp =
NULL;
1713 int def_int_cmp = 0;
1717 PyErr_SetString(PyExc_TypeError,
1718 "EnumProperty(...): maximum " STRINGIFY(
1722 if (def && !PySet_Check(def)) {
1723 PyErr_Format(PyExc_TypeError,
1724 "EnumProperty(...): default option must be a 'set' "
1725 "type when ENUM_FLAG is enabled, not a '%.200s'",
1726 Py_TYPE(def)->tp_name);
1733 def_string_cmp = PyUnicode_AsUTF8(def);
1734 if (def_string_cmp ==
NULL) {
1735 PyErr_Format(PyExc_TypeError,
1736 "EnumProperty(...): default option must be a 'str' or 'int' "
1737 "type when ENUM_FLAG is disabled, not a '%.200s'",
1738 Py_TYPE(def)->tp_name);
1750 for (i = 0; i < seq_len; i++) {
1752 const char *tmp_icon =
NULL;
1753 Py_ssize_t item_size;
1754 Py_ssize_t id_str_size;
1755 Py_ssize_t name_str_size;
1756 Py_ssize_t desc_str_size;
1758 item = seq_fast_items[i];
1760 if ((PyTuple_CheckExact(item)) && (item_size = PyTuple_GET_SIZE(item)) &&
1761 (item_size >= 3 && item_size <= 5) &&
1762 (tmp.
identifier = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
1763 (tmp.
name = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
1764 (tmp.
description = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
1768 (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) &&
1771 if (item_size < 4) {
1775 if (def && PySet_Contains(def, PyTuple_GET_ITEM(item, 0))) {
1776 *defvalue |= tmp.
value;
1781 if (item_size < 4) {
1785 if (def && def_used == 0) {
1787 (def_string_cmp ==
NULL && def_int_cmp == tmp.
value)) {
1788 *defvalue = tmp.
value;
1801 totbuf += id_str_size + name_str_size + desc_str_size + 3;
1803 else if (item == Py_None) {
1809 PyErr_SetString(PyExc_TypeError,
1810 "EnumProperty(...): expected a tuple containing "
1811 "(identifier, name, description) and optionally an "
1812 "icon name and unique number");
1819 if (def && def_used != PySet_GET_SIZE(def)) {
1822 PyErr_Format(PyExc_TypeError,
1823 "EnumProperty(..., default={...}): set has %d unused member(s)",
1824 PySet_GET_SIZE(def) - def_used);
1829 if (def && def_used == 0) {
1832 if (def_string_cmp) {
1833 PyErr_Format(PyExc_TypeError,
1834 "EnumProperty(..., default=\'%s\'): not found in enum members",
1838 PyErr_Format(PyExc_TypeError,
1839 "EnumProperty(..., default=%d): not found in enum members",
1855 (
sizeof(
char) * totbuf),
1856 "enum_items_from_py2");
1858 char *buf = ((
char *)items_dup) + (
sizeof(
EnumPropertyItem) * (seq_len + 1));
1860 for (i = 0; i < seq_len; i++, items_ptr++) {
1861 buf += strswapbufcpy(buf, &items_ptr->
identifier);
1862 buf += strswapbufcpy(buf, &items_ptr->
name);
1863 buf += strswapbufcpy(buf, &items_ptr->
description);
1879 PyGILState_STATE gilstate;
1882 PyObject *
self =
NULL;
1893 gilstate = PyGILState_Ensure();
1896 args = PyTuple_New(2);
1898 PyTuple_SET_ITEM(args, 0,
self);
1906 PyTuple_SET_ITEM(args, 1, Py_None);
1910 items = PyObject_CallObject(py_func, args);
1914 if (items ==
NULL) {
1918 PyObject *items_fast;
1919 int defvalue_dummy = 0;
1921 if (!(items_fast = PySequence_Fast(items,
1922 "EnumProperty(...): "
1923 "return value from the callback was not a sequence"))) {
1930 Py_DECREF(items_fast);
1953 PyGILState_Release(gilstate);
1961 if (py_func && py_func != Py_None) {
1962 if (!PyFunction_Check(py_func)) {
1963 PyErr_Format(PyExc_TypeError,
1964 "%s keyword: expected a function type, not a %.200s",
1966 Py_TYPE(py_func)->tp_name);
1970 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(py_func);
1971 if (f_code->co_argcount != argcount) {
1972 PyErr_Format(PyExc_TypeError,
1973 "%s keyword: expected a function taking %d arguments, not %d",
1976 f_code->co_argcount);
2223 #define BPY_PROPDEF_HEAD(_func) \
2224 if (PyTuple_GET_SIZE(args) == 1) { \
2226 self = PyTuple_GET_ITEM(args, 0); \
2227 args = PyTuple_New(0); \
2228 ret = BPy_##_func(self, args, kw); \
2232 if (PyTuple_GET_SIZE(args) > 1) { \
2233 PyErr_SetString(PyExc_ValueError, "all args must be keywords"); \
2236 srna = srna_from_self(self, #_func "(...):"); \
2237 if (srna == NULL) { \
2238 if (PyErr_Occurred()) { \
2241 return bpy_prop_deferred_data_CreatePyObject(pymeth_##_func, kw); \
2247 #define BPY_PROPDEF_CHECK(_func, _property_flag_items, _property_flag_override_items) \
2248 if (UNLIKELY(id_len >= MAX_IDPROP_NAME)) { \
2249 PyErr_Format(PyExc_TypeError, \
2250 #_func "(): '%.200s' too long, max length is %d", \
2252 MAX_IDPROP_NAME - 1); \
2255 if (UNLIKELY(RNA_def_property_free_identifier(srna, id) == -1)) { \
2256 PyErr_Format(PyExc_TypeError, #_func "(): '%s' is defined as a non-dynamic type", id); \
2259 if (UNLIKELY(pyopts && pyrna_set_to_enum_bitfield( \
2260 _property_flag_items, pyopts, &opts, #_func "(options={ ...}):"))) { \
2263 if (UNLIKELY(pyopts_override && pyrna_set_to_enum_bitfield(_property_flag_override_items, \
2266 #_func "(override={ ...}):"))) { \
2270 const EnumPropertyItem *tag_defines = RNA_struct_property_tag_defines(srna); \
2271 if (py_tags && !tag_defines) { \
2272 PyErr_Format(PyExc_TypeError, \
2273 #_func "(): property-tags not available for '%s'", \
2274 RNA_struct_identifier(srna)); \
2277 if (UNLIKELY(py_tags && pyrna_set_to_enum_bitfield( \
2278 tag_defines, py_tags, &prop_tags, #_func "(tags={ ...}):"))) { \
2284 #define BPY_PROPDEF_SUBTYPE_CHECK( \
2285 _func, _property_flag_items, _property_flag_override_items, _subtype) \
2286 BPY_PROPDEF_CHECK(_func, _property_flag_items, _property_flag_override_items); \
2287 if (UNLIKELY(pysubtype && RNA_enum_value_from_id(_subtype, pysubtype, &subtype) == 0)) { \
2288 const char *enum_str = BPy_enum_as_string(_subtype); \
2289 PyErr_Format(PyExc_TypeError, \
2291 "(subtype='%s'): " \
2292 "subtype not found in (%s)", \
2295 MEM_freeN((void *)enum_str); \
2306 #define BPY_PROPDEF_NAME_DOC \
2307 " :arg name: Name used in the user interface.\n" \
2308 " :type name: string\n"
2310 #define BPY_PROPDEF_DESC_DOC \
2311 " :arg description: Text used for the tooltip and api documentation.\n" \
2312 " :type description: string\n"
2314 #define BPY_PROPDEF_UNIT_DOC \
2315 " :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', " \
2316 "'VELOCITY', 'ACCELERATION', 'MASS', 'CAMERA', 'POWER'].\n" \
2317 " :type unit: string\n"
2319 #define BPY_PROPDEF_NUM_MIN_DOC \
2320 " :arg min: Hard minimum, trying to assign a value below will silently assign this minimum " \
2323 #define BPY_PROPDEF_NUM_MAX_DOC \
2324 " :arg max: Hard maximum, trying to assign a value above will silently assign this maximum " \
2327 #define BPY_PROPDEF_NUM_SOFTMIN_DOC \
2328 " :arg soft_min: Soft minimum (>= *min*), user won't be able to drag the widget below this " \
2329 "value in the UI.\n"
2331 #define BPY_PROPDEF_NUM_SOFTMAX_DOC \
2332 " :arg soft_max: Soft maximum (<= *max*), user won't be able to drag the widget above this " \
2333 "value in the UI.\n"
2335 #define BPY_PROPDEF_VECSIZE_DOC \
2336 " :arg size: Vector dimensions in [1, " STRINGIFY(PYRNA_STACK_ARRAY) "].\n" \
2337 " :type size: int\n"
2339 #define BPY_PROPDEF_INT_STEP_DOC \
2340 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 1 (WARNING: unused " \
2342 " :type step: int\n"
2344 #define BPY_PROPDEF_FLOAT_STEP_DOC \
2345 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 3 (WARNING: actual " \
2346 "value is /100).\n" \
2347 " :type step: int\n"
2349 #define BPY_PROPDEF_FLOAT_PREC_DOC \
2350 " :arg precision: Maximum number of decimal digits to display, in [0, 6].\n" \
2351 " :type precision: int\n"
2353 #define BPY_PROPDEF_UPDATE_DOC \
2354 " :arg update: Function to be called when this value is modified,\n" \
2355 " This function must take 2 values (self, context) and return None.\n" \
2356 " *Warning* there are no safety checks to avoid infinite recursion.\n" \
2357 " :type update: function\n"
2359 #define BPY_PROPDEF_POLL_DOC \
2360 " :arg poll: function to be called to determine whether an item is valid for this " \
2362 " The function must take 2 values (self, object) and return Bool.\n" \
2363 " :type poll: function\n"
2365 #define BPY_PROPDEF_GET_DOC \
2366 " :arg get: Function to be called when this value is 'read',\n" \
2367 " This function must take 1 value (self) and return the value of the property.\n" \
2368 " :type get: function\n"
2370 #define BPY_PROPDEF_SET_DOC \
2371 " :arg set: Function to be called when this value is 'written',\n" \
2372 " This function must take 2 values (self, value) and return None.\n" \
2373 " :type set: function\n"
2375 #define BPY_PROPDEF_TYPE_DOC \
2376 " :arg type: A subclass of :class:`bpy.types.PropertyGroup` or :class:`bpy.types.ID`.\n" \
2377 " :type type: class\n"
2379 #define BPY_PROPDEF_TAGS_DOC \
2380 " :arg tags: Enumerator of tags that are defined by parent class.\n" \
2381 " :type tags: set\n"
2384 static int bpy_struct_id_used(
StructRNA *srna,
char *identifier)
2402 ".. function:: BoolProperty(name=\"\", "
2403 "description=\"\", "
2405 "options={'ANIMATABLE'}, "
2413 " Returns a new boolean property definition.\n"
2425 const char *
id =
NULL, *name =
NULL, *description =
"";
2429 PyObject *pyopts =
NULL;
2430 PyObject *pyopts_override =
NULL;
2432 int opts_override = 0;
2434 const char *pysubtype =
NULL;
2439 PyObject *py_tags =
NULL;
2441 static const char *_keywords[] = {
2455 static _PyArg_Parser _parser = {
"s#|ssO&O!O!O!sOOO:BoolProperty", _keywords, 0};
2456 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2503 if (pyopts_override) {
2515 BPy_BoolVectorProperty_doc,
2516 ".. function:: BoolVectorProperty(name=\"\", "
2517 "description=\"\", "
2518 "default=(False, False, False), "
2519 "options={'ANIMATABLE'}, "
2528 " Returns a new vector boolean property definition.\n"
2530 " :arg default: sequence of booleans the length of *size*.\n"
2541 const char *
id =
NULL, *name =
NULL, *description =
"";
2546 PyObject *pydef =
NULL;
2547 PyObject *pyopts =
NULL;
2548 PyObject *pyopts_override =
NULL;
2550 int opts_override = 0;
2552 const char *pysubtype =
NULL;
2557 PyObject *py_tags =
NULL;
2559 static const char *_keywords[] = {
2574 static _PyArg_Parser _parser = {
"s#|ssOO!O!O!siOOO:BoolVectorProperty", _keywords, 0};
2575 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2612 def, pydef,
size, &PyBool_Type,
false,
"BoolVectorProperty(default=sequence)") == -1) {
2628 srna,
id,
size, pydef ? def :
NULL, name ? name :
id, description);
2643 if (pyopts_override) {
2655 BPy_IntProperty_doc,
2656 ".. function:: IntProperty(name=\"\", "
2657 "description=\"\", "
2659 "min=-2**31, max=2**31-1, "
2660 "soft_min=-2**31, soft_max=2**31-1, "
2662 "options={'ANIMATABLE'}, "
2670 " Returns a new int property definition.\n"
2684 const char *
id =
NULL, *name =
NULL, *description =
"";
2686 int min = INT_MIN,
max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1, def = 0;
2688 PyObject *pyopts =
NULL;
2690 PyObject *pyopts_override =
NULL;
2691 int opts_override = 0;
2693 const char *pysubtype =
NULL;
2698 PyObject *py_tags =
NULL;
2700 static const char *_keywords[] = {
2719 static _PyArg_Parser _parser = {
"s#|ssiiiiiiO!O!O!sOOO:IntProperty", _keywords, 0};
2720 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2773 if (pyopts_override) {
2784 ".. function:: IntVectorProperty(name=\"\", "
2785 "description=\"\", "
2786 "default=(0, 0, 0), min=-2**31, max=2**31-1, "
2788 "soft_max=2**31-1, "
2790 "options={'ANIMATABLE'}, "
2799 " Returns a new vector int property definition.\n"
2801 " :arg default: sequence of ints the length of *size*.\n"
2817 const char *
id =
NULL, *name =
NULL, *description =
"";
2819 int min = INT_MIN,
max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX, step = 1;
2823 PyObject *pydef =
NULL;
2824 PyObject *pyopts =
NULL;
2826 PyObject *pyopts_override =
NULL;
2827 int opts_override = 0;
2829 const char *pysubtype =
NULL;
2834 PyObject *py_tags =
NULL;
2836 static const char *_keywords[] = {
2856 static _PyArg_Parser _parser = {
"s#|ssOiiiiiO!O!O!siOOO:IntVectorProperty", _keywords, 0};
2857 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2899 def, pydef,
size, &PyLong_Type,
false,
"IntVectorProperty(default=sequence)") == -1) {
2928 if (pyopts_override) {
2939 ".. function:: FloatProperty(name=\"\", "
2940 "description=\"\", "
2942 "min=-3.402823e+38, max=3.402823e+38, "
2943 "soft_min=-3.402823e+38, soft_max=3.402823e+38, "
2946 "options={'ANIMATABLE'}, "
2955 " Returns a new float (single precision) property definition.\n"
2971 const char *
id =
NULL, *name =
NULL, *description =
"";
2973 float min = -FLT_MAX,
max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3,
2977 PyObject *pyopts =
NULL;
2979 PyObject *pyopts_override =
NULL;
2980 int opts_override = 0;
2982 const char *pysubtype =
NULL;
2984 const char *pyunit =
NULL;
2989 PyObject *py_tags =
NULL;
2991 static const char *_keywords[] = {
2992 "attr",
"name",
"description",
"default",
"min",
"max",
"soft_min",
2993 "soft_max",
"step",
"precision",
"options",
"override",
"tags",
"subtype",
2994 "unit",
"update",
"get",
"set",
NULL,
2996 static _PyArg_Parser _parser = {
"s#|ssffffffiO!O!O!ssOOO:FloatProperty", _keywords, 0};
2997 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3031 PyErr_Format(PyExc_TypeError,
"FloatProperty(unit='%s'): invalid unit", pyunit);
3057 if (pyopts_override) {
3068 ".. function:: FloatVectorProperty(name=\"\", "
3069 "description=\"\", "
3070 "default=(0.0, 0.0, 0.0), "
3071 "min=sys.float_info.min, max=sys.float_info.max, "
3072 "soft_min=sys.float_info.min, soft_max=sys.float_info.max, "
3075 "options={'ANIMATABLE'}, "
3085 " Returns a new vector float property definition.\n"
3087 " :arg default: sequence of floats the length of *size*.\n"
3103 const char *
id =
NULL, *name =
NULL, *description =
"";
3105 float min = -FLT_MAX,
max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX, step = 3;
3107 int precision = 2,
size = 3;
3109 PyObject *pydef =
NULL;
3110 PyObject *pyopts =
NULL;
3112 PyObject *pyopts_override =
NULL;
3113 int opts_override = 0;
3115 const char *pysubtype =
NULL;
3117 const char *pyunit =
NULL;
3122 PyObject *py_tags =
NULL;
3124 static const char *_keywords[] = {
3125 "attr",
"name",
"description",
"default",
"min",
"max",
"soft_min",
3126 "soft_max",
"step",
"precision",
"options",
"override",
"tags",
"subtype",
3127 "unit",
"size",
"update",
"get",
"set",
NULL,
3129 static _PyArg_Parser _parser = {
"s#|ssOfffffiO!O!O!ssiOOO:FloatVectorProperty", _keywords, 0};
3130 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3165 PyErr_Format(PyExc_TypeError,
"FloatVectorProperty(unit='%s'): invalid unit", pyunit);
3179 def, pydef,
size, &PyFloat_Type,
false,
"FloatVectorProperty(default=sequence)") ==
3209 if (pyopts_override) {
3220 ".. function:: StringProperty(name=\"\", "
3221 "description=\"\", "
3224 "options={'ANIMATABLE'}, "
3232 " Returns a new string property definition.\n"
3234 " :arg default: initializer string.\n"
3235 " :type default: string\n"
3236 " :arg maxlen: maximum length of the string.\n"
3247 const char *
id =
NULL, *name =
NULL, *description =
"", *def =
"";
3251 PyObject *pyopts =
NULL;
3253 PyObject *pyopts_override =
NULL;
3254 int opts_override = 0;
3256 const char *pysubtype =
NULL;
3261 PyObject *py_tags =
NULL;
3263 static const char *_keywords[] = {
3278 static _PyArg_Parser _parser = {
"s#|sssiO!O!O!sOOO:StringProperty", _keywords, 0};
3279 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3321 if (def && def[0]) {
3332 if (pyopts_override) {
3343 BPy_EnumProperty_doc,
3344 ".. function:: EnumProperty(items, "
3346 "description=\"\", "
3348 "options={'ANIMATABLE'}, "
3355 " Returns a new enumerator property definition.\n"
3357 " :arg items: sequence of enum items formatted:\n"
3358 " ``[(identifier, name, description, icon, number), ...]``.\n"
3360 " The first three elements of the tuples are mandatory.\n"
3362 " :identifier: The identifier is used for Python access.\n"
3363 " :name: Name for the interface.\n"
3364 " :description: Used for documentation and tooltips.\n"
3365 " :icon: An icon string identifier or integer icon value\n"
3366 " (e.g. returned by :class:`bpy.types.UILayout.icon`)\n"
3367 " :number: Unique value used as the identifier for this item (stored in file data).\n"
3368 " Use when the identifier may need to change. If the *ENUM_FLAG* option is used,\n"
3369 " the values are bitmasks and should be powers of two.\n"
3371 " When an item only contains 4 items they define ``(identifier, name, description, "
3374 " Separators may be added using None instead of a tuple."
3376 " For dynamic values a callback can be passed which returns a list in\n"
3377 " the same format as the static list.\n"
3378 " This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
3382 " There is a known bug with using a callback,\n"
3383 " Python must keep a reference to the strings returned by the callback or Blender\n"
3384 " will misbehave or even crash."
3388 " :arg default: The default value for this enum, a string from the identifiers used in "
3389 "*items*, or integer matching an item number.\n"
3390 " If the *ENUM_FLAG* option is used this must be a set of such string identifiers "
3392 " WARNING: Strings can not be specified for dynamic enums\n"
3393 " (i.e. if a callback function is given as *items* parameter).\n"
3404 const char *
id =
NULL, *name =
NULL, *description =
"";
3405 PyObject *def =
NULL;
3408 PyObject *items, *items_fast;
3411 PyObject *pyopts =
NULL;
3413 PyObject *pyopts_override =
NULL;
3414 int opts_override = 0;
3416 bool is_itemf =
false;
3420 PyObject *py_tags =
NULL;
3422 static const char *_keywords[] = {
3436 static _PyArg_Parser _parser = {
"s#O|ssOO!O!O!OOO:EnumProperty", _keywords, 0};
3437 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3470 if (def == Py_None) {
3477 if (PyFunction_Check(
3479 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items);
3480 if (f_code->co_argcount != 2) {
3481 PyErr_Format(PyExc_ValueError,
3482 "EnumProperty(...): expected 'items' function to take 2 arguments, not %d",
3483 f_code->co_argcount);
3493 "EnumProperty(...): 'default' can only be an integer when 'items' is a function");
3502 if (!(items_fast = PySequence_Fast(
3504 "EnumProperty(...): "
3505 "expected a sequence of tuples for the enum items or a function"))) {
3512 Py_DECREF(items_fast);
3518 prop =
RNA_def_enum_flag(srna,
id, eitems, defvalue, name ? name :
id, description);
3521 prop =
RNA_def_enum(srna,
id, eitems, defvalue, name ? name :
id, description);
3530 if (pyopts_override) {
3537 if (is_itemf ==
false) {
3540 Py_DECREF(items_fast);
3554 if (PyErr_Occurred()) {
3556 const char *msg_char = PyUnicode_AsUTF8(msg);
3558 PyExc_TypeError,
"%.200s expected an RNA type, failed with: %s", error_prefix, msg_char);
3562 PyErr_Format(PyExc_TypeError,
3563 "%.200s expected an RNA type, failed with type '%s'",
3565 Py_TYPE(value)->tp_name);
3574 ".. function:: PointerProperty(type=None, "
3576 "description=\"\", "
3577 "options={'ANIMATABLE'}, "
3583 " Returns a new pointer property definition.\n"
3594 const char *
id =
NULL, *name =
NULL, *description =
"";
3598 PyObject *
type = Py_None;
3599 PyObject *pyopts =
NULL;
3600 PyObject *pyopts_override =
NULL;
3601 PyObject *py_tags =
NULL;
3603 int opts_override = 0;
3607 static const char *_keywords[] = {
3619 static _PyArg_Parser _parser = {
"s#O|ssO!O!O!OO:PointerProperty", _keywords, 0};
3620 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3646 PyErr_Format(PyExc_TypeError,
3647 "PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
3665 if (pyopts_override) {
3682 ".. function:: CollectionProperty(type=None, "
3684 "description=\"\", "
3685 "options={'ANIMATABLE'}, "
3689 " Returns a new collection property definition.\n"
3701 const char *
id =
NULL, *name =
NULL, *description =
"";
3704 PyObject *
type = Py_None;
3705 PyObject *pyopts =
NULL;
3706 PyObject *pyopts_override =
NULL;
3707 PyObject *py_tags =
NULL;
3709 int opts_override = 0;
3712 static const char *_keywords[] = {
3722 static _PyArg_Parser _parser = {
"s#O|ssO!O!O!:CollectionProperty", _keywords, 0};
3723 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3749 PyErr_Format(PyExc_TypeError,
3750 "CollectionProperty(...) expected an RNA type derived from %.200s",
3762 if (pyopts_override) {
3777 ".. function:: RemoveProperty(cls, attr)\n"
3779 " Removes a dynamically defined property.\n"
3781 " :arg cls: The class containing the property (must be a positional argument).\n"
3782 " :type cls: type\n"
3783 " :arg attr: Property name (must be passed as a keyword).\n"
3784 " :type attr: string\n"
3786 ".. note:: Typically this function doesn't need to be accessed directly.\n"
3787 " Instead use ``del cls.attr``\n");
3792 if (PyTuple_GET_SIZE(args) == 1) {
3794 self = PyTuple_GET_ITEM(args, 0);
3795 args = PyTuple_New(0);
3800 if (PyTuple_GET_SIZE(args) > 1) {
3801 PyErr_SetString(PyExc_ValueError,
"expected one positional arg, one keyword arg");
3806 if (srna ==
NULL && PyErr_Occurred()) {
3810 PyErr_SetString(PyExc_TypeError,
"RemoveProperty(): struct rna not available for this type");
3814 const char *
id =
NULL;
3816 static const char *_keywords[] = {
3820 static _PyArg_Parser _parser = {
"s:RemoveProperty", _keywords, 0};
3821 if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &
id)) {
3826 PyErr_Format(PyExc_TypeError,
"RemoveProperty(): '%s' not a defined dynamic property",
id);
3842 METH_VARARGS | METH_KEYWORDS,
3843 BPy_BoolProperty_doc},
3844 {
"BoolVectorProperty",
3846 METH_VARARGS | METH_KEYWORDS,
3847 BPy_BoolVectorProperty_doc},
3850 METH_VARARGS | METH_KEYWORDS,
3851 BPy_IntProperty_doc},
3852 {
"IntVectorProperty",
3854 METH_VARARGS | METH_KEYWORDS,
3855 BPy_IntVectorProperty_doc},
3858 METH_VARARGS | METH_KEYWORDS,
3859 BPy_FloatProperty_doc},
3860 {
"FloatVectorProperty",
3862 METH_VARARGS | METH_KEYWORDS,
3863 BPy_FloatVectorProperty_doc},
3866 METH_VARARGS | METH_KEYWORDS,
3867 BPy_StringProperty_doc},
3870 METH_VARARGS | METH_KEYWORDS,
3871 BPy_EnumProperty_doc},
3874 METH_VARARGS | METH_KEYWORDS,
3875 BPy_PointerProperty_doc},
3876 {
"CollectionProperty",
3878 METH_VARARGS | METH_KEYWORDS,
3879 BPy_CollectionProperty_doc},
3883 METH_VARARGS | METH_KEYWORDS,
3884 BPy_RemoveProperty_doc},
3891 PyObject **py_data = (PyObject **)&prop_store->py_data;
3893 Py_VISIT(py_data[i]);
3902 PyObject **py_data = (PyObject **)&prop_store->py_data;
3904 Py_CLEAR(py_data[i]);
3911 PyModuleDef_HEAD_INIT,
3913 "This module defines properties to extend Blender's internal data. The result of these "
3915 " is used to assign properties to classes registered with Blender and can't be used "
3918 ".. note:: All parameters to these functions must be passed as keywords.\n",
3929 PyObject *submodule;
3930 PyObject *submodule_dict;
3933 PyDict_SetItemString(PyImport_GetModuleDict(),
props_module.m_name, submodule);
3936 submodule_dict = PyModule_GetDict(submodule);
3938 #define ASSIGN_STATIC(_name) pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
ID and Library types, which are fundamental for sdna.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier)
void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA *prop)
void RNA_def_property_free_pointers_set_py_data_callback(void(*py_data_clear_fn)(PropertyRNA *prop))
int(* EnumPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
float(* FloatPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
@ STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES
void(* IntPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
void(* EnumPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
#define RNA_ENUM_BITFLAG_SIZE
void(* IntArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values)
void(* FloatPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float value)
struct EnumPropertyItem EnumPropertyItem
void(* BooleanArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const bool *values)
void(* FloatArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values)
bool(* BooleanPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
void(* BooleanArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool *values)
void(* StringPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value)
void(* StringPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_LIBRARY_INSERTION
@ PROPOVERRIDE_NO_PROP_NAME
void(* IntArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values)
int(* StringPropertyLengthFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
int(* IntPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
const EnumPropertyItem *(* EnumPropertyItemFunc)(struct bContext *C, PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
@ PROP_CONTEXT_PROPERTY_UPDATE
void(* FloatArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values)
void(* BooleanPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool value)
void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate)
void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate)
#define BPY_PROPDEF_SUBTYPE_STRING_DOC
void BPY_rna_props_clear_all(void)
static bool bpy_prop_boolean_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static PyObject * pymeth_FloatProperty
static const EnumPropertyItem property_subtype_array_items[]
#define BPY_PROPDEF_NUM_MIN_DOC
#define ASSIGN_PYOBJECT_INCREF(a, b)
static int bpy_prop_enum_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static void bpy_prop_callback_assign_string(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static const EnumPropertyItem property_flag_override_items[]
static PyObject * BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC
static void bpy_prop_callback_assign_pointer(struct PropertyRNA *prop, PyObject *poll_fn)
static bool py_long_as_int(PyObject *py_long, int *r_int)
static struct PyModuleDef props_module
static const EnumPropertyItem property_flag_enum_items[]
static void bpy_prop_float_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, float value)
PyObject * BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_NAME_DOC
#define BPY_PROPDEF_HEAD(_func)
static PyGetSetDef bpy_prop_deferred_getset[]
PyObject * BPY_rna_props(void)
static void bpy_prop_int_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values)
static void bpy_prop_string_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value)
#define BPY_PROPDEF_FLOAT_STEP_DOC
static PyObject * pymeth_IntVectorProperty
PyDoc_STRVAR(bpy_prop_deferred_doc, "Intermediate storage for properties before registration.\n" "\n" ".. note::\n" "\n" " This is not part of the stable API and may change between releases.")
#define BPY_PROPDEF_UPDATE_DOC
static PyObject * pymeth_EnumProperty
#define BPY_PROPDEF_GET_DOC
static struct BPyPropStore * bpy_prop_py_data_ensure(struct PropertyRNA *prop)
static void bpy_prop_callback_assign_update(struct PropertyRNA *prop, PyObject *update_fn)
static PyObject * bpy_prop_deferred_function_get(BPy_PropDeferred *self, void *UNUSED(closure))
static void bpy_prop_callback_assign_float(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static void bpy_prop_enum_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
static int bpy_prop_deferred_clear(BPy_PropDeferred *self)
static const EnumPropertyItem property_flag_items[]
static void bpy_prop_py_data_remove(PropertyRNA *prop)
static void bpy_prop_boolean_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, bool value)
#define BPY_PROPDEF_NUM_SOFTMIN_DOC
static void bpy_prop_boolean_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const bool *values)
static int props_visit(PyObject *UNUSED(self), visitproc visit, void *arg)
#define BPY_PROPDEF_FLOAT_PREC_DOC
#define BPY_PROPDEF_POLL_DOC
static PyObject * pymeth_FloatVectorProperty
static bool bpy_prop_pointer_poll_fn(struct PointerRNA *self, PointerRNA candidate, struct PropertyRNA *prop)
static PyObject * pymeth_IntProperty
static const EnumPropertyItem property_flag_override_collection_items[]
static int props_clear(PyObject *UNUSED(self))
static const EnumPropertyItem * bpy_prop_enum_itemf_fn(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static PyObject * bpy_prop_deferred_data_CreatePyObject(PyObject *fn, PyObject *kw)
static PyObject * BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
static const EnumPropertyItem property_subtype_number_items[]
StructRNA * pointer_type_from_py(PyObject *value, const char *error_prefix)
static void bpy_prop_callback_assign_boolean(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static PyObject * BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
#define BPY_PROPDEF_CHECK(_func, _property_flag_items, _property_flag_override_items)
static void bpy_prop_update_fn(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop)
static PyObject * pymeth_RemoveProperty
static PyObject * BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static int icon_id_from_name(const char *name)
PyObject * BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * pymeth_CollectionProperty
static int bpy_prop_int_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static void bpy_prop_assign_flag(PropertyRNA *prop, const int flag)
#define BPY_PROPDEF_TAGS_DOC
static void bpy_prop_float_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values)
static int bpy_prop_deferred_traverse(BPy_PropDeferred *self, visitproc visit, void *arg)
#define BPY_PROP_STORE_PY_DATA_SIZE
static void bpy_prop_string_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value)
static void bpy_prop_int_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values)
static PyObject * pymeth_PointerProperty
static void bpy_prop_callback_assign_int_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define BPY_PROPDEF_OPTIONS_DOC
static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *itemf_fn)
static PyObject * pyrna_struct_as_instance(PointerRNA *ptr)
static void bpy_prop_callback_assign_int(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static const EnumPropertyItem * enum_items_from_py(PyObject *seq_fast, PyObject *def, int *defvalue, const bool is_enum_flag)
#define BPY_PROPDEF_NUM_SOFTMAX_DOC
static void bpy_prop_int_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
static void bpy_prop_boolean_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, bool *values)
static struct PyMethodDef props_methods[]
static void bpy_prop_callback_assign_float_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static PyObject * BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * pymeth_BoolProperty
static const EnumPropertyItem property_subtype_string_items[]
#define BPY_PROPDEF_OPTIONS_ENUM_DOC
#define BPY_PROPDEF_SUBTYPE_CHECK(_func, _property_flag_items, _property_flag_override_items, _subtype)
#define BPY_PROPDEF_UNIT_DOC
#define BPY_PROPDEF_NUM_MAX_DOC
#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC
static PyObject * bpy_prop_deferred_keywords_get(BPy_PropDeferred *self, void *UNUSED(closure))
static float bpy_prop_float_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static int bpy_prop_callback_check(PyObject *py_func, const char *keyword, int argcount)
static void bpy_prop_callback_assign_boolean_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define ASSIGN_STATIC(_name)
static int bpy_prop_string_length_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
#define BPY_PROPDEF_VECSIZE_DOC
#define BPY_PROPDEF_TYPE_DOC
static void bpy_prop_float_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values)
static PyObject * bpy_prop_deferred_call(BPy_PropDeferred *UNUSED(self), PyObject *UNUSED(args), PyObject *UNUSED(kw))
#define BPY_PROPDEF_SUBTYPE_ARRAY_DOC
#define BPY_PROPDEF_INT_STEP_DOC
#define BPY_PROPDEF_DESC_DOC
PyTypeObject bpy_prop_deferred_Type
static PyObject * pymeth_BoolVectorProperty
static PyObject * BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
static ListBase g_bpy_prop_store_list
static void bpy_prop_assign_flag_override(PropertyRNA *prop, const int flag_override)
#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
static PyObject * pymeth_StringProperty
static PyObject * bpy_prop_deferred_repr(BPy_PropDeferred *self)
static PyObject * BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_SET_DOC
#define PYRNA_STACK_ARRAY
bool pyrna_write_check(void)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
StructRNA * srna_from_self(PyObject *self, const char *error_prefix)
void pyrna_write_set(bool val)
BPy_StructRNA * bpy_context_module
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
PyObject * PyC_Tuple_PackArray_Bool(const bool *array, uint len)
PyObject * PyC_ExceptionBuffer(void)
int PyC_Long_AsBool(PyObject *value)
PyObject * PyC_Tuple_PackArray_F32(const float *array, uint len)
PyObject * PyC_Tuple_PackArray_I32(const int *array, uint len)
void PyC_Err_PrintWithFunc(PyObject *py_func)
int PyC_ParseBool(PyObject *o, void *p)
int PyC_AsArray(void *array, PyObject *value, const Py_ssize_t length, const PyTypeObject *type, const bool is_double, const char *error_prefix)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void ** RNA_struct_instance(PointerRNA *ptr)
bool RNA_struct_is_ID(const StructRNA *type)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
const char * RNA_struct_ui_name(const StructRNA *type)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
void * RNA_property_py_data_get(PropertyRNA *prop)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_struct_flag(StructRNA *srna, int flag)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_int_funcs_runtime(PropertyRNA *prop, IntPropertyGetFunc getfunc, IntPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_funcs_runtime(PropertyRNA *prop, EnumPropertyGetFunc getfunc, EnumPropertySetFunc setfunc, EnumPropertyItemFunc itemfunc)
void RNA_def_property_boolean_array_funcs_runtime(PropertyRNA *prop, BooleanArrayPropertyGetFunc getfunc, BooleanArrayPropertySetFunc setfunc)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_py_data(PropertyRNA *prop, void *py_data)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_poll_runtime(PropertyRNA *prop, const void *func)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_float_funcs_runtime(PropertyRNA *prop, FloatPropertyGetFunc getfunc, FloatPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
void RNA_def_property_int_array_funcs_runtime(PropertyRNA *prop, IntArrayPropertyGetFunc getfunc, IntArrayPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc)
void RNA_def_property_float_array_funcs_runtime(PropertyRNA *prop, FloatArrayPropertyGetFunc getfunc, FloatArrayPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_update_runtime(PropertyRNA *prop, const void *func)
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const bool *array)
void RNA_def_property_boolean_funcs_runtime(PropertyRNA *prop, BooleanPropertyGetFunc getfunc, BooleanPropertySetFunc setfunc)
PropertyRNA * RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *identifier, int len, bool *default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_tags(PropertyRNA *prop, int tags)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_string_funcs_runtime(PropertyRNA *prop, StringPropertyGetFunc getfunc, StringPropertyLengthFunc lengthfunc, StringPropertySetFunc setfunc)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
StructRNA RNA_PropertyGroup
const EnumPropertyItem rna_enum_property_unit_items[]
const EnumPropertyItem DummyRNA_NULL_items[]
const EnumPropertyItem rna_enum_icon_items[]
struct BPyPropStore::@1122::@1123::@1126 pointer_data
struct BPyPropStore::@1122 py_data
struct BPyPropStore * prev
struct BPyPropStore::@1122::@1123::@1125 enum_data
struct BPyPropStore * next