14#define PY_SSIZE_T_CLEAN
33#include "RNA_prototypes.hh"
54#define BPY_PROPDEF_OPTIONS_DOC \
55 " :arg options: Enumerator in :ref:`rna_enum_property_flag_items`.\n" \
56 " :type options: set[str]\n"
58#define BPY_PROPDEF_OPTIONS_ENUM_DOC \
59 " :arg options: Enumerator in :ref:`rna_enum_property_flag_enum_items`.\n" \
60 " :type options: set[str]\n"
62#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC \
63 " :arg override: Enumerator in :ref:`rna_enum_property_override_flag_items`.\n" \
64 " :type override: set[str]\n"
66#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC \
67 " :arg override: Enumerator in :ref:`rna_enum_property_override_flag_collection_items`.\n" \
68 " :type override: set[str]\n"
70#define BPY_PROPDEF_SUBTYPE_STRING_DOC \
71 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_string_items`.\n" \
72 " :type subtype: str\n"
74#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC \
75 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_items`.\n" \
76 " :type subtype: str\n"
78#define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC \
79 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_array_items`.\n" \
80 " :type subtype: str\n"
157#define BPY_PROP_STORE_PY_DATA_SIZE (sizeof(BPyPropStore::py_data) / sizeof(PyObject *))
159#define ASSIGN_PYOBJECT_INCREF(a, b) \
161 BLI_assert((a) == nullptr); \
176 if (prop_store ==
nullptr) {
190 if (prop_store ==
nullptr) {
194 PyObject **py_data = (PyObject **)&prop_store->
py_data;
196 Py_XDECREF(py_data[i]);
213 PyObject_GC_UnTrack(
self);
215 PyObject_GC_Del(
self);
232 return PyUnicode_FromFormat(
"<%.200s, %R, %R>", Py_TYPE(
self)->tp_name,
self->fn,
self->kw);
257 PyObject *
ret =
static_cast<PyObject *
>(
self->fn);
276 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
281 bpy_prop_deferred_doc,
282 "Intermediate storage for properties before registration.\n"
286 " This is not part of the stable API and may change between releases.");
289 PyVarObject_HEAD_INIT(
nullptr, 0)
308 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
309 bpy_prop_deferred_doc,
352 PyObject_GC_Track(
self);
353 return (PyObject *)
self;
377 PyObject *
self =
nullptr;
385 self =
static_cast<PyObject *
>(*instance);
392 if (
self ==
nullptr) {
437 if (PyLong_CheckExact(o)) {
439 if ((size = PyLong_AsLong(o)) == -1) {
441 PyExc_ValueError,
"expected number or sequence of numbers, got %s", Py_TYPE(o)->tp_name);
456 if (!(seq_fast = PySequence_Fast(o,
"size must be a number of a sequence of numbers"))) {
459 const int seq_len = PySequence_Fast_GET_SIZE(seq_fast);
469 PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast);
471 for (
int i = 0; i < seq_len; i++) {
473 if ((size = PyLong_AsLong(seq_items[i])) == -1) {
475 PyErr_Format(PyExc_ValueError,
476 "expected number in sequence, got %s at index %d",
483 PyErr_Format(PyExc_TypeError,
502 size_t values_elem_size,
505 const PyTypeObject *type,
506 const char *error_str)
508 if (array_len_info->
dims_len == 0) {
510 values, values_elem_size, py_values, array_len_info->
len_total, type, error_str);
512 const int *dims = array_len_info->
dims;
513 const int dims_len = array_len_info->
dims_len;
514 return PyC_AsArray_Multi(values, values_elem_size, py_values, dims, dims_len, type, error_str);
521 ((array_len_info->
dims[0] >= 2) && (array_len_info->
dims[0] >= 4)) &&
522 ((array_len_info->
dims[1] >= 2) && (array_len_info->
dims[1] >= 4)));
536 const float *values_src,
540 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
542 for (
int i = 0; i < dim0; i++) {
543 for (
int j = 0; j < dim1; j++) {
544 values_dst[(j * dim0) + i] = values_src[(i * dim1) + j];
552 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
554 float values_orig[4 * 4];
555 memcpy(values_orig, values,
sizeof(
float) * (dim0 * dim1));
571 PyGILState_STATE gilstate;
588 args = PyTuple_New(2);
590 PyTuple_SET_ITEM(args, 0,
self);
595 ret = PyObject_CallObject(py_func, args);
599 if (
ret ==
nullptr) {
603 if (
ret != Py_None) {
604 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
631 PyGILState_STATE gilstate;
645 gilstate = PyGILState_Ensure();
650 args = PyTuple_New(1);
652 PyTuple_SET_ITEM(args, 0,
self);
654 ret = PyObject_CallObject(py_func, args);
658 if (
ret ==
nullptr) {
665 if (value_i == -1 && PyErr_Occurred()) {
670 value = bool(value_i);
677 PyGILState_Release(gilstate);
694 PyGILState_STATE gilstate;
707 gilstate = PyGILState_Ensure();
712 args = PyTuple_New(2);
714 PyTuple_SET_ITEM(args, 0,
self);
716 PyTuple_SET_ITEM(args, 1, PyBool_FromLong(value));
718 ret = PyObject_CallObject(py_func, args);
722 if (
ret ==
nullptr) {
726 if (
ret != Py_None) {
727 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
735 PyGILState_Release(gilstate);
750 PyGILState_STATE gilstate;
753 bool is_values_set =
false;
768 gilstate = PyGILState_Ensure();
773 args = PyTuple_New(1);
775 PyTuple_SET_ITEM(args, 0,
self);
777 ret = PyObject_CallObject(py_func, args);
781 if (
ret !=
nullptr) {
787 "BoolVectorProperty get callback") == -1)
792 is_values_set =
true;
797 if (is_values_set ==
false) {
799 for (i = 0; i <
len; i++) {
805 PyGILState_Release(gilstate);
821 PyGILState_STATE gilstate;
838 gilstate = PyGILState_Ensure();
843 args = PyTuple_New(2);
845 PyTuple_SET_ITEM(args, 0,
self);
847 if (array_len_info.dims_len == 0) {
852 values, array_len_info.dims, array_len_info.dims_len);
854 PyTuple_SET_ITEM(args, 1, py_values);
856 ret = PyObject_CallObject(py_func, args);
860 if (
ret ==
nullptr) {
864 if (
ret != Py_None) {
865 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
873 PyGILState_Release(gilstate);
894 PyGILState_STATE gilstate;
908 gilstate = PyGILState_Ensure();
913 args = PyTuple_New(1);
915 PyTuple_SET_ITEM(args, 0,
self);
917 ret = PyObject_CallObject(py_func, args);
921 if (
ret ==
nullptr) {
926 value = PyC_Long_AsI32(
ret);
928 if (value == -1 && PyErr_Occurred()) {
937 PyGILState_Release(gilstate);
954 PyGILState_STATE gilstate;
967 gilstate = PyGILState_Ensure();
972 args = PyTuple_New(2);
974 PyTuple_SET_ITEM(args, 0,
self);
976 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
978 ret = PyObject_CallObject(py_func, args);
982 if (
ret ==
nullptr) {
986 if (
ret != Py_None) {
987 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
995 PyGILState_Release(gilstate);
1010 PyGILState_STATE gilstate;
1013 bool is_values_set =
false;
1028 gilstate = PyGILState_Ensure();
1033 args = PyTuple_New(1);
1035 PyTuple_SET_ITEM(args, 0,
self);
1037 ret = PyObject_CallObject(py_func, args);
1041 if (
ret !=
nullptr) {
1047 "IntVectorProperty get callback") == -1)
1052 is_values_set =
true;
1057 if (is_values_set ==
false) {
1059 for (i = 0; i <
len; i++) {
1065 PyGILState_Release(gilstate);
1080 PyObject *py_values;
1081 PyGILState_STATE gilstate;
1098 gilstate = PyGILState_Ensure();
1103 args = PyTuple_New(2);
1105 PyTuple_SET_ITEM(args, 0,
self);
1107 if (array_len_info.dims_len == 0) {
1112 values, array_len_info.dims, array_len_info.dims_len);
1115 PyTuple_SET_ITEM(args, 1, py_values);
1117 ret = PyObject_CallObject(py_func, args);
1121 if (
ret ==
nullptr) {
1125 if (
ret != Py_None) {
1126 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1134 PyGILState_Release(gilstate);
1155 PyGILState_STATE gilstate;
1169 gilstate = PyGILState_Ensure();
1174 args = PyTuple_New(1);
1176 PyTuple_SET_ITEM(args, 0,
self);
1178 ret = PyObject_CallObject(py_func, args);
1182 if (
ret ==
nullptr) {
1187 value = PyFloat_AsDouble(
ret);
1189 if (value == -1.0f && PyErr_Occurred()) {
1198 PyGILState_Release(gilstate);
1215 PyGILState_STATE gilstate;
1228 gilstate = PyGILState_Ensure();
1233 args = PyTuple_New(2);
1235 PyTuple_SET_ITEM(args, 0,
self);
1237 PyTuple_SET_ITEM(args, 1, PyFloat_FromDouble(value));
1239 ret = PyObject_CallObject(py_func, args);
1243 if (
ret ==
nullptr) {
1247 if (
ret != Py_None) {
1248 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1256 PyGILState_Release(gilstate);
1271 PyGILState_STATE gilstate;
1274 bool is_values_set =
false;
1289 gilstate = PyGILState_Ensure();
1294 args = PyTuple_New(1);
1296 PyTuple_SET_ITEM(args, 0,
self);
1298 ret = PyObject_CallObject(py_func, args);
1302 if (
ret !=
nullptr) {
1308 "FloatVectorProperty get callback") == -1)
1317 is_values_set =
true;
1322 if (is_values_set ==
false) {
1324 for (i = 0; i <
len; i++) {
1330 PyGILState_Release(gilstate);
1345 PyObject *py_values;
1346 PyGILState_STATE gilstate;
1363 gilstate = PyGILState_Ensure();
1368 args = PyTuple_New(2);
1370 PyTuple_SET_ITEM(args, 0,
self);
1372 if (array_len_info.dims_len == 0) {
1378 values, array_len_info.dims, array_len_info.dims_len);
1380 PyTuple_SET_ITEM(args, 1, py_values);
1382 ret = PyObject_CallObject(py_func, args);
1386 if (
ret ==
nullptr) {
1390 if (
ret != Py_None) {
1391 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1399 PyGILState_Release(gilstate);
1420 PyGILState_STATE gilstate;
1433 gilstate = PyGILState_Ensure();
1438 args = PyTuple_New(1);
1440 PyTuple_SET_ITEM(args, 0,
self);
1442 ret = PyObject_CallObject(py_func, args);
1446 if (
ret ==
nullptr) {
1450 else if (!PyUnicode_Check(
ret)) {
1452 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1459 const char *buffer = PyUnicode_AsUTF8AndSize(
ret, &length);
1460 memcpy(value, buffer, length + 1);
1465 PyGILState_Release(gilstate);
1480 PyGILState_STATE gilstate;
1494 gilstate = PyGILState_Ensure();
1499 args = PyTuple_New(1);
1501 PyTuple_SET_ITEM(args, 0,
self);
1503 ret = PyObject_CallObject(py_func, args);
1507 if (
ret ==
nullptr) {
1511 else if (!PyUnicode_Check(
ret)) {
1513 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1519 Py_ssize_t length_ssize = 0;
1520 PyUnicode_AsUTF8AndSize(
ret, &length_ssize);
1521 length = length_ssize;
1526 PyGILState_Release(gilstate);
1543 PyGILState_STATE gilstate;
1557 gilstate = PyGILState_Ensure();
1562 args = PyTuple_New(2);
1564 PyTuple_SET_ITEM(args, 0,
self);
1566 py_value = PyUnicode_FromString(value);
1568 PyErr_SetString(PyExc_ValueError,
"the return value must be a string");
1572 PyTuple_SET_ITEM(args, 1, py_value);
1575 ret = PyObject_CallObject(py_func, args);
1579 if (
ret ==
nullptr) {
1583 if (
ret != Py_None) {
1584 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1592 PyGILState_Release(gilstate);
1606 const char *info =
nullptr;
1608 if (PyTuple_CheckExact(item)) {
1610 static const char *_keywords[] = {
1615 static _PyArg_Parser _parser = {
1623 if (!_PyArg_ParseTupleAndKeywordsFast(item,
nullptr, &_parser, &text, &info)) {
1629 text = PyUnicode_AsUTF8(item);
1632 PyErr_Format(PyExc_TypeError,
1633 "expected sequence of strings or tuple pairs of strings, not %.200s",
1634 Py_TYPE(item)->tp_name);
1641 visit_params.
text = text;
1642 visit_params.info = info ? info :
"";
1643 visit_fn(visit_params);
1651 const char *edit_text,
1659 PyGILState_STATE gilstate;
1660 PyObject *py_edit_text;
1668 gilstate = PyGILState_Ensure();
1673 args = PyTuple_New(3);
1675 PyTuple_SET_ITEM(args, 0,
self);
1680 py_edit_text = PyUnicode_FromString(edit_text);
1681 PyTuple_SET_ITEM(args, 2, py_edit_text);
1683 ret = PyObject_CallObject(py_func, args);
1687 if (
ret ==
nullptr) {
1691 if (PyIter_Check(
ret)) {
1694 PyObject *(*iternext)(PyObject *);
1695 it = PyObject_GetIter(
ret);
1696 if (it ==
nullptr) {
1700 iternext = *Py_TYPE(it)->tp_iternext;
1702 PyObject *py_text = iternext(it);
1703 if (py_text ==
nullptr) {
1713 if (PyErr_Occurred()) {
1714 if (PyErr_ExceptionMatches(PyExc_StopIteration)) {
1725 PyObject *ret_fast = PySequence_Fast(
1727 "StringProperty(...): "
1728 "return value from search callback was not a sequence, iterator or generator");
1729 if (ret_fast ==
nullptr) {
1733 const Py_ssize_t ret_num = PySequence_Fast_GET_SIZE(ret_fast);
1734 PyObject **ret_fast_items = PySequence_Fast_ITEMS(ret_fast);
1735 for (Py_ssize_t i = 0; i < ret_num; i++) {
1741 Py_DECREF(ret_fast);
1752 PyGILState_Release(gilstate);
1766 PyObject *py_candidate;
1772 const PyGILState_STATE gilstate = PyGILState_Ensure();
1784 args = PyTuple_New(2);
1785 PyTuple_SET_ITEM(args, 0, py_self);
1786 PyTuple_SET_ITEM(args, 1, py_candidate);
1788 ret = PyObject_CallObject(py_func, args);
1792 if (
ret ==
nullptr) {
1797 result = PyObject_IsTrue(
ret);
1801 PyGILState_Release(gilstate);
1822 PyGILState_STATE gilstate;
1836 gilstate = PyGILState_Ensure();
1841 args = PyTuple_New(1);
1843 PyTuple_SET_ITEM(args, 0,
self);
1845 ret = PyObject_CallObject(py_func, args);
1849 if (
ret ==
nullptr) {
1854 value = PyC_Long_AsI32(
ret);
1856 if (value == -1 && PyErr_Occurred()) {
1865 PyGILState_Release(gilstate);
1882 PyGILState_STATE gilstate;
1895 gilstate = PyGILState_Ensure();
1900 args = PyTuple_New(2);
1902 PyTuple_SET_ITEM(args, 0,
self);
1904 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
1906 ret = PyObject_CallObject(py_func, args);
1910 if (
ret ==
nullptr) {
1914 if (
ret != Py_None) {
1915 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1923 PyGILState_Release(gilstate);
1934 if (PyLong_CheckExact(py_long)) {
1935 *r_int =
int(PyLong_AS_LONG(py_long));
1942#ifdef USE_ENUM_COPY_STRINGS
1944static size_t strswapbufcpy(
char *buf,
const char **orig)
1946 const char *src = *orig;
1950 while ((*dst = *src)) {
1976 const bool is_enum_flag,
1977 PyObject *default_py,
1978 int *r_default_value)
1982 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
1983 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
1985#ifdef USE_ENUM_COPY_STRINGS
1986 Py_ssize_t totbuf = 0;
1988 short default_used = 0;
1989 const char *default_str_cmp =
nullptr;
1990 int default_int_cmp = 0;
1994 PyErr_SetString(PyExc_TypeError,
1995 "EnumProperty(...): maximum " STRINGIFY(
1999 if (default_py && !PySet_Check(default_py)) {
2000 PyErr_Format(PyExc_TypeError,
2001 "EnumProperty(...): default option must be a 'set' "
2002 "type when ENUM_FLAG is enabled, not a '%.200s'",
2003 Py_TYPE(default_py)->tp_name);
2010 default_str_cmp = PyUnicode_AsUTF8(default_py);
2011 if (default_str_cmp ==
nullptr) {
2012 PyErr_Format(PyExc_TypeError,
2013 "EnumProperty(...): default option must be a 'str' or 'int' "
2014 "type when ENUM_FLAG is disabled, not a '%.200s'",
2015 Py_TYPE(default_py)->tp_name);
2023 *r_default_value = 0;
2028 for (i = 0; i < seq_len; i++) {
2030 const char *tmp_icon =
nullptr;
2031 Py_ssize_t item_size;
2032 Py_ssize_t id_str_len;
2033 Py_ssize_t name_str_len;
2034 Py_ssize_t desc_str_len;
2036 item = seq_fast_items[i];
2038 if (PyTuple_CheckExact(item) && (item_size = PyTuple_GET_SIZE(item)) &&
2039 (item_size >= 3 && item_size <= 5) &&
2040 (tmp.
identifier = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 0), &id_str_len)) &&
2041 (tmp.
name = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 1), &name_str_len)) &&
2042 (tmp.
description = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 2), &desc_str_len)) &&
2046 (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) &&
2050 if (item_size < 4) {
2054 if (default_py && PySet_Contains(default_py, PyTuple_GET_ITEM(item, 0))) {
2055 *r_default_value |= tmp.
value;
2060 if (item_size < 4) {
2064 if (default_py && default_used == 0) {
2065 if ((default_str_cmp !=
nullptr &&
STREQ(default_str_cmp, tmp.
identifier)) ||
2066 (default_str_cmp ==
nullptr && default_int_cmp == tmp.
value))
2068 *r_default_value = tmp.
value;
2080#ifdef USE_ENUM_COPY_STRINGS
2082 totbuf += id_str_len + name_str_len + desc_str_len + 3;
2085 else if (item == Py_None) {
2091 PyErr_SetString(PyExc_TypeError,
2092 "EnumProperty(...): expected a tuple containing "
2093 "(identifier, name, description) and optionally an "
2094 "icon name and unique number");
2101 if (default_py && default_used != PySet_GET_SIZE(default_py)) {
2104 PyErr_Format(PyExc_TypeError,
2105 "EnumProperty(..., default={...}): set has %d unused member(s)",
2106 PySet_GET_SIZE(default_py) - default_used);
2111 if (default_py && default_used == 0) {
2114 if (default_str_cmp) {
2115 PyErr_Format(PyExc_TypeError,
2116 "EnumProperty(..., default=\'%s\'): not found in enum members",
2120 PyErr_Format(PyExc_TypeError,
2121 "EnumProperty(..., default=%d): not found in enum members",
2128#ifdef USE_ENUM_COPY_STRINGS
2133 (
sizeof(
char) * totbuf),
2134 "enum_items_from_py2");
2136 char *buf = ((
char *)items_dup) + (
sizeof(
EnumPropertyItem) * (seq_len + 1));
2138 for (i = 0; i < seq_len; i++, items_ptr++) {
2139 buf += strswapbufcpy(buf, &items_ptr->
identifier);
2140 buf += strswapbufcpy(buf, &items_ptr->
name);
2141 buf += strswapbufcpy(buf, &items_ptr->
description);
2157 PyGILState_STATE gilstate;
2160 PyObject *
self =
nullptr;
2171 gilstate = PyGILState_Ensure();
2174 args = PyTuple_New(2);
2176 PyTuple_SET_ITEM(args, 0,
self);
2184 PyTuple_SET_ITEM(args, 1, Py_None);
2188 items = PyObject_CallObject(py_func, args);
2192 if (items ==
nullptr) {
2196 PyObject *items_fast;
2197 int default_value_dummy = 0;
2199 if (!(items_fast = PySequence_Fast(items,
2200 "EnumProperty(...): "
2201 "return value from the callback was not a sequence")))
2209 &default_value_dummy);
2211 Py_DECREF(items_fast);
2234 PyGILState_Release(gilstate);
2242 if (py_func && py_func != Py_None) {
2243 if (!PyFunction_Check(py_func)) {
2244 PyErr_Format(PyExc_TypeError,
2245 "%s keyword: expected a function type, not a %.200s",
2247 Py_TYPE(py_func)->tp_name);
2251 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(py_func);
2252 if (f_code->co_argcount != argcount) {
2253 PyErr_Format(PyExc_TypeError,
2254 "%s keyword: expected a function taking %d arguments, not %d",
2257 f_code->co_argcount);
2274 if (update_fn && update_fn != Py_None) {
2284 if (poll_fn && poll_fn != Py_None) {
2297 if (get_fn && get_fn != Py_None) {
2304 if (set_fn && set_fn != Py_None) {
2321 if (get_fn && get_fn != Py_None) {
2328 if (set_fn && set_fn != Py_None) {
2343 if (get_fn && get_fn != Py_None) {
2350 if (set_fn && set_fn != Py_None) {
2367 if (get_fn && get_fn != Py_None) {
2374 if (set_fn && set_fn != Py_None) {
2389 if (get_fn && get_fn != Py_None) {
2396 if (set_fn && set_fn != Py_None) {
2413 if (get_fn && get_fn != Py_None) {
2420 if (set_fn && set_fn != Py_None) {
2433 PyObject *search_fn,
2441 if (get_fn && get_fn != Py_None) {
2449 if (set_fn && set_fn != Py_None) {
2463 if (rna_search_fn) {
2477 if (get_fn && get_fn != Py_None) {
2484 if (set_fn && set_fn != Py_None) {
2491 if (itemf_fn && itemf_fn != Py_None) {
2522 PyObject *method_object,
2523 PyObject **r_deferred_result)
2526 BLI_assert(PyCFunction_CheckExact(method_object));
2528 const int args_len = PyTuple_GET_SIZE(args);
2529 PyMethodDef *method_def = ((PyCFunctionObject *)method_object)->m_ml;
2532 if (args_len == 1) {
2533 self = PyTuple_GET_ITEM(args, 0);
2534 args = PyTuple_New(0);
2537 PyCFunctionWithKeywords method_fn = (PyCFunctionWithKeywords)(
void *)method_def->ml_meth;
2538 *r_deferred_result = method_fn(
self, args, kw);
2544 const char *error_prefix = method_def->ml_name;
2546 PyErr_Format(PyExc_ValueError,
"%s: all args must be keywords", error_prefix);
2547 *r_deferred_result =
nullptr;
2553 if (srna ==
nullptr) {
2554 *r_deferred_result = PyErr_Occurred() ?
2563 *r_deferred_result = (PyObject *)
intptr_t(1);
2590 if (!PyUnicode_Check(o)) {
2591 PyErr_Format(PyExc_TypeError,
"expected a string (got %.200s)", Py_TYPE(o)->tp_name);
2598 id = PyUnicode_AsUTF8AndSize(o, &id_len);
2600 PyErr_Format(PyExc_TypeError,
"'%.200s' too long, max length is %d",
id,
MAX_IDPROP_NAME - 1);
2608 PyErr_Format(PyExc_TypeError,
2609 "'%s' is defined as a non-dynamic type for '%s'",
2614 parse_data->
value = id;
2634 if (parse_data->
base.
items ==
nullptr) {
2635 PyErr_Format(PyExc_TypeError,
2636 "property-tags not available for '%s'",
2649#define BPY_PROPDEF_NAME_DOC \
2650 " :arg name: Name used in the user interface.\n" \
2651 " :type name: str\n"
2653#define BPY_PROPDEF_DESC_DOC \
2654 " :arg description: Text used for the tooltip and api documentation.\n" \
2655 " :type description: str\n"
2657#define BPY_PROPDEF_CTXT_DOC \
2658 " :arg translation_context: Text used as context to disambiguate translations.\n" \
2659 " :type translation_context: str\n"
2661#define BPY_PROPDEF_UNIT_DOC \
2662 " :arg unit: Enumerator in :ref:`rna_enum_property_unit_items`.\n" \
2663 " :type unit: str\n"
2665#define BPY_PROPDEF_NUM_MIN_DOC_(ty) \
2666 " :arg min: Hard minimum, trying to assign a value below will silently assign this minimum " \
2668 " :type min: " ty "\n"
2670#define BPY_PROPDEF_NUM_MAX_DOC_(ty) \
2671 " :arg max: Hard maximum, trying to assign a value above will silently assign this maximum " \
2673 " :type max: " ty "\n"
2675#define BPY_PROPDEF_NUM_MINMAX_DOC(ty) BPY_PROPDEF_NUM_MIN_DOC_(ty) BPY_PROPDEF_NUM_MAX_DOC_(ty)
2677#define BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) \
2678 " :arg soft_min: Soft minimum (>= *min*), " \
2679 "user won't be able to drag the widget below this value in the UI.\n" \
2680 " :type soft_min: " ty "\n"
2682#define BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty) \
2683 " :arg soft_max: Soft maximum (<= *max*), " \
2684 "user won't be able to drag the widget above this value in the UI.\n" \
2685 " :type soft_max: " ty "\n"
2687#define BPY_PROPDEF_NUM_SOFT_MINMAX_DOC(ty) \
2688 BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty)
2690#define BPY_PROPDEF_VECSIZE_DOC \
2691 " :arg size: Vector dimensions in [1, " STRINGIFY(PYRNA_STACK_ARRAY) "]. " \
2692"An int sequence can be used to define multi-dimension arrays.\n" \
2693" :type size: int | Sequence[int]\n"
2695#define BPY_PROPDEF_INT_STEP_DOC \
2696 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 1 (WARNING: unused " \
2698 " :type step: int\n"
2700#define BPY_PROPDEF_FLOAT_STEP_DOC \
2701 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 3 (WARNING: actual " \
2702 "value is /100).\n" \
2703 " :type step: int\n"
2705#define BPY_PROPDEF_FLOAT_PREC_DOC \
2706 " :arg precision: Maximum number of decimal digits to display, in [0, 6]. Fraction is " \
2707 "automatically hidden for exact integer values of fields with unit 'NONE' or 'TIME' (frame " \
2708 "count) and step divisible by 100.\n" \
2709 " :type precision: int\n"
2711#define BPY_PROPDEF_UPDATE_DOC \
2712 " :arg update: Function to be called when this value is modified,\n" \
2713 " This function must take 2 values (self, context) and return None.\n" \
2714 " *Warning* there are no safety checks to avoid infinite recursion.\n" \
2715 " :type update: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`], " \
2718#define BPY_PROPDEF_POLL_DOC \
2719 " :arg poll: function to be called to determine whether an item is valid for this " \
2721 " The function must take 2 values (self, object) and return Bool.\n" \
2722 " :type poll: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.bpy_struct`], " \
2725#define BPY_PROPDEF_GET_DOC(ty) \
2726 " :arg get: Function to be called when this value is 'read',\n" \
2727 " This function must take 1 value (self) and return the value of the property.\n" \
2728 " :type get: Callable[[:class:`bpy.types.bpy_struct`], " ty "]\n"
2730#define BPY_PROPDEF_SET_DOC(ty) \
2731 " :arg set: Function to be called when this value is 'written',\n" \
2732 " This function must take 2 values (self, value) and return None.\n" \
2733 " :type set: Callable[[:class:`bpy.types.bpy_struct`, " ty "], None]\n"
2735#define BPY_PROPDEF_SEARCH_DOC \
2736 " :arg search: Function to be called to show candidates for this string (shown in the UI).\n" \
2737 " This function must take 3 values (self, context, edit_text)\n" \
2738 " and return a sequence, iterator or generator where each item must be:\n" \
2740 " - A single string (representing a candidate to display).\n" \
2741 " - A tuple-pair of strings, where the first is a candidate and the second\n" \
2742 " is additional information about the candidate.\n" \
2743 " :type search: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`, str], " \
2744 "Iterable[str | tuple[str, str]]" \
2746 " :arg search_options: Set of strings in:\n" \
2748 " - 'SORT' sorts the resulting items.\n" \
2749 " - 'SUGGESTION' lets the user enter values not found in search candidates.\n" \
2750 " **WARNING** disabling this flag causes the search callback to run on redraw,\n" \
2751 " so only disable this flag if it's not likely to cause performance issues.\n" \
2753 " :type search_options: set[str]\n"
2755#define BPY_PROPDEF_POINTER_TYPE_DOC \
2756 " :arg type: A subclass of a property group or ID types.\n" \
2757 " :type type: :class:`bpy.types.PropertyGroup` | :class:`bpy.types.ID`\n"
2759#define BPY_PROPDEF_COLLECTION_TYPE_DOC \
2760 " :arg type: A subclass of a property group.\n" \
2761 " :type type: :class:`bpy.types.PropertyGroup`\n"
2763#define BPY_PROPDEF_TAGS_DOC \
2764 " :arg tags: Enumerator of tags that are defined by parent class.\n" \
2765 " :type tags: set[str]\n"
2768static int bpy_struct_id_used(
StructRNA *srna,
char *identifier)
2790 BPy_BoolProperty_doc,
2791 ".. function:: BoolProperty("
2794 "description=\"\", "
2795 "translation_context=\"*\", "
2797 "options={'ANIMATABLE'}, "
2805 " Returns a new boolean property definition.\n"
2813 PyObject *deferred_result;
2815 if (srna ==
nullptr) {
2816 return deferred_result;
2821 id_data.
srna = srna;
2823 const char *name =
nullptr, *description =
"";
2824 const char *translation_context =
nullptr;
2825 bool default_value =
false;
2829 options_enum.
value = 0;
2833 override_enum.
value = 0;
2836 tags_enum.
srna = srna;
2842 PyObject *update_fn =
nullptr;
2843 PyObject *get_fn =
nullptr;
2844 PyObject *set_fn =
nullptr;
2846 static const char *_keywords[] = {
2850 "translation_context",
2861 static _PyArg_Parser _parser = {
2880 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2887 &translation_context,
2915 if (id_data.prop_free_handle !=
nullptr) {
2922 if (translation_context) {
2926 if (tags_enum.base.is_set) {
2929 if (options_enum.is_set) {
2932 if (override_enum.is_set) {
2944 BPy_BoolVectorProperty_doc,
2945 ".. function:: BoolVectorProperty("
2948 "description=\"\", "
2949 "translation_context=\"*\", "
2950 "default=(False, False, False), "
2951 "options={'ANIMATABLE'}, "
2960 " Returns a new vector boolean property definition.\n"
2962 " :arg default: sequence of booleans the length of *size*.\n"
2971 PyObject *deferred_result;
2974 if (srna ==
nullptr) {
2975 return deferred_result;
2980 id_data.
srna = srna;
2982 const char *name =
nullptr, *description =
"";
2983 const char *translation_context =
nullptr;
2988 PyObject *default_py =
nullptr;
2992 options_enum.
value = 0;
2996 override_enum.
value = 0;
2999 tags_enum.
srna = srna;
3005 PyObject *update_fn =
nullptr;
3006 PyObject *get_fn =
nullptr;
3007 PyObject *set_fn =
nullptr;
3009 static const char *_keywords[] = {
3013 "translation_context",
3025 static _PyArg_Parser _parser = {
3041 ":BoolVectorProperty",
3045 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3052 &translation_context,
3071 if (default_py !=
nullptr) {
3074 sizeof(*default_value.
data()),
3078 "BoolVectorProperty(default=sequence)") == -1)
3094 if (id_data.prop_free_handle !=
nullptr) {
3099 if (array_len_info.dims_len == 0) {
3101 if (default_py !=
nullptr) {
3107 if (default_py !=
nullptr) {
3113 if (translation_context) {
3117 if (tags_enum.base.is_set) {
3120 if (options_enum.is_set) {
3123 if (override_enum.is_set) {
3135 BPy_IntProperty_doc,
3136 ".. function:: IntProperty("
3139 "description=\"\", "
3140 "translation_context=\"*\", "
3142 "min=-2**31, max=2**31-1, "
3143 "soft_min=-2**31, soft_max=2**31-1, "
3145 "options={'ANIMATABLE'}, "
3153 " Returns a new int property definition.\n"
3163 PyObject *deferred_result;
3165 if (srna ==
nullptr) {
3166 return deferred_result;
3171 id_data.
srna = srna;
3173 const char *name =
nullptr, *description =
"";
3174 const char *translation_context =
nullptr;
3175 int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX;
3177 int default_value = 0;
3182 options_enum.
value = 0;
3186 override_enum.
value = 0;
3189 tags_enum.
srna = srna;
3195 PyObject *update_fn =
nullptr;
3196 PyObject *get_fn =
nullptr;
3197 PyObject *set_fn =
nullptr;
3199 static const char *_keywords[] = {
3203 "translation_context",
3219 static _PyArg_Parser _parser = {
3243 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3250 &translation_context,
3282 if (id_data.prop_free_handle !=
nullptr) {
3289 if (translation_context) {
3295 if (tags_enum.base.is_set) {
3298 if (options_enum.is_set) {
3301 if (override_enum.is_set) {
3313 BPy_IntVectorProperty_doc,
3314 ".. function:: IntVectorProperty("
3317 "description=\"\", "
3318 "translation_context=\"*\", "
3319 "default=(0, 0, 0), min=-2**31, max=2**31-1, "
3321 "soft_max=2**31-1, "
3323 "options={'ANIMATABLE'}, "
3332 " Returns a new vector int property definition.\n"
3334 " :arg default: sequence of ints the length of *size*.\n"
3345 PyObject *deferred_result;
3348 if (srna ==
nullptr) {
3349 return deferred_result;
3354 id_data.
srna = srna;
3356 const char *name =
nullptr, *description =
"";
3357 const char *translation_context =
nullptr;
3358 int min = INT_MIN, max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX;
3364 PyObject *default_py =
nullptr;
3368 options_enum.
value = 0;
3372 override_enum.
value = 0;
3375 tags_enum.
srna = srna;
3381 PyObject *update_fn =
nullptr;
3382 PyObject *get_fn =
nullptr;
3383 PyObject *set_fn =
nullptr;
3385 static const char *_keywords[] = {
3386 "attr",
"name",
"description",
"translation_context",
3387 "default",
"min",
"max",
"soft_min",
3388 "soft_max",
"step",
"options",
"override",
3389 "tags",
"subtype",
"size",
"update",
3390 "get",
"set",
nullptr,
3392 static _PyArg_Parser _parser = {
3413 ":IntVectorProperty",
3417 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3424 &translation_context,
3448 if (default_py !=
nullptr) {
3451 sizeof(*default_value.
data()),
3455 "IntVectorProperty(default=sequence)") == -1)
3471 if (id_data.prop_free_handle !=
nullptr) {
3476 if (array_len_info.dims_len == 0) {
3478 if (default_py !=
nullptr) {
3484 if (default_py !=
nullptr) {
3491 if (translation_context) {
3496 if (tags_enum.base.is_set) {
3499 if (options_enum.is_set) {
3502 if (override_enum.is_set) {
3514 BPy_FloatProperty_doc,
3515 ".. function:: FloatProperty("
3518 "description=\"\", "
3519 "translation_context=\"*\", "
3521 "min=-3.402823e+38, max=3.402823e+38, "
3522 "soft_min=-3.402823e+38, soft_max=3.402823e+38, "
3525 "options={'ANIMATABLE'}, "
3534 " Returns a new float (single precision) property definition.\n"
3545 PyObject *deferred_result;
3547 if (srna ==
nullptr) {
3548 return deferred_result;
3553 id_data.
srna = srna;
3555 const char *name =
nullptr, *description =
"";
3556 const char *translation_context =
nullptr;
3559 float default_value = 0.0f;
3565 options_enum.
value = 0;
3569 override_enum.
value = 0;
3572 tags_enum.
srna = srna;
3582 PyObject *update_fn =
nullptr;
3583 PyObject *get_fn =
nullptr;
3584 PyObject *set_fn =
nullptr;
3586 static const char *_keywords[] = {
3587 "attr",
"name",
"description",
"translation_context",
3588 "default",
"min",
"max",
"soft_min",
3589 "soft_max",
"step",
"precision",
"options",
3590 "override",
"tags",
"subtype",
"unit",
3591 "update",
"get",
"set",
nullptr,
3593 static _PyArg_Parser _parser = {
3619 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3626 &translation_context,
3661 if (id_data.prop_free_handle !=
nullptr) {
3669 if (translation_context) {
3673 prop, std::max(soft_min,
min), std::min(soft_max, max), step, precision);
3675 if (tags_enum.base.is_set) {
3678 if (options_enum.is_set) {
3681 if (override_enum.is_set) {
3693 BPy_FloatVectorProperty_doc,
3694 ".. function:: FloatVectorProperty("
3697 "description=\"\", "
3698 "translation_context=\"*\", "
3699 "default=(0.0, 0.0, 0.0), "
3700 "min=sys.float_info.min, max=sys.float_info.max, "
3701 "soft_min=sys.float_info.min, soft_max=sys.float_info.max, "
3704 "options={'ANIMATABLE'}, "
3714 " Returns a new vector float property definition.\n"
3716 " :arg default: Sequence of floats the length of *size*.\n"
3728 PyObject *deferred_result;
3731 if (srna ==
nullptr) {
3732 return deferred_result;
3737 id_data.
srna = srna;
3739 const char *name =
nullptr, *description =
"";
3740 const char *translation_context =
nullptr;
3748 PyObject *default_py =
nullptr;
3752 options_enum.
value = 0;
3756 override_enum.
value = 0;
3759 tags_enum.
srna = srna;
3769 PyObject *update_fn =
nullptr;
3770 PyObject *get_fn =
nullptr;
3771 PyObject *set_fn =
nullptr;
3773 static const char *_keywords[] = {
3774 "attr",
"name",
"description",
"translation_context",
3775 "default",
"min",
"max",
"soft_min",
3776 "soft_max",
"step",
"precision",
"options",
3777 "override",
"tags",
"subtype",
"unit",
3778 "size",
"update",
"get",
"set",
3781 static _PyArg_Parser _parser = {
3804 ":FloatVectorProperty",
3808 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3815 &translation_context,
3842 if (default_py !=
nullptr) {
3845 sizeof(*default_value.
data()),
3849 "FloatVectorProperty(default=sequence)") == -1)
3868 if (id_data.prop_free_handle !=
nullptr) {
3873 if (array_len_info.dims_len == 0) {
3875 if (default_py !=
nullptr) {
3881 if (default_py !=
nullptr) {
3888 if (translation_context) {
3892 prop, std::max(soft_min,
min), std::min(soft_max, max), step, precision);
3894 if (tags_enum.base.is_set) {
3897 if (options_enum.is_set) {
3900 if (override_enum.is_set) {
3912 BPy_StringProperty_doc,
3913 ".. function:: StringProperty("
3916 "description=\"\", "
3917 "translation_context=\"*\", "
3920 "options={'ANIMATABLE'}, "
3928 "search_options={'SUGGESTION'})\n"
3930 " Returns a new string property definition.\n"
3932 " :arg default: initializer string.\n"
3933 " :type default: str\n"
3934 " :arg maxlen: maximum length of the string.\n"
3942 PyObject *deferred_result;
3944 if (srna ==
nullptr) {
3945 return deferred_result;
3950 id_data.
srna = srna;
3952 const char *name =
nullptr, *description =
"";
3953 const char *translation_context =
nullptr, *default_value =
"";
3959 options_enum.
value = 0;
3963 override_enum.
value = 0;
3966 tags_enum.
srna = srna;
3972 PyObject *update_fn =
nullptr;
3973 PyObject *get_fn =
nullptr;
3974 PyObject *set_fn =
nullptr;
3975 PyObject *search_fn =
nullptr;
3980 static const char *_keywords[] = {
3984 "translation_context",
3998 static _PyArg_Parser _parser = {
4020 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4027 &translation_context,
4043 &search_options_enum))
4061 if (id_data.prop_free_handle !=
nullptr) {
4070 if (default_value && default_value[0]) {
4074 if (translation_context) {
4078 if (tags_enum.base.is_set) {
4081 if (options_enum.is_set) {
4084 if (override_enum.is_set) {
4097 BPy_EnumProperty_doc,
4098 ".. function:: EnumProperty("
4102 "description=\"\", "
4103 "translation_context=\"*\", "
4105 "options={'ANIMATABLE'}, "
4112 " Returns a new enumerator property definition.\n"
4114 " :arg items: sequence of enum items formatted:\n"
4115 " ``[(identifier, name, description, icon, number), ...]``.\n"
4117 " The first three elements of the tuples are mandatory.\n"
4119 " :identifier: The identifier is used for Python access.\n"
4120 " :name: Name for the interface.\n"
4121 " :description: Used for documentation and tooltips.\n"
4122 " :icon: An icon string identifier or integer icon value\n"
4123 " (e.g. returned by :class:`bpy.types.UILayout.icon`)\n"
4124 " :number: Unique value used as the identifier for this item (stored in file data).\n"
4125 " Use when the identifier may need to change. If the *ENUM_FLAG* option is used,\n"
4126 " the values are bit-masks and should be powers of two.\n"
4128 " When an item only contains 4 items they define ``(identifier, name, description, "
4131 " Separators may be added using None instead of a tuple."
4133 " For dynamic values a callback can be passed which returns a list in\n"
4134 " the same format as the static list.\n"
4135 " This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
4139 " There is a known bug with using a callback,\n"
4140 " Python must keep a reference to the strings returned by the callback or Blender\n"
4141 " will misbehave or even crash."
4143 " :type items: Sequence["
4144 "tuple[str, str, str] | "
4145 "tuple[str, str, str, int] | "
4146 "tuple[str, str, str, int, int] | "
4148 "Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context` | None], "
4151 "tuple[str, str, str] | "
4152 "tuple[str, str, str, int] | "
4153 "tuple[str, str, str, int, int] | "
4156 " :arg default: The default value for this enum, a string from the identifiers used in "
4157 "*items*, or integer matching an item number.\n"
4158 " If the *ENUM_FLAG* option is used this must be a set of such string identifiers "
4160 " WARNING: Strings cannot be specified for dynamic enums\n"
4161 " (i.e. if a callback function is given as *items* parameter).\n"
4169 PyObject *deferred_result;
4171 if (srna ==
nullptr) {
4172 return deferred_result;
4177 id_data.
srna = srna;
4179 const char *name =
nullptr, *description =
"";
4180 const char *translation_context =
nullptr;
4181 PyObject *default_py =
nullptr;
4182 int default_value = 0;
4183 PyObject *items, *items_fast;
4189 options_enum.
value = 0;
4193 override_enum.
value = 0;
4196 tags_enum.
srna = srna;
4198 bool is_itemf =
false;
4199 PyObject *update_fn =
nullptr;
4200 PyObject *get_fn =
nullptr;
4201 PyObject *set_fn =
nullptr;
4203 static const char *_keywords[] = {
4208 "translation_context",
4218 static _PyArg_Parser _parser = {
4237 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4245 &translation_context,
4270 if (default_py == Py_None) {
4273 default_py =
nullptr;
4278 if (PyFunction_Check(items)) {
4279 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items);
4280 if (f_code->co_argcount != 2) {
4281 PyErr_Format(PyExc_ValueError,
4282 "EnumProperty(...): expected 'items' function to take 2 arguments, not %d",
4283 f_code->co_argcount);
4293 "EnumProperty(...): 'default' can only be an integer when 'items' is a function");
4302 if (!(items_fast = PySequence_Fast(
4304 "EnumProperty(...): "
4305 "expected a sequence of tuples for the enum items or a function")))
4311 items_fast, (options_enum.value &
PROP_ENUM_FLAG) != 0, default_py, &default_value);
4314 Py_DECREF(items_fast);
4319 if (id_data.prop_free_handle !=
nullptr) {
4324 srna, id_data.value, eitems, default_value, name ? name : id_data.value, description);
4328 srna, id_data.value, eitems, default_value, name ? name : id_data.value, description);
4330 if (translation_context) {
4334 if (tags_enum.base.is_set) {
4337 if (options_enum.is_set) {
4340 if (override_enum.is_set) {
4347 if (is_itemf ==
false) {
4350 Py_DECREF(items_fast);
4364 if (PyErr_Occurred()) {
4366 const char *msg_char = PyUnicode_AsUTF8(msg);
4370 PyExc_TypeError,
"%.200s expected an RNA type, failed with: %s", error_prefix, msg_char);
4374 PyErr_Format(PyExc_TypeError,
4375 "%.200s expected an RNA type, failed with type '%s'",
4377 Py_TYPE(value)->tp_name);
4387 BPy_PointerProperty_doc,
4388 ".. function:: PointerProperty("
4392 "description=\"\", "
4393 "translation_context=\"*\", "
4394 "options={'ANIMATABLE'}, "
4400 " Returns a new pointer property definition.\n"
4408 PyObject *deferred_result;
4411 if (srna ==
nullptr) {
4412 return deferred_result;
4417 id_data.
srna = srna;
4419 const char *name =
nullptr, *description =
"";
4420 const char *translation_context =
nullptr;
4423 PyObject *type = Py_None;
4427 options_enum.
value = 0;
4431 override_enum.
value = 0;
4434 tags_enum.
srna = srna;
4436 PyObject *update_fn =
nullptr, *poll_fn =
nullptr;
4438 static const char *_keywords[] = {
4443 "translation_context",
4451 static _PyArg_Parser _parser = {
4468 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4476 &translation_context,
4494 PyErr_Format(PyExc_TypeError,
4495 "PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
4507 if (id_data.prop_free_handle !=
nullptr) {
4511 srna, id_data.value, ptype, name ? name : id_data.value, description);
4512 if (translation_context) {
4516 if (tags_enum.base.is_set) {
4519 if (options_enum.is_set) {
4522 if (override_enum.is_set) {
4540 BPy_CollectionProperty_doc,
4541 ".. function:: CollectionProperty("
4545 "description=\"\", "
4546 "translation_context=\"*\", "
4547 "options={'ANIMATABLE'}, "
4551 " Returns a new collection property definition.\n"
4559 PyObject *deferred_result;
4562 if (srna ==
nullptr) {
4563 return deferred_result;
4568 id_data.
srna = srna;
4570 const char *name =
nullptr, *description =
"";
4571 const char *translation_context =
nullptr;
4574 PyObject *type = Py_None;
4578 options_enum.
value = 0;
4582 override_enum.
value = 0;
4585 tags_enum.
srna = srna;
4587 static const char *_keywords[] = {
4592 "translation_context",
4598 static _PyArg_Parser _parser = {
4609 ":CollectionProperty",
4613 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4621 &translation_context,
4638 PyErr_Format(PyExc_TypeError,
4639 "CollectionProperty(...) expected an RNA type derived from %.200s",
4644 if (id_data.prop_free_handle !=
nullptr) {
4648 srna, id_data.value, ptype, name ? name : id_data.value, description);
4649 if (translation_context) {
4653 if (tags_enum.base.is_set) {
4656 if (options_enum.is_set) {
4659 if (override_enum.is_set) {
4675 BPy_RemoveProperty_doc,
4676 ".. function:: RemoveProperty(cls, attr)\n"
4678 " Removes a dynamically defined property.\n"
4680 " :arg cls: The class containing the property (must be a positional argument).\n"
4681 " :type cls: type\n"
4682 " :arg attr: Property name (must be passed as a keyword).\n"
4683 " :type attr: str\n"
4685 ".. note:: Typically this function doesn't need to be accessed directly.\n"
4686 " Instead use ``del cls.attr``\n");
4691 if (PyTuple_GET_SIZE(args) == 1) {
4693 self = PyTuple_GET_ITEM(args, 0);
4694 args = PyTuple_New(0);
4699 if (PyTuple_GET_SIZE(args) > 1) {
4700 PyErr_SetString(PyExc_ValueError,
"expected one positional arg, one keyword arg");
4705 if (srna ==
nullptr && PyErr_Occurred()) {
4708 if (srna ==
nullptr) {
4709 PyErr_SetString(PyExc_TypeError,
"RemoveProperty(): struct rna not available for this type");
4713 const char *
id =
nullptr;
4715 static const char *_keywords[] = {
4719 static _PyArg_Parser _parser = {
4726 if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &
id)) {
4731 PyErr_Format(PyExc_TypeError,
"RemoveProperty(): '%s' not a defined dynamic property",
id);
4744#if (defined(__GNUC__) && !defined(__clang__))
4745# pragma GCC diagnostic push
4746# pragma GCC diagnostic ignored "-Wcast-function-type"
4752 METH_VARARGS | METH_KEYWORDS,
4753 BPy_BoolProperty_doc},
4754 {
"BoolVectorProperty",
4756 METH_VARARGS | METH_KEYWORDS,
4757 BPy_BoolVectorProperty_doc},
4760 METH_VARARGS | METH_KEYWORDS,
4761 BPy_IntProperty_doc},
4762 {
"IntVectorProperty",
4764 METH_VARARGS | METH_KEYWORDS,
4765 BPy_IntVectorProperty_doc},
4768 METH_VARARGS | METH_KEYWORDS,
4769 BPy_FloatProperty_doc},
4770 {
"FloatVectorProperty",
4772 METH_VARARGS | METH_KEYWORDS,
4773 BPy_FloatVectorProperty_doc},
4776 METH_VARARGS | METH_KEYWORDS,
4777 BPy_StringProperty_doc},
4780 METH_VARARGS | METH_KEYWORDS,
4781 BPy_EnumProperty_doc},
4784 METH_VARARGS | METH_KEYWORDS,
4785 BPy_PointerProperty_doc},
4786 {
"CollectionProperty",
4788 METH_VARARGS | METH_KEYWORDS,
4789 BPy_CollectionProperty_doc},
4793 METH_VARARGS | METH_KEYWORDS,
4794 BPy_RemoveProperty_doc},
4795 {
nullptr,
nullptr, 0,
nullptr},
4798#if (defined(__GNUC__) && !defined(__clang__))
4799# pragma GCC diagnostic pop
4805 PyObject **py_data = (PyObject **)&prop_store->py_data;
4807 Py_VISIT(py_data[i]);
4816 PyObject **py_data = (PyObject **)&prop_store->py_data;
4818 Py_CLEAR(py_data[i]);
4827 "This module defines properties to extend Blender's internal data. The result of these "
4829 " is used to assign properties to classes registered with Blender and can't be used "
4832 ".. note:: All parameters to these functions must be passed as keywords.\n");
4835 PyModuleDef_HEAD_INIT,
4848 PyObject *submodule;
4849 PyObject *submodule_dict;
4852 PyDict_SetItemString(PyImport_GetModuleDict(),
props_module.m_name, submodule);
4855 submodule_dict = PyModule_GetDict(submodule);
4857#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.
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))
void RNA_def_property_free_identifier_deferred_finish(StructOrFunctionRNA *cont_, void *handle)
int RNA_def_property_free_identifier_deferred_prepare(StructOrFunctionRNA *cont_, const char *identifier, void **handle)
#define RNA_MAX_ARRAY_DIMENSION
int(*)(PointerRNA *ptr, PropertyRNA *prop) EnumPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, char *value) StringPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool *values) BooleanArrayPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const bool *values) BooleanArrayPropertySetFunc
int(*)(PointerRNA *ptr, PropertyRNA *prop) StringPropertyLengthFunc
@ STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES
void(*)(PointerRNA *ptr, PropertyRNA *prop, float *values) FloatArrayPropertyGetFunc
#define RNA_ENUM_BITFLAG_SIZE
void(*)(PointerRNA *ptr, PropertyRNA *prop, const char *value) StringPropertySetFunc
eStringPropertySearchFlag
@ PROP_STRING_SEARCH_SUGGESTION
void(*)(PointerRNA *ptr, PropertyRNA *prop, int *values) IntArrayPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) EnumPropertySetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const int *values) IntArrayPropertySetFunc
void(*)(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn) StringPropertySearchFunc
bool(*)(PointerRNA *ptr, PropertyRNA *prop) BooleanPropertyGetFunc
float(*)(PointerRNA *ptr, PropertyRNA *prop) FloatPropertyGetFunc
int(*)(PointerRNA *ptr, PropertyRNA *prop) IntPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, float value) FloatPropertySetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) IntPropertySetFunc
const EnumPropertyItem *(*)(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free) EnumPropertyItemFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool value) BooleanPropertySetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const float *values) FloatArrayPropertySetFunc
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
static void bpy_prop_string_visit_for_search_fn(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
static PyObject * pymeth_FloatProperty
static void bpy_prop_callback_assign_float_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static bool bpy_prop_string_visit_fn_call(PyObject *py_func, PyObject *item, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
static void bpy_prop_callback_assign_boolean_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static void bpy_prop_boolean_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
static PyObject * BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
#define ASSIGN_PYOBJECT_INCREF(a, b)
static void bpy_prop_array_matrix_swap_row_column_vn_vn(float *values_dst, const float *values_src, const BPyPropArrayLength *array_len_info)
static PyObject * BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_callback_assign_string(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *search_fn, const eStringPropertySearchFlag search_flag)
static PyModuleDef props_module
static bool bpy_prop_pointer_poll_fn(PointerRNA *self, PointerRNA candidate, PropertyRNA *prop)
#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC
static bool py_long_as_int(PyObject *py_long, int *r_int)
PyObject * BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
static bool bpy_prop_array_is_matrix_compatible_ex(int subtype, const BPyPropArrayLength *array_len_info)
static float bpy_prop_float_get_fn(PointerRNA *ptr, PropertyRNA *prop)
#define BPY_PROPDEF_NAME_DOC
static int bpy_prop_int_get_fn(PointerRNA *ptr, PropertyRNA *prop)
static PyGetSetDef bpy_prop_deferred_getset[]
static void bpy_prop_callback_assign_int_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#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 bool bpy_prop_array_is_matrix_compatible(PropertyRNA *prop, const BPyPropArrayLength *array_len_info)
static void bpy_prop_boolean_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, bool *values)
static int bpy_prop_string_length_fn(PointerRNA *ptr, PropertyRNA *prop)
static PyObject * pymeth_EnumProperty
#define BPY_PROPDEF_NUM_SOFT_MINMAX_DOC(ty)
static PyObject * bpy_prop_deferred_keywords_get(BPy_PropDeferred *self, void *)
static int bpy_prop_deferred_clear(BPy_PropDeferred *self)
static void bpy_prop_py_data_remove(PropertyRNA *prop)
static void bpy_prop_int_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, int *values)
#define BPY_PROPDEF_FLOAT_PREC_DOC
static void bpy_prop_float_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const float *values)
#define BPY_PROPDEF_POLL_DOC
#define BPY_PROPDEF_NUM_MINMAX_DOC(ty)
static PyObject * BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * pymeth_FloatVectorProperty
static PyObject * BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
PyObject * BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_int_set_fn(PointerRNA *ptr, PropertyRNA *prop, int value)
static PyObject * pymeth_IntProperty
#define BPY_PROPDEF_SET_DOC(ty)
static void bpy_prop_int_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const int *values)
#define BPY_PROPDEF_POINTER_TYPE_DOC
PyObject * BPY_rna_props()
static PyMethodDef props_methods[]
static void bpy_prop_callback_assign_pointer(PropertyRNA *prop, PyObject *poll_fn)
static PyObject * pyrna_struct_as_instance(PointerRNA *ptr)
static PyObject * BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * bpy_prop_deferred_function_get(BPy_PropDeferred *self, void *)
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
static int props_clear(PyObject *)
static void bpy_prop_boolean_set_fn(PointerRNA *ptr, PropertyRNA *prop, bool value)
void BPY_rna_props_clear_all()
static PyObject * pymeth_RemoveProperty
static void bpy_prop_callback_assign_int(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static void bpy_prop_enum_set_fn(PointerRNA *ptr, PropertyRNA *prop, int value)
static int icon_id_from_name(const char *name)
static PyObject * pymeth_CollectionProperty
static void bpy_prop_assign_flag(PropertyRNA *prop, const int flag)
static const EnumPropertyItem * enum_items_from_py(PyObject *seq_fast, const bool is_enum_flag, PyObject *default_py, int *r_default_value)
static PyObject * BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_callback_assign_float(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static PyObject * BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_CTXT_DOC
#define BPY_PROPDEF_COLLECTION_TYPE_DOC
#define BPY_PROPDEF_TAGS_DOC
static int bpy_prop_deferred_traverse(BPy_PropDeferred *self, visitproc visit, void *arg)
#define BPY_PROP_STORE_PY_DATA_SIZE
static int bpy_prop_array_length_parse(PyObject *o, void *p)
static void bpy_prop_float_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, float *values)
static PyObject * pymeth_PointerProperty
#define BPY_PROPDEF_OPTIONS_DOC
static int bpy_prop_arg_parse_id(PyObject *o, void *p)
static int bpy_prop_array_from_py_with_dims(void *values, size_t values_elem_size, PyObject *py_values, const BPyPropArrayLength *array_len_info, const PyTypeObject *type, const char *error_str)
static bool bpy_prop_boolean_get_fn(PointerRNA *ptr, PropertyRNA *prop)
#define BPY_PROPDEF_GET_DOC(ty)
static void bpy_prop_float_set_fn(PointerRNA *ptr, PropertyRNA *prop, float value)
static void bpy_prop_callback_assign_boolean(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static BPyPropStore * bpy_prop_py_data_ensure(PropertyRNA *prop)
static StructRNA * bpy_prop_deferred_data_or_srna(PyObject *self, PyObject *args, PyObject *kw, PyObject *method_object, PyObject **r_deferred_result)
#define BPY_PROPDEF_SEARCH_DOC
static void bpy_prop_string_get_fn(PointerRNA *ptr, PropertyRNA *prop, char *value)
StructRNA * pointer_type_from_py(PyObject *value, const char *error_prefix)
static PyObject * bpy_prop_deferred_data_CreatePyObject(PyObject *fn, PyObject *kw)
static int bpy_prop_enum_get_fn(PointerRNA *ptr, PropertyRNA *prop)
static const EnumPropertyItem * bpy_prop_enum_itemf_fn(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static PyObject * pymeth_BoolProperty
static void bpy_prop_array_matrix_swap_row_column_vn(float *values, const BPyPropArrayLength *array_len_info)
#define BPY_PROPDEF_OPTIONS_ENUM_DOC
static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
static void bpy_prop_update_fn(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
static void bpy_prop_callback_assign_update(PropertyRNA *prop, PyObject *update_fn)
#define BPY_PROPDEF_UNIT_DOC
static void bpy_prop_callback_assign_enum(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *itemf_fn)
#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC
static PyObject * bpy_prop_deferred_call(BPy_PropDeferred *, PyObject *, PyObject *)
static int bpy_prop_callback_check(PyObject *py_func, const char *keyword, int argcount)
static PyObject * BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
#define ASSIGN_STATIC(_name)
#define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC
#define BPY_PROPDEF_VECSIZE_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 void bpy_prop_string_set_fn(PointerRNA *ptr, PropertyRNA *prop, const char *value)
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 int props_visit(PyObject *, visitproc visit, void *arg)
static PyObject * bpy_prop_deferred_repr(BPy_PropDeferred *self)
static PyObject * pymeth_StringProperty
#define PYRNA_STACK_ARRAY
StructRNA * srna_from_self(PyObject *self, const char *error_prefix)
void pyrna_write_set(bool val)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
BPy_StructRNA * bpy_context_module
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
void reinitialize(const int64_t new_size)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
int pyrna_enum_bitfield_parse_set(PyObject *o, void *p)
int pyrna_enum_value_parse_string(PyObject *o, void *p)
PyObject * PyC_Tuple_PackArray_Bool(const bool *array, uint len)
PyObject * PyC_Tuple_PackArray_Multi_Bool(const bool *array, const int dims[], const int dims_len)
PyObject * PyC_Tuple_PackArray_I32(const int *array, uint len)
PyObject * PyC_ExceptionBuffer()
int PyC_Long_AsBool(PyObject *value)
int PyC_AsArray(void *array, const size_t array_item_size, PyObject *value, const Py_ssize_t length, const PyTypeObject *type, const char *error_prefix)
PyObject * PyC_Tuple_PackArray_Multi_F32(const float *array, const int dims[], const int dims_len)
int PyC_AsArray_Multi(void *array, const size_t array_item_size, PyObject *value, const int *dims, const int dims_len, const PyTypeObject *type, const char *error_prefix)
void PyC_Err_PrintWithFunc(PyObject *py_func)
PyObject * PyC_Tuple_PackArray_F32(const float *array, uint len)
PyObject * PyC_Tuple_PackArray_Multi_I32(const int *array, const int dims[], const int dims_len)
int PyC_ParseBool(PyObject *o, void *p)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
bool RNA_struct_is_ID(const StructRNA *type)
int RNA_property_enum_get_default(PointerRNA *, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
PropertyType RNA_property_type(PropertyRNA *prop)
void ** RNA_struct_instance(PointerRNA *ptr)
const char * RNA_struct_identifier(const StructRNA *type)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
void * RNA_property_py_data_get(PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
const char * RNA_struct_ui_name(const StructRNA *type)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void RNA_def_property_string_search_func_runtime(PropertyRNA *prop, StringPropertySearchFunc search_fn, const eStringPropertySearchFlag search_flag)
void RNA_def_struct_flag(StructRNA *srna, int 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_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)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
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_update_runtime_with_context_and_property(PropertyRNA *prop, RNAPropertyUpdateFuncWithContextAndProperty func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_float_funcs_runtime(PropertyRNA *prop, FloatPropertyGetFunc getfunc, FloatPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
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_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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)
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)
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_override_flag_collection_items[]
const EnumPropertyItem rna_enum_dummy_NULL_items[]
const EnumPropertyItem rna_enum_property_subtype_number_array_items[]
const EnumPropertyItem rna_enum_property_unit_items[]
const EnumPropertyItem rna_enum_property_subtype_number_items[]
const EnumPropertyItem rna_enum_property_string_search_flag_items[]
const EnumPropertyItem rna_enum_property_override_flag_items[]
const EnumPropertyItem rna_enum_property_subtype_string_items[]
const EnumPropertyItem rna_enum_property_flag_items[]
const EnumPropertyItem rna_enum_property_flag_enum_items[]
const EnumPropertyItem rna_enum_icon_items[]
int dims[RNA_MAX_ARRAY_DIMENSION]
struct BPyPropStore::@1345::@1346::@1349 pointer_data
struct BPyPropStore::@1345::@1346::@1348 enum_data
struct BPyPropStore::@1345 py_data
struct BPyPropStore::@1345::@1346::@1350 string_data
BPy_EnumProperty_Parse base
const EnumPropertyItem * items