14#define PY_SSIZE_T_CLEAN
34#include "RNA_prototypes.hh"
56#define BPY_PROPDEF_OPTIONS_DOC \
57 " :param options: Enumerator in :ref:`rna_enum_property_flag_items`.\n" \
58 " :type options: set[str]\n"
60#define BPY_PROPDEF_OPTIONS_ENUM_DOC \
61 " :param options: Enumerator in :ref:`rna_enum_property_flag_enum_items`.\n" \
62 " :type options: set[str]\n"
64#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC \
65 " :param override: Enumerator in :ref:`rna_enum_property_override_flag_items`.\n" \
66 " :type override: set[str]\n"
68#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC \
69 " :param override: Enumerator in :ref:`rna_enum_property_override_flag_collection_items`.\n" \
70 " :type override: set[str]\n"
72#define BPY_PROPDEF_SUBTYPE_STRING_DOC \
73 " :param subtype: Enumerator in :ref:`rna_enum_property_subtype_string_items`.\n" \
74 " :type subtype: str\n"
76#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC \
77 " :param subtype: Enumerator in :ref:`rna_enum_property_subtype_number_items`.\n" \
78 " :type subtype: str\n"
80#define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC \
81 " :param subtype: Enumerator in :ref:`rna_enum_property_subtype_number_array_items`.\n" \
82 " :type subtype: str\n"
179#define BPY_PROP_STORE_PY_DATA_SIZE (sizeof(BPyPropStore::py_data) / sizeof(PyObject *))
181#define ASSIGN_PYOBJECT_INCREF(a, b) \
183 BLI_assert((a) == nullptr); \
198 if (prop_store ==
nullptr) {
212 if (prop_store ==
nullptr) {
216 PyObject **py_data =
reinterpret_cast<PyObject **
>(&prop_store->
py_data);
218 Py_XDECREF(py_data[i]);
235 PyObject_GC_UnTrack(self);
237 PyObject_GC_Del(self);
254 return PyUnicode_FromFormat(
"<%.200s, %R, %R>", Py_TYPE(self)->tp_name, self->
fn, self->
kw);
275 bpy_prop_deferred_function_doc,
276 "The property registration function (e.g. :func:`bpy.props.IntProperty`).\n"
278 ":type: Callable\n");
285 PyObject *
ret =
static_cast<PyObject *
>(self->
fn);
292 bpy_prop_deferred_keywords_doc,
293 "The keyword arguments passed to the property registration function.\n"
295 ":type: dict[str, Any]\n");
303 PyObject *
ret = self->
kw;
315 static_cast<setter
>(
nullptr),
316 bpy_prop_deferred_function_doc,
320 static_cast<setter
>(
nullptr),
321 bpy_prop_deferred_keywords_doc,
323 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
328 bpy_prop_deferred_doc,
329 "Intermediate storage for properties before registration.\n"
333 " This is not part of the stable API and may change between releases.\n");
335 PyVarObject_HEAD_INIT(
nullptr, 0)
354 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
355 bpy_prop_deferred_doc,
397 BLI_assert(!PyObject_GC_IsTracked((PyObject *)self));
398 PyObject_GC_Track(self);
399 return reinterpret_cast<PyObject *
>(self);
423 PyObject *self =
nullptr;
431 self =
static_cast<PyObject *
>(*instance);
438 if (self ==
nullptr) {
458 if (flag_mask_clear) {
479 const PyGILState_STATE gilstate = PyGILState_Ensure();
492 PyGILState_Release(prop_state.
gilstate);
516 if ((this->len_total != other.
len_total) || (this->dims_len != other.
dims_len)) {
519 for (
int i = 0; i < this->dims_len; i++) {
520 if (this->dims[i] != other.
dims[i]) {
535 if (PyLong_CheckExact(o)) {
537 if ((size = PyLong_AsLong(o)) == -1) {
539 PyExc_ValueError,
"expected number or sequence of numbers, got %s", Py_TYPE(o)->tp_name);
554 if (!(seq_fast = PySequence_Fast(o,
"size must be a number of a sequence of numbers"))) {
557 const int seq_len = PySequence_Fast_GET_SIZE(seq_fast);
567 PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast);
569 for (
int i = 0; i < seq_len; i++) {
571 if ((size = PyLong_AsLong(seq_items[i])) == -1) {
573 PyErr_Format(PyExc_ValueError,
574 "expected number in sequence, got %s at index %d",
581 PyErr_Format(PyExc_TypeError,
588 array_len_info->
dims[i] = size;
601 size_t values_elem_size,
604 const PyTypeObject *type,
605 const char *error_str)
607 if (array_len_info->
dims_len == 0) {
609 values, values_elem_size, py_values, array_len_info->
len_total, type, error_str);
611 const int *dims = array_len_info->
dims;
612 const int dims_len = array_len_info->
dims_len;
613 return PyC_AsArray_Multi(values, values_elem_size, py_values, dims, dims_len, type, error_str);
619 const PyTypeObject &type)
621 PyObject *py_values =
nullptr;
623 if (&type == &PyBool_Type) {
630 static_cast<const bool *
>(values), array_len_info.
dims, array_len_info.
dims_len);
633 else if (&type == &PyLong_Type) {
640 static_cast<const int *
>(values), array_len_info.
dims, array_len_info.
dims_len);
643 else if (&type == &PyFloat_Type) {
651 static_cast<const float *
>(values), array_len_info.
dims, array_len_info.
dims_len);
665 ((array_len_info->
dims[0] >= 2) && (array_len_info->
dims[0] <= 4)) &&
666 ((array_len_info->
dims[1] >= 2) && (array_len_info->
dims[1] <= 4)));
680 const float *values_src,
684 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
686 for (
int i = 0; i < dim0; i++) {
687 for (
int j = 0; j < dim1; j++) {
688 values_dst[(j * dim0) + i] = values_src[(i * dim1) + j];
696 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
698 float values_orig[4 * 4];
699 memcpy(values_orig, values,
sizeof(
float) * (dim0 * dim1));
714 PyGILState_STATE gilstate;
727 py_func = prop_store->
py_data.update_fn;
730 PyObject *args = PyTuple_New(2);
735 ret = PyObject_CallObject(py_func, args);
740 if (
ret ==
nullptr) {
744 if (
ret != Py_None) {
745 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
776 py_func = prop_store->
py_data.get_fn;
779 PyObject *args = PyTuple_New(1);
783 ret = PyObject_CallObject(py_func, args);
788 if (
ret ==
nullptr) {
795 if (value_i == -1 && PyErr_Occurred()) {
800 value = bool(value_i);
824 py_func = prop_store->
py_data.get_transform_fn;
827 PyObject *args = PyTuple_New(3);
831 ret = PyObject_CallObject(py_func, args);
836 bool ret_value = curr_value;
837 if (
ret ==
nullptr) {
843 if (value_i == -1 && PyErr_Occurred()) {
847 ret_value = bool(value_i);
868 py_func = prop_store->
py_data.set_fn;
871 PyObject *args = PyTuple_New(2);
875 ret = PyObject_CallObject(py_func, args);
880 if (
ret ==
nullptr) {
884 if (
ret != Py_None) {
885 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
906 py_func = prop_store->
py_data.set_transform_fn;
909 PyObject *args = PyTuple_New(4);
913 PyBool_FromLong(new_value),
914 PyBool_FromLong(curr_value),
917 ret = PyObject_CallObject(py_func, args);
922 bool ret_value = curr_value;
923 if (
ret ==
nullptr) {
929 if (value_i == -1 && PyErr_Occurred()) {
933 ret_value = bool(value_i);
949 bool is_values_set =
false;
951 if (bool_array_obj !=
nullptr) {
957 "BoolVectorProperty get callback") == -1)
962 is_values_set =
true;
966 if (is_values_set ==
false) {
968 for (
int i = 0; i < array_len_info.
len_total; i++) {
973 Py_XDECREF(bool_array_obj);
987 py_func = prop_store->
py_data.get_fn;
990 PyObject *args = PyTuple_New(1);
994 ret = PyObject_CallObject(py_func, args);
1016 py_func = prop_store->
py_data.get_transform_fn;
1019 PyObject *args = PyTuple_New(3);
1025 PyBool_FromLong(
is_set));
1027 ret = PyObject_CallObject(py_func, args);
1049 py_func = prop_store->
py_data.set_fn;
1052 PyObject *args = PyTuple_New(2);
1057 ret = PyObject_CallObject(py_func, args);
1062 if (
ret ==
nullptr) {
1066 if (
ret != Py_None) {
1067 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1079 const bool *new_values,
1080 const bool *curr_values,
1082 bool *r_final_values)
1094 py_func = prop_store->
py_data.set_transform_fn;
1097 PyObject *args = PyTuple_New(4);
1104 PyBool_FromLong(
is_set));
1106 ret = PyObject_CallObject(py_func, args);
1133 py_func = prop_store->
py_data.get_fn;
1136 PyObject *args = PyTuple_New(1);
1140 ret = PyObject_CallObject(py_func, args);
1145 if (
ret ==
nullptr) {
1150 value = PyC_Long_AsI32(
ret);
1152 if (value == -1 && PyErr_Occurred()) {
1178 py_func = prop_store->
py_data.get_transform_fn;
1181 PyObject *args = PyTuple_New(3);
1185 ret = PyObject_CallObject(py_func, args);
1190 int ret_value = curr_value;
1191 if (
ret ==
nullptr) {
1195 ret_value = PyC_Long_AsI32(
ret);
1197 if (ret_value == -1 && PyErr_Occurred()) {
1199 ret_value = curr_value;
1220 py_func = prop_store->
py_data.set_fn;
1223 PyObject *args = PyTuple_New(2);
1227 ret = PyObject_CallObject(py_func, args);
1232 if (
ret ==
nullptr) {
1236 if (
ret != Py_None) {
1237 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1258 py_func = prop_store->
py_data.set_transform_fn;
1261 PyObject *args = PyTuple_New(4);
1265 PyLong_FromLong(new_value),
1266 PyLong_FromLong(curr_value),
1267 PyBool_FromLong(
is_set));
1269 ret = PyObject_CallObject(py_func, args);
1274 int ret_value = curr_value;
1275 if (
ret ==
nullptr) {
1279 ret_value = PyC_Long_AsI32(
ret);
1281 if (ret_value == -1 && PyErr_Occurred()) {
1283 ret_value = curr_value;
1299 bool is_values_set =
false;
1301 if (int_array_obj !=
nullptr) {
1307 "IntVectorProperty get callback") == -1)
1312 is_values_set =
true;
1316 if (is_values_set ==
false) {
1318 for (
int i = 0; i < array_len_info.
len_total; i++) {
1323 Py_XDECREF(int_array_obj);
1337 py_func = prop_store->
py_data.get_fn;
1340 PyObject *args = PyTuple_New(1);
1344 ret = PyObject_CallObject(py_func, args);
1366 py_func = prop_store->
py_data.get_transform_fn;
1369 PyObject *args = PyTuple_New(3);
1375 PyBool_FromLong(
is_set));
1377 ret = PyObject_CallObject(py_func, args);
1399 py_func = prop_store->
py_data.set_fn;
1402 PyObject *args = PyTuple_New(2);
1407 ret = PyObject_CallObject(py_func, args);
1412 if (
ret ==
nullptr) {
1416 if (
ret != Py_None) {
1417 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1429 const int *new_values,
1430 const int *curr_values,
1432 int *r_final_values)
1444 py_func = prop_store->
py_data.set_transform_fn;
1447 PyObject *args = PyTuple_New(4);
1454 PyBool_FromLong(
is_set));
1456 ret = PyObject_CallObject(py_func, args);
1483 py_func = prop_store->
py_data.get_fn;
1486 PyObject *args = PyTuple_New(1);
1490 ret = PyObject_CallObject(py_func, args);
1495 if (
ret ==
nullptr) {
1500 value = PyFloat_AsDouble(
ret);
1502 if (value == -1.0f && PyErr_Occurred()) {
1528 py_func = prop_store->
py_data.get_transform_fn;
1531 PyObject *args = PyTuple_New(3);
1535 ret = PyObject_CallObject(py_func, args);
1540 float ret_value = curr_value;
1541 if (
ret ==
nullptr) {
1545 ret_value = PyFloat_AsDouble(
ret);
1547 if (ret_value == -1.0f && PyErr_Occurred()) {
1549 ret_value = curr_value;
1570 py_func = prop_store->
py_data.set_fn;
1573 PyObject *args = PyTuple_New(2);
1577 ret = PyObject_CallObject(py_func, args);
1582 if (
ret ==
nullptr) {
1586 if (
ret != Py_None) {
1587 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1608 py_func = prop_store->
py_data.set_transform_fn;
1611 PyObject *args = PyTuple_New(4);
1615 PyFloat_FromDouble(new_value),
1616 PyFloat_FromDouble(curr_value),
1617 PyBool_FromLong(
is_set));
1619 ret = PyObject_CallObject(py_func, args);
1624 float ret_value = curr_value;
1625 if (
ret ==
nullptr) {
1629 ret_value = PyFloat_AsDouble(
ret);
1631 if (ret_value == -1.0f && PyErr_Occurred()) {
1633 ret_value = curr_value;
1645 PyObject *float_array_obj,
1648 const bool do_matrix_row_col_swap,
1651 bool is_values_set =
false;
1653 if (float_array_obj !=
nullptr) {
1659 "FloatVectorProperty get callback") == -1)
1669 is_values_set =
true;
1673 if (is_values_set ==
false) {
1675 for (
int i = 0; i < array_len_info.
len_total; i++) {
1680 Py_XDECREF(float_array_obj);
1694 py_func = prop_store->
py_data.get_fn;
1697 PyObject *args = PyTuple_New(1);
1701 ret = PyObject_CallObject(py_func, args);
1724 py_func = prop_store->
py_data.get_transform_fn;
1727 PyObject *args = PyTuple_New(3);
1733 PyBool_FromLong(
is_set));
1735 ret = PyObject_CallObject(py_func, args);
1742 const bool do_matrix_row_col_swap = prop_store->
py_data.get_fn ==
nullptr;
1744 prop,
ret, array_len_info, py_func, do_matrix_row_col_swap, r_values);
1761 py_func = prop_store->
py_data.set_fn;
1764 PyObject *args = PyTuple_New(2);
1769 ret = PyObject_CallObject(py_func, args);
1774 if (
ret ==
nullptr) {
1778 if (
ret != Py_None) {
1779 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1791 const float *new_values,
1792 const float *curr_values,
1794 float *r_final_values)
1806 py_func = prop_store->
py_data.set_transform_fn;
1809 PyObject *args = PyTuple_New(4);
1816 PyBool_FromLong(
is_set));
1818 ret = PyObject_CallObject(py_func, args);
1825 prop,
ret, array_len_info, py_func,
false, r_final_values);
1837 const size_t max_length,
1840 std::optional<std::string> ret_value{};
1843 if (str_obj ==
nullptr) {
1846 else if (!PyUnicode_Check(str_obj)) {
1848 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(str_obj)->tp_name);
1854 const char *ret_cstr = PyUnicode_AsUTF8AndSize(str_obj, &
length);
1855 if (max_length &&
size_t(
length) + 1 > max_length) {
1856 PyErr_Format(PyExc_ValueError,
1857 "return string must be of max length %zu, not %d",
1863 ret_value = {ret_cstr, size_t(
length)};
1867 Py_XDECREF(str_obj);
1879 py_func = prop_store->
py_data.get_fn;
1882 PyObject *args = PyTuple_New(1);
1886 ret = PyObject_CallObject(py_func, args);
1908 const std::string &curr_value,
1918 py_func = prop_store->
py_data.get_transform_fn;
1921 PyObject *args = PyTuple_New(3);
1926 PyUnicode_FromStringAndSize(curr_value.c_str(), Py_ssize_t(curr_value.size())),
1927 PyBool_FromLong(
is_set));
1929 ret = PyObject_CallObject(py_func, args);
1935 .value_or(curr_value);
1940 const std::string &curr_value,
1976 py_func = prop_store->
py_data.set_fn;
1979 PyObject *args = PyTuple_New(2);
1984 if (max_length && value.size() >= max_length) {
1985 PyErr_Format(PyExc_ValueError,
1986 "the given string must be of max length %zu, not %zu",
1991 PyObject *py_value = PyUnicode_FromStringAndSize(value.c_str(), value.size());
1993 PyErr_SetString(PyExc_ValueError,
1994 "the given string value cannot be converted into a python string");
1997 Py_INCREF(py_value);
2001 ret = PyObject_CallObject(py_func, args);
2006 if (
ret ==
nullptr) {
2010 if (
ret != Py_None) {
2011 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
2023 const std::string &new_value,
2024 const std::string &curr_value,
2035 py_func = prop_store->
py_data.set_transform_fn;
2038 PyObject *args = PyTuple_New(4);
2043 PyUnicode_FromStringAndSize(new_value.c_str(), Py_ssize_t(new_value.size())),
2044 PyUnicode_FromStringAndSize(curr_value.c_str(), Py_ssize_t(curr_value.size())),
2045 PyBool_FromLong(
is_set));
2047 ret = PyObject_CallObject(py_func, args);
2054 .value_or(curr_value);
2065 const char *info =
nullptr;
2067 if (PyTuple_CheckExact(item)) {
2069 static const char *_keywords[] = {
2074 static _PyArg_Parser _parser = {
2081 if (!_PyArg_ParseTupleAndKeywordsFast(item,
nullptr, &_parser, &text, &info)) {
2087 text = PyUnicode_AsUTF8(item);
2088 if (text ==
nullptr) [[unlikely]] {
2090 PyErr_Format(PyExc_TypeError,
2091 "expected sequence of strings or tuple pairs of strings, not %.200s",
2092 Py_TYPE(item)->tp_name);
2099 visit_params.
text = text;
2100 visit_params.
info = info ? info :
"";
2101 visit_fn(visit_params);
2109 const char *edit_text,
2112 PyGILState_STATE gilstate;
2117 gilstate = PyGILState_Ensure();
2126 py_func = prop_store->
py_data.string_data.search_fn;
2129 PyObject *args = PyTuple_New(3);
2132 PyObject *py_edit_text = PyUnicode_FromString(edit_text);
2133 Py_INCREF(py_context);
2136 ret = PyObject_CallObject(py_func, args);
2141 if (
ret ==
nullptr) {
2145 if (PyIter_Check(
ret)) {
2148 PyObject *(*iternext)(PyObject *);
2149 it = PyObject_GetIter(
ret);
2150 if (it ==
nullptr) {
2154 iternext = *Py_TYPE(it)->tp_iternext;
2156 PyObject *py_text = iternext(it);
2157 if (py_text ==
nullptr) {
2167 if (PyErr_Occurred()) {
2168 if (PyErr_ExceptionMatches(PyExc_StopIteration)) {
2179 PyObject *ret_fast = PySequence_Fast(
2181 "StringProperty(...): "
2182 "return value from search callback was not a sequence, iterator or generator");
2183 if (ret_fast ==
nullptr) {
2187 const Py_ssize_t ret_num = PySequence_Fast_GET_SIZE(ret_fast);
2188 PyObject **ret_fast_items = PySequence_Fast_ITEMS(ret_fast);
2189 for (Py_ssize_t i = 0; i < ret_num; i++) {
2195 Py_DECREF(ret_fast);
2206 PyGILState_Release(gilstate);
2227 py_func = prop_store->
py_data.pointer_data.poll_fn;
2230 PyObject *args = PyTuple_New(2);
2235 ret = PyObject_CallObject(py_func, args);
2240 if (
ret ==
nullptr) {
2271 py_func = prop_store->
py_data.get_fn;
2274 PyObject *args = PyTuple_New(1);
2278 ret = PyObject_CallObject(py_func, args);
2283 if (
ret ==
nullptr) {
2288 value = PyC_Long_AsI32(
ret);
2290 if (value == -1 && PyErr_Occurred()) {
2316 py_func = prop_store->
py_data.get_transform_fn;
2319 PyObject *args = PyTuple_New(3);
2323 ret = PyObject_CallObject(py_func, args);
2328 int ret_value = curr_value;
2329 if (
ret ==
nullptr) {
2333 ret_value = PyC_Long_AsI32(
ret);
2335 if (ret_value == -1 && PyErr_Occurred()) {
2337 ret_value = curr_value;
2358 py_func = prop_store->
py_data.set_fn;
2361 PyObject *args = PyTuple_New(2);
2365 ret = PyObject_CallObject(py_func, args);
2370 if (
ret ==
nullptr) {
2374 if (
ret != Py_None) {
2375 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
2396 py_func = prop_store->
py_data.set_transform_fn;
2399 PyObject *args = PyTuple_New(4);
2403 PyLong_FromLong(new_value),
2404 PyLong_FromLong(curr_value),
2405 PyBool_FromLong(
is_set));
2407 ret = PyObject_CallObject(py_func, args);
2412 int ret_value = curr_value;
2413 if (
ret ==
nullptr) {
2417 ret_value = PyC_Long_AsI32(
ret);
2419 if (ret_value == -1 && PyErr_Occurred()) {
2421 ret_value = curr_value;
2435 if (PyLong_CheckExact(py_long)) {
2436 *r_int = int(PyLong_AS_LONG(py_long));
2443#ifdef USE_ENUM_COPY_STRINGS
2445static size_t strswapbufcpy(
char *buf,
const char **orig)
2447 const char *src = *orig;
2451 while ((*dst = *src)) {
2476 const bool is_enum_flag,
2477 PyObject *default_py,
2478 int *r_default_value)
2482 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
2483 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
2485#ifdef USE_ENUM_COPY_STRINGS
2486 Py_ssize_t totbuf = 0;
2488 short default_used = 0;
2489 const char *default_str_cmp =
nullptr;
2490 int default_int_cmp = 0;
2494 PyErr_SetString(PyExc_TypeError,
2495 "EnumProperty(...): maximum " STRINGIFY(
2499 if (default_py && !PySet_Check(default_py)) {
2500 PyErr_Format(PyExc_TypeError,
2501 "EnumProperty(...): default option must be a 'set' "
2502 "type when ENUM_FLAG is enabled, not a '%.200s'",
2503 Py_TYPE(default_py)->tp_name);
2510 default_str_cmp = PyUnicode_AsUTF8(default_py);
2511 if (default_str_cmp ==
nullptr) {
2512 PyErr_Format(PyExc_TypeError,
2513 "EnumProperty(...): default option must be a 'str' or 'int' "
2514 "type when ENUM_FLAG is disabled, not a '%.200s'",
2515 Py_TYPE(default_py)->tp_name);
2523 *r_default_value = 0;
2527 for (i = 0; i < seq_len; i++) {
2529 const char *tmp_icon =
nullptr;
2530 Py_ssize_t item_size;
2531 Py_ssize_t id_str_len;
2532 Py_ssize_t name_str_len;
2533 Py_ssize_t desc_str_len;
2535 item = seq_fast_items[i];
2537 if (PyTuple_CheckExact(item) && (item_size = PyTuple_GET_SIZE(item)) &&
2538 (item_size >= 3 && item_size <= 5) &&
2539 (tmp.
identifier = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 0), &id_str_len)) &&
2540 (tmp.
name = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 1), &name_str_len)) &&
2541 (tmp.
description = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 2), &desc_str_len)) &&
2545 (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) &&
2549 if (item_size < 4) {
2553 if (default_py && PySet_Contains(default_py, PyTuple_GET_ITEM(item, 0))) {
2554 *r_default_value |= tmp.
value;
2559 if (item_size < 4) {
2563 if (default_py && default_used == 0) {
2564 if ((default_str_cmp !=
nullptr &&
STREQ(default_str_cmp, tmp.
identifier)) ||
2565 (default_str_cmp ==
nullptr && default_int_cmp == tmp.
value))
2567 *r_default_value = tmp.
value;
2579#ifdef USE_ENUM_COPY_STRINGS
2581 totbuf += id_str_len + name_str_len + desc_str_len + 3;
2584 else if (item == Py_None) {
2590 PyErr_SetString(PyExc_TypeError,
2591 "EnumProperty(...): expected a tuple containing "
2592 "(identifier, name, description) and optionally an "
2593 "icon name and unique number");
2600 if (default_py && default_used != PySet_GET_SIZE(default_py)) {
2603 PyErr_Format(PyExc_TypeError,
2604 "EnumProperty(..., default={...}): set has %d unused member(s)",
2605 PySet_GET_SIZE(default_py) - default_used);
2610 if (default_py && default_used == 0) {
2613 if (default_str_cmp) {
2614 PyErr_Format(PyExc_TypeError,
2615 "EnumProperty(..., default=\'%s\'): not found in enum members",
2619 PyErr_Format(PyExc_TypeError,
2620 "EnumProperty(..., default=%d): not found in enum members",
2627#ifdef USE_ENUM_COPY_STRINGS
2633 "enum_items_from_py2");
2635 char *buf = ((
char *)items_dup) + (
sizeof(
EnumPropertyItem) * (seq_len + 1));
2637 for (i = 0; i < seq_len; i++, items_ptr++) {
2638 buf += strswapbufcpy(buf, &items_ptr->
identifier);
2639 buf += strswapbufcpy(buf, &items_ptr->
name);
2640 buf += strswapbufcpy(buf, &items_ptr->
description);
2656 PyGILState_STATE gilstate;
2661 gilstate = PyGILState_Ensure();
2665 PyObject *py_func = prop_store->
py_data.enum_data.itemf_fn;
2672 PyObject *args = PyTuple_New(2);
2675 Py_INCREF(py_context);
2678 items = PyObject_CallObject(py_func, args);
2683 if (items ==
nullptr) {
2687 PyObject *items_fast;
2688 int default_value_dummy = 0;
2690 if (!(items_fast = PySequence_Fast(items,
2691 "EnumProperty(...): "
2692 "return value from the callback was not a sequence")))
2700 &default_value_dummy);
2702 Py_DECREF(items_fast);
2725 PyGILState_Release(gilstate);
2733 if (py_func && py_func != Py_None) {
2734 if (!PyFunction_Check(py_func)) {
2735 PyErr_Format(PyExc_TypeError,
2736 "%s keyword: expected a function type, not a %.200s",
2738 Py_TYPE(py_func)->tp_name);
2742 PyCodeObject *f_code =
reinterpret_cast<PyCodeObject *
>(PyFunction_GET_CODE(py_func));
2743 if (f_code->co_argcount != argcount) {
2744 PyErr_Format(PyExc_TypeError,
2745 "%s keyword: expected a function taking %d arguments, not %d",
2748 f_code->co_argcount);
2765 if (update_fn && update_fn != Py_None) {
2775 if (poll_fn && poll_fn != Py_None) {
2786 PyObject *get_transform_fn,
2787 PyObject *set_transform_fn)
2794 if (get_fn && get_fn != Py_None) {
2801 if (set_fn && set_fn != Py_None) {
2803 PyErr_SetString(PyExc_ValueError,
2804 "The `set` callback is defined without a matching `get` function, this is "
2805 "not supported. `set_transform` should probably be used instead?");
2815 if (get_transform_fn && get_transform_fn != Py_None) {
2822 if (set_transform_fn && set_transform_fn != Py_None) {
2830 prop, rna_get_fn, rna_set_fn, rna_get_transform_fn, rna_set_transform_fn);
2838 PyObject *get_transform_fn,
2839 PyObject *set_transform_fn)
2846 if (get_fn && get_fn != Py_None) {
2853 if (set_fn && set_fn != Py_None) {
2855 PyErr_SetString(PyExc_ValueError,
2856 "The `set` callback is defined without a matching `get` function, this is "
2857 "not supported. `set_transform` should probably be used instead?");
2867 if (get_transform_fn && get_transform_fn != Py_None) {
2874 if (set_transform_fn && set_transform_fn != Py_None) {
2882 prop, rna_get_fn, rna_set_fn, rna_get_transform_fn, rna_set_transform_fn);
2890 PyObject *get_transform_fn,
2891 PyObject *set_transform_fn)
2898 if (get_fn && get_fn != Py_None) {
2905 if (set_fn && set_fn != Py_None) {
2907 PyErr_SetString(PyExc_ValueError,
2908 "The `set` callback is defined without a matching `get` function, this is "
2909 "not supported. `set_transform` should probably be used instead?");
2919 if (get_transform_fn && get_transform_fn != Py_None) {
2926 if (set_transform_fn && set_transform_fn != Py_None) {
2934 prop, rna_get_fn, rna_set_fn,
nullptr, rna_get_transform_fn, rna_set_transform_fn);
2942 PyObject *get_transform_fn,
2943 PyObject *set_transform_fn)
2950 if (get_fn && get_fn != Py_None) {
2957 if (set_fn && set_fn != Py_None) {
2959 PyErr_SetString(PyExc_ValueError,
2960 "The `set` callback is defined without a matching `get` function, this is "
2961 "not supported. `set_transform` should probably be used instead?");
2970 if (get_transform_fn && get_transform_fn != Py_None) {
2977 if (set_transform_fn && set_transform_fn != Py_None) {
2985 prop, rna_get_fn, rna_set_fn,
nullptr, rna_get_transform_fn, rna_set_transform_fn);
2991 PyObject *get_transform_fn,
2992 PyObject *set_transform_fn)
2999 if (get_fn && get_fn != Py_None) {
3006 if (set_fn && set_fn != Py_None) {
3008 PyErr_SetString(PyExc_ValueError,
3009 "The `set` callback is defined without a matching `get` function, this is "
3010 "not supported. `set_transform` should probably be used instead?");
3020 if (get_transform_fn && get_transform_fn != Py_None) {
3027 if (set_transform_fn && set_transform_fn != Py_None) {
3035 prop, rna_get_fn, rna_set_fn,
nullptr, rna_get_transform_fn, rna_set_transform_fn);
3043 PyObject *get_transform_fn,
3044 PyObject *set_transform_fn)
3051 if (get_fn && get_fn != Py_None) {
3058 if (set_fn && set_fn != Py_None) {
3060 PyErr_SetString(PyExc_ValueError,
3061 "The `set` callback is defined without a matching `get` function, this is "
3062 "not supported. `set_transform` should probably be used instead?");
3071 if (get_transform_fn && get_transform_fn != Py_None) {
3078 if (set_transform_fn && set_transform_fn != Py_None) {
3086 prop, rna_get_fn, rna_set_fn,
nullptr, rna_get_transform_fn, rna_set_transform_fn);
3092 PyObject *get_transform_fn,
3093 PyObject *set_transform_fn,
3094 PyObject *search_fn,
3104 if (get_fn && get_fn != Py_None) {
3112 if (set_fn && set_fn != Py_None) {
3114 PyErr_SetString(PyExc_ValueError,
3115 "The `set` callback is defined without a matching `get` function, this is "
3116 "not supported. `set_transform` should probably be used instead?");
3126 if (get_transform_fn && get_transform_fn != Py_None) {
3133 if (set_transform_fn && set_transform_fn != Py_None) {
3148 prop, rna_get_fn, rna_length_fn, rna_set_fn, rna_get_transform_fn, rna_set_transform_fn);
3149 if (rna_search_fn) {
3160 PyObject *get_transform_fn,
3161 PyObject *set_transform_fn)
3169 if (get_fn && get_fn != Py_None) {
3176 if (set_fn && set_fn != Py_None) {
3178 PyErr_SetString(PyExc_ValueError,
3179 "The `set` callback is defined without a matching `get` function, this is "
3180 "not supported. `set_transform` should probably be used instead?");
3190 if (itemf_fn && itemf_fn != Py_None) {
3196 if (get_transform_fn && get_transform_fn != Py_None) {
3203 if (set_transform_fn && set_transform_fn != Py_None) {
3211 prop, rna_get_fn, rna_set_fn, rna_itemf_fn, rna_get_transform_fn, rna_set_transform_fn);
3238 PyObject *method_object,
3239 PyObject **r_deferred_result)
3242 BLI_assert(PyCFunction_CheckExact(method_object));
3244 const int args_len = PyTuple_GET_SIZE(args);
3245 PyMethodDef *method_def = (
reinterpret_cast<PyCFunctionObject *
>(method_object))->m_ml;
3248 if (args_len == 1) {
3249 self = PyTuple_GET_ITEM(args, 0);
3250 args = PyTuple_New(0);
3253 PyCFunctionWithKeywords method_fn = (PyCFunctionWithKeywords)(
void *)method_def->ml_meth;
3254 *r_deferred_result = method_fn(self, args, kw);
3260 const char *error_prefix = method_def->ml_name;
3262 PyErr_Format(PyExc_ValueError,
"%s: all args must be keywords", error_prefix);
3263 *r_deferred_result =
nullptr;
3269 if (srna ==
nullptr) {
3270 *r_deferred_result = PyErr_Occurred() ?
3279 *r_deferred_result =
reinterpret_cast<PyObject *
>(
intptr_t(1));
3306 if (!PyUnicode_Check(o)) {
3307 PyErr_Format(PyExc_TypeError,
"expected a string (got %.200s)", Py_TYPE(o)->tp_name);
3314 id = PyUnicode_AsUTF8AndSize(o, &id_len);
3316 PyErr_Format(PyExc_TypeError,
"'%.200s' too long, max length is %d",
id,
MAX_IDPROP_NAME - 1);
3324 PyErr_Format(PyExc_TypeError,
3325 "'%s' is defined as a non-dynamic type for '%s'",
3350 if (parse_data->
base.
items ==
nullptr) {
3351 PyErr_Format(PyExc_TypeError,
3352 "property-tags not available for '%s'",
3365#define BPY_PROPDEF_NAME_DOC \
3366 " :param name: Name used in the user interface.\n" \
3367 " :type name: str\n"
3369#define BPY_PROPDEF_DESC_DOC \
3370 " :param description: Text used for the tooltip and api documentation.\n" \
3371 " :type description: str\n"
3373#define BPY_PROPDEF_CTXT_DOC \
3374 " :param translation_context: Text used as context to disambiguate translations.\n" \
3375 " :type translation_context: str\n"
3377#define BPY_PROPDEF_UNIT_DOC \
3378 " :param unit: Enumerator in :ref:`rna_enum_property_unit_items`.\n" \
3379 " :type unit: str\n"
3381#define BPY_PROPDEF_DEFAULT_DOC(ty) \
3382 " :param default: The default value for this property.\n" \
3383 " :type default: " ty "\n"
3385#define BPY_PROPDEF_NUM_MIN_DOC_(ty) \
3386 " :param min: Hard minimum, trying to assign a value below " \
3387 "will silently assign this minimum instead.\n" \
3388 " :type min: " ty "\n"
3390#define BPY_PROPDEF_NUM_MAX_DOC_(ty) \
3391 " :param max: Hard maximum, trying to assign a value above " \
3392 "will silently assign this maximum instead.\n" \
3393 " :type max: " ty "\n"
3395#define BPY_PROPDEF_NUM_MINMAX_DOC(ty) BPY_PROPDEF_NUM_MIN_DOC_(ty) BPY_PROPDEF_NUM_MAX_DOC_(ty)
3397#define BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) \
3398 " :param soft_min: Soft minimum (>= *min*), " \
3399 "user won't be able to drag the widget below this value in the UI.\n" \
3400 " :type soft_min: " ty "\n"
3402#define BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty) \
3403 " :param soft_max: Soft maximum (<= *max*), " \
3404 "user won't be able to drag the widget above this value in the UI.\n" \
3405 " :type soft_max: " ty "\n"
3407#define BPY_PROPDEF_NUM_SOFT_MINMAX_DOC(ty) \
3408 BPY_PROPDEF_NUM_SOFT_MIN_DOC_(ty) BPY_PROPDEF_NUM_SOFT_MAX_DOC_(ty)
3410#define BPY_PROPDEF_VECSIZE_DOC \
3411 " :param size: Vector dimensions in [1, " STRINGIFY(PYRNA_STACK_ARRAY) "]. " \
3412"An int sequence can be used to define multi-dimension arrays.\n" \
3413" :type size: int | Sequence[int]\n"
3415#define BPY_PROPDEF_INT_STEP_DOC \
3416 " :param step: Step of increment/decrement in UI, " \
3417 "in [1, 100], defaults to 1 (WARNING: unused currently!).\n" \
3418 " :type step: int\n"
3420#define BPY_PROPDEF_FLOAT_STEP_DOC \
3421 " :param step: Step of increment/decrement in UI, " \
3422 "in [1, 100], defaults to 3 (WARNING: actual value is /100).\n" \
3423 " :type step: float\n"
3425#define BPY_PROPDEF_FLOAT_PREC_DOC \
3426 " :param precision: Maximum number of decimal digits to display, in [0, 6]. Fraction is " \
3427 "automatically hidden for exact integer values of fields with unit 'NONE' or 'TIME' (frame " \
3428 "count) and step divisible by 100.\n" \
3429 " :type precision: int\n"
3431#define BPY_PROPDEF_UPDATE_DOC \
3432 " :param update: Function to be called when this value is modified,\n" \
3433 " This function must take 2 values (self, context) and return None.\n" \
3434 " *Warning* there are no safety checks to avoid infinite recursion.\n" \
3435 " :type update: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`], " \
3438#define BPY_PROPDEF_POLL_DOC \
3439 " :param poll: Function that determines whether an item is valid for this property.\n" \
3440 " The function must take 2 values (self, object) and return a boolean.\n" \
3442 " .. note:: The return value will be checked only when assigning an item from the UI, " \
3443 "but it is still possible to assign an \"invalid\" item to the property directly.\n" \
3445 " :type poll: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.ID`], " \
3448#define BPY_PROPDEF_GET_DOC(ty) \
3449 " :param get: Function to be called when this value is 'read', and the default,\n" \
3450 " system-defined storage is not used for this property.\n" \
3451 " This function must take 1 value (self) and return the value of the property.\n" \
3453 " .. note:: Defining this callback without a matching ``set`` one will make " \
3454 "the property read-only (even if ``READ_ONLY`` option is not set)." \
3456 " :type get: Callable[[:class:`bpy.types.bpy_struct`], " ty "] | None\n"
3458#define BPY_PROPDEF_SET_DOC(ty) \
3459 " :param set: Function to be called when this value is 'written', and the default,\n" \
3460 " system-defined storage is not used for this property.\n" \
3461 " This function must take 2 values (self, value) and return None.\n" \
3463 " .. note:: Defining this callback without a matching ``get`` one is invalid." \
3465 " :type set: Callable[[:class:`bpy.types.bpy_struct`, " ty "], None] | None\n"
3467#define BPY_PROPDEF_GET_TRANSFORM_DOC(ty) \
3468 " :param get_transform: Function to be called when this value is 'read',\n" \
3469 " if some additional processing must be performed on the stored value.\n" \
3470 " This function must take three arguments (self, the stored value,\n" \
3471 " and a boolean indicating if the property is currently set),\n" \
3472 " and return the final, transformed value of the property.\n" \
3474 " .. note:: The callback is responsible to ensure that value limits of the property " \
3475 "(min/max, length...) are respected. Otherwise a ValueError exception is raised.\n" \
3477 " :type get_transform: Callable[[:class:`bpy.types.bpy_struct`, " ty ", bool], " ty \
3480#define BPY_PROPDEF_SET_TRANSFORM_DOC(ty) \
3481 " :param set_transform: Function to be called when this value is 'written',\n" \
3482 " if some additional processing must be performed on the given value before storing it.\n" \
3483 " This function must take four arguments (self, the given value to store,\n" \
3484 " the currently stored value ('raw' value, without any ``get_transform`` applied to " \
3486 " and a boolean indicating if the property is currently set),\n" \
3487 " and return the final, transformed value of the property.\n" \
3489 " .. note:: The callback is responsible to ensure that value limits (min/max, " \
3490 "length...) are respected. Otherwise a ValueError exception is raised.\n" \
3492 " :type set_transform: " \
3493 "Callable[[:class:`bpy.types.bpy_struct`, " ty ", " ty ", bool], " ty "] | None\n"
3495#define BPY_PROPDEF_SEARCH_DOC \
3496 " :param search: Function to be called to show candidates " \
3497 "for this string (shown in the UI).\n" \
3498 " This function must take 3 values (self, context, edit_text)\n" \
3499 " and return a sequence, iterator or generator where each item must be:\n" \
3501 " - A single string (representing a candidate to display).\n" \
3502 " - A tuple-pair of strings, where the first is a candidate and the second\n" \
3503 " is additional information about the candidate.\n" \
3504 " :type search: Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context`, str], " \
3505 "Iterable[str | tuple[str, str]]" \
3507 " :param search_options: Set of strings in:\n" \
3509 " - 'SORT' sorts the resulting items.\n" \
3510 " - 'SUGGESTION' lets the user enter values not found in search candidates.\n" \
3511 " **WARNING** disabling this flag causes the search callback to run on redraw,\n" \
3512 " so only disable this flag if it's not likely to cause performance issues.\n" \
3514 " :type search_options: set[str]\n"
3516#define BPY_PROPDEF_POINTER_TYPE_DOC \
3517 " :param type: A subclass of PropertyGroup or ID.\n" \
3518 " :type type: type[:class:`bpy.types.PropertyGroup` | :class:`bpy.types.ID`]\n"
3520#define BPY_PROPDEF_COLLECTION_TYPE_DOC \
3521 " :param type: A subclass of a property group.\n" \
3522 " :type type: type[:class:`bpy.types.PropertyGroup`]\n"
3524#define BPY_PROPDEF_TAGS_DOC \
3525 " :param tags: Enumerator of tags that are defined by parent class.\n" \
3526 " :type tags: set[str]\n"
3528#define BPY_PROPDEF_RETURN_DOC \
3529 " :return: Opaque type used for registration.\n" \
3530 " :rtype: :class:`_PropertyDeferred`\n"
3533static int bpy_struct_id_used(StructRNA *srna,
char *identifier)
3555 BPy_BoolProperty_doc,
3556 ".. function:: BoolProperty("
3559 "description=\"\", "
3560 "translation_context=\"*\", "
3562 "options={'ANIMATABLE'}, "
3569 "get_transform=None, "
3570 "set_transform=None)\n"
3572 " Returns a new boolean property definition.\n"
3596 PyObject *deferred_result;
3598 if (srna ==
nullptr) {
3599 return deferred_result;
3604 id_data.
srna = srna;
3606 const char *name =
nullptr, *description =
"";
3607 const char *translation_context =
nullptr;
3608 bool default_value =
false;
3612 options_enum.
value = 0;
3616 override_enum.
value = 0;
3619 tags_enum.
srna = srna;
3625 PyObject *update_fn =
nullptr;
3626 PyObject *get_fn =
nullptr;
3627 PyObject *set_fn =
nullptr;
3629 PyObject *get_transform_fn =
nullptr;
3630 PyObject *set_transform_fn =
nullptr;
3632 static const char *_keywords[] = {
3636 "translation_context",
3649 static _PyArg_Parser _parser = {
3669 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3676 &translation_context,
3719 if (translation_context) {
3726 if (options_enum.
is_set) {
3729 if (override_enum.
is_set) {
3744 BPy_BoolVectorProperty_doc,
3745 ".. function:: BoolVectorProperty("
3748 "description=\"\", "
3749 "translation_context=\"*\", "
3750 "default=(False, False, False), "
3751 "options={'ANIMATABLE'}, "
3759 "get_transform=None, "
3760 "set_transform=None)\n"
3762 " Returns a new vector boolean property definition.\n"
3769 " :param default: sequence of booleans the length of *size*.\n"
3770 " :type default: Sequence[bool]\n"
3788 PyObject *deferred_result;
3791 if (srna ==
nullptr) {
3792 return deferred_result;
3797 id_data.
srna = srna;
3799 const char *name =
nullptr, *description =
"";
3800 const char *translation_context =
nullptr;
3805 PyObject *default_py =
nullptr;
3809 options_enum.
value = 0;
3813 override_enum.
value = 0;
3816 tags_enum.
srna = srna;
3822 PyObject *update_fn =
nullptr;
3823 PyObject *get_fn =
nullptr;
3824 PyObject *set_fn =
nullptr;
3825 PyObject *get_transform_fn =
nullptr;
3826 PyObject *set_transform_fn =
nullptr;
3828 static const char *_keywords[] = {
3832 "translation_context",
3846 static _PyArg_Parser _parser = {
3863 ":BoolVectorProperty",
3867 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3874 &translation_context,
3895 if (default_py !=
nullptr) {
3898 sizeof(*default_value.
data()),
3902 "BoolVectorProperty(default=sequence)") == -1)
3929 if (array_len_info.
dims_len == 0) {
3931 if (default_py !=
nullptr) {
3937 if (default_py !=
nullptr) {
3943 if (translation_context) {
3950 if (options_enum.
is_set) {
3953 if (override_enum.
is_set) {
3965 BPy_IntProperty_doc,
3966 ".. function:: IntProperty("
3969 "description=\"\", "
3970 "translation_context=\"*\", "
3972 "min=-2**31, max=2**31-1, "
3973 "soft_min=-2**31, soft_max=2**31-1, "
3975 "options={'ANIMATABLE'}, "
3982 "get_transform=None, "
3983 "set_transform=None)\n"
3985 " Returns a new int property definition.\n"
4012 PyObject *deferred_result;
4014 if (srna ==
nullptr) {
4015 return deferred_result;
4020 id_data.
srna = srna;
4022 const char *name =
nullptr, *description =
"";
4023 const char *translation_context =
nullptr;
4026 int default_value = 0;
4031 options_enum.
value = 0;
4035 override_enum.
value = 0;
4038 tags_enum.
srna = srna;
4044 PyObject *update_fn =
nullptr;
4045 PyObject *get_fn =
nullptr;
4046 PyObject *set_fn =
nullptr;
4047 PyObject *get_transform_fn =
nullptr;
4048 PyObject *set_transform_fn =
nullptr;
4050 static const char *_keywords[] = {
4051 "attr",
"name",
"description",
"translation_context",
4052 "default",
"min",
"max",
"soft_min",
4053 "soft_max",
"step",
"options",
"override",
4054 "tags",
"subtype",
"update",
"get",
4055 "set",
"get_transform",
"set_transform",
nullptr,
4057 static _PyArg_Parser _parser = {
4082 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4089 &translation_context,
4136 if (translation_context) {
4145 if (options_enum.
is_set) {
4148 if (override_enum.
is_set) {
4160 BPy_IntVectorProperty_doc,
4161 ".. function:: IntVectorProperty("
4164 "description=\"\", "
4165 "translation_context=\"*\", "
4166 "default=(0, 0, 0), min=-2**31, max=2**31-1, "
4168 "soft_max=2**31-1, "
4170 "options={'ANIMATABLE'}, "
4178 "get_transform=None, "
4179 "set_transform=None)\n"
4181 " Returns a new vector int property definition.\n"
4188 " :param default: sequence of ints the length of *size*.\n"
4189 " :type default: Sequence[int]\n"
4210 PyObject *deferred_result;
4213 if (srna ==
nullptr) {
4214 return deferred_result;
4219 id_data.
srna = srna;
4221 const char *name =
nullptr, *description =
"";
4222 const char *translation_context =
nullptr;
4229 PyObject *default_py =
nullptr;
4233 options_enum.
value = 0;
4237 override_enum.
value = 0;
4240 tags_enum.
srna = srna;
4246 PyObject *update_fn =
nullptr;
4247 PyObject *get_fn =
nullptr;
4248 PyObject *set_fn =
nullptr;
4249 PyObject *get_transform_fn =
nullptr;
4250 PyObject *set_transform_fn =
nullptr;
4252 static const char *_keywords[] = {
4253 "attr",
"name",
"description",
"translation_context",
4254 "default",
"min",
"max",
"soft_min",
4255 "soft_max",
"step",
"options",
"override",
4256 "tags",
"subtype",
"size",
"update",
4257 "get",
"set",
"get_transform",
"set_transform",
4260 static _PyArg_Parser _parser = {
4282 ":IntVectorProperty",
4286 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4293 &translation_context,
4319 if (default_py !=
nullptr) {
4322 sizeof(*default_value.
data()),
4326 "IntVectorProperty(default=sequence)") == -1)
4353 if (array_len_info.
dims_len == 0) {
4355 if (default_py !=
nullptr) {
4361 if (default_py !=
nullptr) {
4368 if (translation_context) {
4376 if (options_enum.
is_set) {
4379 if (override_enum.
is_set) {
4391 BPy_FloatProperty_doc,
4392 ".. function:: FloatProperty("
4395 "description=\"\", "
4396 "translation_context=\"*\", "
4398 "min=-3.402823e+38, max=3.402823e+38, "
4399 "soft_min=-3.402823e+38, soft_max=3.402823e+38, "
4402 "options={'ANIMATABLE'}, "
4410 "get_transform=None, "
4411 "set_transform=None)\n"
4413 " Returns a new float (single precision) property definition.\n"
4442 PyObject *deferred_result;
4444 if (srna ==
nullptr) {
4445 return deferred_result;
4450 id_data.
srna = srna;
4452 const char *name =
nullptr, *description =
"";
4453 const char *translation_context =
nullptr;
4456 float default_value = 0.0f;
4462 options_enum.
value = 0;
4466 override_enum.
value = 0;
4469 tags_enum.
srna = srna;
4479 PyObject *update_fn =
nullptr;
4480 PyObject *get_fn =
nullptr;
4481 PyObject *set_fn =
nullptr;
4482 PyObject *get_transform_fn =
nullptr;
4483 PyObject *set_transform_fn =
nullptr;
4485 static const char *_keywords[] = {
4486 "attr",
"name",
"description",
"translation_context",
4487 "default",
"min",
"max",
"soft_min",
4488 "soft_max",
"step",
"precision",
"options",
4489 "override",
"tags",
"subtype",
"unit",
4490 "update",
"get",
"set",
"get_transform",
4491 "set_transform",
nullptr,
4493 static _PyArg_Parser _parser = {
4520 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4527 &translation_context,
4578 if (translation_context) {
4582 prop, std::max(soft_min,
min), std::min(soft_max,
max),
step, precision);
4587 if (options_enum.
is_set) {
4590 if (override_enum.
is_set) {
4602 BPy_FloatVectorProperty_doc,
4603 ".. function:: FloatVectorProperty("
4606 "description=\"\", "
4607 "translation_context=\"*\", "
4608 "default=(0.0, 0.0, 0.0), "
4609 "min=-sys.float_info.max, max=sys.float_info.max, "
4610 "soft_min=-sys.float_info.max, soft_max=sys.float_info.max, "
4613 "options={'ANIMATABLE'}, "
4622 "get_transform=None, "
4623 "set_transform=None)\n"
4625 " Returns a new vector float property definition.\n"
4632 " :param default: Sequence of floats the length of *size*.\n"
4633 " :type default: Sequence[float]\n"
4656 PyObject *deferred_result;
4659 if (srna ==
nullptr) {
4660 return deferred_result;
4665 id_data.
srna = srna;
4667 const char *name =
nullptr, *description =
"";
4668 const char *translation_context =
nullptr;
4676 PyObject *default_py =
nullptr;
4680 options_enum.
value = 0;
4684 override_enum.
value = 0;
4687 tags_enum.
srna = srna;
4697 PyObject *update_fn =
nullptr;
4698 PyObject *get_fn =
nullptr;
4699 PyObject *set_fn =
nullptr;
4700 PyObject *get_transform_fn =
nullptr;
4701 PyObject *set_transform_fn =
nullptr;
4703 static const char *_keywords[] = {
4704 "attr",
"name",
"description",
"translation_context",
4705 "default",
"min",
"max",
"soft_min",
4706 "soft_max",
"step",
"precision",
"options",
4707 "override",
"tags",
"subtype",
"unit",
4708 "size",
"update",
"get",
"set",
4709 "get_transform",
"set_transform",
nullptr,
4711 static _PyArg_Parser _parser = {
4735 ":FloatVectorProperty",
4739 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4746 &translation_context,
4775 if (default_py !=
nullptr) {
4778 sizeof(*default_value.
data()),
4782 "FloatVectorProperty(default=sequence)") == -1)
4812 if (array_len_info.
dims_len == 0) {
4814 if (default_py !=
nullptr) {
4820 if (default_py !=
nullptr) {
4827 if (translation_context) {
4831 prop, std::max(soft_min,
min), std::min(soft_max,
max),
step, precision);
4836 if (options_enum.
is_set) {
4839 if (override_enum.
is_set) {
4851 BPy_StringProperty_doc,
4852 ".. function:: StringProperty("
4855 "description=\"\", "
4856 "translation_context=\"*\", "
4859 "options={'ANIMATABLE'}, "
4866 "get_transform=None, "
4867 "set_transform=None, "
4869 "search_options={'SUGGESTION'})\n"
4871 " Returns a new string property definition.\n"
4878 " :param default: initializer string.\n"
4879 " :type default: str\n"
4880 " :param maxlen: maximum length of the string.\n"
4881 " :type maxlen: int\n"
4899 PyObject *deferred_result;
4901 if (srna ==
nullptr) {
4902 return deferred_result;
4907 id_data.
srna = srna;
4909 const char *name =
nullptr, *description =
"";
4910 const char *translation_context =
nullptr, *default_value =
"";
4916 options_enum.
value = 0;
4920 override_enum.
value = 0;
4923 tags_enum.
srna = srna;
4929 PyObject *update_fn =
nullptr;
4930 PyObject *get_fn =
nullptr;
4931 PyObject *set_fn =
nullptr;
4932 PyObject *get_transform_fn =
nullptr;
4933 PyObject *set_transform_fn =
nullptr;
4934 PyObject *search_fn =
nullptr;
4939 static const char *_keywords[] = {
4943 "translation_context",
4959 static _PyArg_Parser _parser = {
4982 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4989 &translation_context,
5007 &search_options_enum))
5040 if (default_value && default_value[0]) {
5044 if (translation_context) {
5051 if (options_enum.
is_set) {
5054 if (override_enum.
is_set) {
5072 BPy_EnumProperty_doc,
5073 ".. function:: EnumProperty("
5077 "description=\"\", "
5078 "translation_context=\"*\", "
5080 "options={'ANIMATABLE'}, "
5086 "get_transform=None, "
5087 "set_transform=None)\n"
5089 " Returns a new enumerator property definition.\n"
5091 " :param items: sequence of enum items formatted:\n"
5092 " ``[(identifier, name, description, icon, number), ...]``.\n"
5094 " The first three elements of the tuples are mandatory.\n"
5096 " :identifier: The identifier is used for Python access.\n"
5097 " An empty identifier means that the item is a separator\n"
5098 " :name: Name for the interface.\n"
5099 " :description: Used for documentation and tooltips.\n"
5100 " :icon: An icon string identifier or integer icon value\n"
5101 " (e.g. returned by :class:`bpy.types.UILayout.icon`)\n"
5102 " :number: Unique value used as the identifier for this item (stored in file data).\n"
5103 " Use when the identifier may need to change. If the *ENUM_FLAG* option is used,\n"
5104 " the values are bit-masks and should be powers of two.\n"
5106 " When an item only contains 4 items they define ``(identifier, name, description, "
5109 " Separators may be added using either None (nameless separator),\n"
5110 " or a regular item tuple with an empty identifier string, in which case the name,\n"
5111 " if non-empty, will be displayed in the UI above the separator line."
5113 " For dynamic values a callback can be passed which returns a list in\n"
5114 " the same format as the static list.\n"
5115 " This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
5119 " There is a known bug with using a callback,\n"
5120 " Python must keep a reference to the strings returned by the callback or Blender\n"
5121 " will misbehave or even crash."
5123 " :type items: Iterable["
5124 "tuple[str, str, str] | "
5125 "tuple[str, str, str, int] | "
5126 "tuple[str, str, str, str | int, int] | "
5128 "Callable[[:class:`bpy.types.bpy_struct`, :class:`bpy.types.Context` | None], "
5131 "tuple[str, str, str] | "
5132 "tuple[str, str, str, int] | "
5133 "tuple[str, str, str, str | int, int] | "
5141 " :param default: The default value for this enum, a string from the identifiers used in "
5142 "*items*, or integer matching an item number.\n"
5143 " If the *ENUM_FLAG* option is used this must be a set of such string identifiers "
5145 " WARNING: Strings cannot be specified for dynamic enums\n"
5146 " (i.e. if a callback function is given as *items* parameter).\n"
5147 " :type default: str | int | set[str] | None\n"
5163 PyObject *deferred_result;
5165 if (srna ==
nullptr) {
5166 return deferred_result;
5171 id_data.
srna = srna;
5173 const char *name =
nullptr, *description =
"";
5174 const char *translation_context =
nullptr;
5175 PyObject *default_py =
nullptr;
5176 int default_value = 0;
5177 PyObject *items, *items_fast;
5183 options_enum.
value = 0;
5187 override_enum.
value = 0;
5190 tags_enum.
srna = srna;
5192 bool is_itemf =
false;
5193 PyObject *update_fn =
nullptr;
5194 PyObject *get_fn =
nullptr;
5195 PyObject *set_fn =
nullptr;
5196 PyObject *get_transform_fn =
nullptr;
5197 PyObject *set_transform_fn =
nullptr;
5199 static const char *_keywords[] = {
5204 "translation_context",
5216 static _PyArg_Parser _parser = {
5236 if (!_PyArg_ParseTupleAndKeywordsFast(args,
5244 &translation_context,
5277 if (default_py == Py_None) {
5280 default_py =
nullptr;
5285 if (PyFunction_Check(items)) {
5286 PyCodeObject *f_code =
reinterpret_cast<PyCodeObject *
>(PyFunction_GET_CODE(items));
5287 if (f_code->co_argcount != 2) {
5288 PyErr_Format(PyExc_ValueError,
5289 "EnumProperty(...): expected 'items' function to take 2 arguments, not %d",
5290 f_code->co_argcount);
5300 "EnumProperty(...): 'default' can only be an integer when 'items' is a function");
5309 if (!(items_fast = PySequence_Fast(
5311 "EnumProperty(...): "
5312 "expected a sequence of tuples for the enum items or a function")))
5321 Py_DECREF(items_fast);
5331 srna, id_data.
value, eitems, default_value, name ? name : id_data.
value, description);
5335 srna, id_data.
value, eitems, default_value, name ? name : id_data.
value, description);
5337 if (translation_context) {
5344 if (options_enum.
is_set) {
5347 if (override_enum.
is_set) {
5352 prop, get_fn, set_fn, (is_itemf ? items :
nullptr), get_transform_fn, set_transform_fn);
5355 if (is_itemf ==
false) {
5358 Py_DECREF(items_fast);
5372 if (PyErr_Occurred()) {
5374 const char *msg_char = PyUnicode_AsUTF8(msg);
5378 PyExc_TypeError,
"%.200s expected an RNA type, failed with: %s", error_prefix, msg_char);
5382 PyErr_Format(PyExc_TypeError,
5383 "%.200s expected an RNA type, failed with type '%s'",
5385 Py_TYPE(value)->tp_name);
5395 BPy_PointerProperty_doc,
5396 ".. function:: PointerProperty("
5400 "description=\"\", "
5401 "translation_context=\"*\", "
5402 "options={'ANIMATABLE'}, "
5408 " Returns a new pointer property definition.\n"
5424 ".. note:: Pointer properties do not support storing references to embedded IDs "
5425 "(e.g. :class:`bpy.types.Scene.collection`, :class:`bpy.types.Material.node_tree`).\n"
5426 " These should exclusively be referenced and accessed through their owner ID "
5427 "(e.g. the scene or material).\n");
5432 PyObject *deferred_result;
5435 if (srna ==
nullptr) {
5436 return deferred_result;
5441 id_data.
srna = srna;
5443 const char *name =
nullptr, *description =
"";
5444 const char *translation_context =
nullptr;
5447 PyObject *type = Py_None;
5451 options_enum.
value = 0;
5455 override_enum.
value = 0;
5458 tags_enum.
srna = srna;
5460 PyObject *update_fn =
nullptr, *poll_fn =
nullptr;
5462 static const char *_keywords[] = {
5467 "translation_context",
5475 static _PyArg_Parser _parser = {
5491 if (!_PyArg_ParseTupleAndKeywordsFast(args,
5499 &translation_context,
5517 PyErr_Format(PyExc_TypeError,
5518 "PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
5534 srna, id_data.
value, ptype, name ? name : id_data.
value, description);
5535 if (translation_context) {
5542 if (options_enum.
is_set) {
5545 if (override_enum.
is_set) {
5563 BPy_CollectionProperty_doc,
5564 ".. function:: CollectionProperty("
5568 "description=\"\", "
5569 "translation_context=\"*\", "
5570 "options={'ANIMATABLE'}, "
5574 " Returns a new collection property definition.\n"
5592 PyObject *deferred_result;
5595 if (srna ==
nullptr) {
5596 return deferred_result;
5601 id_data.
srna = srna;
5603 const char *name =
nullptr, *description =
"";
5604 const char *translation_context =
nullptr;
5607 PyObject *type = Py_None;
5611 options_enum.
value = 0;
5615 override_enum.
value = 0;
5618 tags_enum.
srna = srna;
5620 static const char *_keywords[] = {
5625 "translation_context",
5631 static _PyArg_Parser _parser = {
5641 ":CollectionProperty",
5645 if (!_PyArg_ParseTupleAndKeywordsFast(args,
5653 &translation_context,
5670 PyErr_Format(PyExc_TypeError,
5671 "CollectionProperty(...) expected an RNA type derived from %.200s",
5680 srna, id_data.
value, ptype, name ? name : id_data.
value, description);
5681 if (translation_context) {
5688 if (options_enum.
is_set) {
5691 if (override_enum.
is_set) {
5707 BPy_RemoveProperty_doc,
5708 ".. function:: RemoveProperty(cls, attr)\n"
5710 " Removes a dynamically defined property.\n"
5712 " :param cls: The class containing the property (must be a positional argument).\n"
5713 " :type cls: type[:class:`bpy.types.bpy_struct`]\n"
5714 " :param attr: Property name (must be passed as a keyword).\n"
5715 " :type attr: str\n"
5719 " Typically this function doesn't need to be accessed directly.\n"
5720 " Instead use ``del cls.attr``\n");
5725 if (PyTuple_GET_SIZE(args) == 1) {
5727 self = PyTuple_GET_ITEM(args, 0);
5728 args = PyTuple_New(0);
5734 const PyMethodDef *method_def =
5736 const char *error_prefix = method_def->ml_name;
5738 if (PyTuple_GET_SIZE(args) > 1) {
5740 PyExc_ValueError,
"%s: expected one positional arg, one keyword arg", error_prefix);
5745 if (srna ==
nullptr && PyErr_Occurred()) {
5748 if (srna ==
nullptr) {
5749 PyErr_Format(PyExc_TypeError,
"%s: struct rna not available for this type", error_prefix);
5753 const char *
id =
nullptr;
5755 static const char *_keywords[] = {
5759 static _PyArg_Parser _parser = {
5765 if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &
id)) {
5770 PyErr_Format(PyExc_TypeError,
"%s: '%s' not a defined dynamic property", error_prefix,
id);
5785# pragma clang diagnostic push
5786# pragma clang diagnostic ignored "-Wcast-function-type"
5788# pragma GCC diagnostic push
5789# pragma GCC diagnostic ignored "-Wcast-function-type"
5796 METH_VARARGS | METH_KEYWORDS,
5797 BPy_BoolProperty_doc},
5798 {
"BoolVectorProperty",
5800 METH_VARARGS | METH_KEYWORDS,
5801 BPy_BoolVectorProperty_doc},
5804 METH_VARARGS | METH_KEYWORDS,
5805 BPy_IntProperty_doc},
5806 {
"IntVectorProperty",
5808 METH_VARARGS | METH_KEYWORDS,
5809 BPy_IntVectorProperty_doc},
5812 METH_VARARGS | METH_KEYWORDS,
5813 BPy_FloatProperty_doc},
5814 {
"FloatVectorProperty",
5816 METH_VARARGS | METH_KEYWORDS,
5817 BPy_FloatVectorProperty_doc},
5820 METH_VARARGS | METH_KEYWORDS,
5821 BPy_StringProperty_doc},
5824 METH_VARARGS | METH_KEYWORDS,
5825 BPy_EnumProperty_doc},
5828 METH_VARARGS | METH_KEYWORDS,
5829 BPy_PointerProperty_doc},
5830 {
"CollectionProperty",
5832 METH_VARARGS | METH_KEYWORDS,
5833 BPy_CollectionProperty_doc},
5837 METH_VARARGS | METH_KEYWORDS,
5838 BPy_RemoveProperty_doc},
5839 {
nullptr,
nullptr, 0,
nullptr},
5844# pragma clang diagnostic pop
5846# pragma GCC diagnostic pop
5853 PyObject **py_data =
reinterpret_cast<PyObject **
>(&prop_store.py_data);
5855 Py_VISIT(py_data[i]);
5864 PyObject **py_data =
reinterpret_cast<PyObject **
>(&prop_store.py_data);
5866 Py_CLEAR(py_data[i]);
5875 "This module defines properties to extend Blender's internal data. The result of these "
5877 " is used to assign properties to classes registered with Blender and can't be used "
5880 ".. note:: All parameters to these functions must be passed as keywords.\n");
5895 PyObject *submodule;
5896 PyObject *submodule_dict;
5903 PyDict_SetItemString(PyImport_GetModuleDict(),
props_module.m_name, submodule);
5906 submodule_dict = PyModule_GetDict(submodule);
5908#define ASSIGN_STATIC(_name) pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name)
ID and Library types, which are fundamental for SDNA.
Read Blender memory allocation and freeing.
#define RNA_MAX_ARRAY_DIMENSION
#define RNA_ENUM_BITFLAG_SIZE
#define BLI_assert_unreachable()
#define BPY_PROPDEF_SUBTYPE_STRING_DOC
#define ASSIGN_PYOBJECT_INCREF(a, b)
#define BPY_PROPDEF_RETURN_DOC
#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC
#define BPY_PROPDEF_NAME_DOC
#define BPY_PROPDEF_FLOAT_STEP_DOC
#define BPY_PROPDEF_UPDATE_DOC
#define BPY_PROPDEF_NUM_SOFT_MINMAX_DOC(ty)
#define BPY_PROPDEF_DEFAULT_DOC(ty)
#define BPY_PROPDEF_FLOAT_PREC_DOC
#define BPY_PROPDEF_POLL_DOC
#define BPY_PROPDEF_NUM_MINMAX_DOC(ty)
#define BPY_PROPDEF_SET_DOC(ty)
#define BPY_PROPDEF_POINTER_TYPE_DOC
#define BPY_PROPDEF_GET_TRANSFORM_DOC(ty)
#define BPY_PROPDEF_CTXT_DOC
#define BPY_PROPDEF_COLLECTION_TYPE_DOC
#define BPY_PROPDEF_TAGS_DOC
#define BPY_PROP_STORE_PY_DATA_SIZE
#define BPY_PROPDEF_OPTIONS_DOC
#define BPY_PROPDEF_GET_DOC(ty)
#define BPY_PROPDEF_SET_TRANSFORM_DOC(ty)
#define BPY_PROPDEF_SEARCH_DOC
#define BPY_PROPDEF_OPTIONS_ENUM_DOC
#define BPY_PROPDEF_UNIT_DOC
#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC
#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
#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
#define PYRNA_STACK_ARRAY
void reinitialize(const int64_t new_size)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
float length(VecOp< float, D >) RET
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static int props_visit(PyObject *, visitproc visit, void *arg)
bool(*)(PointerRNA *ptr, PropertyRNA *prop, bool value, bool is_set) BooleanPropertyGetTransformFunc
static PyObject * pymeth_RemoveProperty
static void bpy_prop_boolean_array_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const bool *curr_values, bool is_set, bool *r_values)
static int bpy_prop_int_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, int curr_value, bool is_set)
void RNA_def_property_tags(PropertyRNA *prop, int tags)
static std::string bpy_prop_string_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const std::string &new_value, const std::string &curr_value, bool is_set)
void ** RNA_struct_instance(PointerRNA *ptr)
void RNA_def_property_boolean_funcs_runtime(PropertyRNA *prop, BooleanPropertyGetFunc getfunc, BooleanPropertySetFunc setfunc, BooleanPropertyGetTransformFunc get_transform_fn, BooleanPropertySetTransformFunc set_transform_fn)
static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
static void bpy_prop_float_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const float *values)
const EnumPropertyItem rna_enum_property_flag_items[]
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_float_funcs_runtime(PropertyRNA *prop, FloatPropertyGetFunc getfunc, FloatPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc, FloatPropertyGetTransformFunc get_transform_fn, FloatPropertySetTransformFunc set_transform_fn)
void(*)(PointerRNA *ptr, PropertyRNA *prop, const int *new_values, const int *curr_values, bool is_set, int *r_values) IntArrayPropertySetTransformFunc
static void bpy_prop_enum_set_fn(PointerRNA *ptr, PropertyRNA *prop, int value)
static void bpy_prop_float_array_from_callback_or_error(PropertyRNA *prop, PyObject *float_array_obj, const BPyPropArrayLength &array_len_info, PyObject *py_func, const bool do_matrix_row_col_swap, float *r_values)
static void bpy_prop_boolean_array_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const bool *new_values, const bool *curr_values, bool is_set, bool *r_final_values)
int PyC_ParseBool(PyObject *o, void *p)
static bool py_long_as_int(PyObject *py_long, int *r_int)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
@ STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES
static void bpy_prop_int_array_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const int *new_values, const int *curr_values, bool is_set, int *r_final_values)
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const bool *array)
int(*)(PointerRNA *ptr, PropertyRNA *prop, int value, bool is_set) EnumPropertyGetTransformFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool *r_values) BooleanArrayPropertyGetFunc
static BPyPropStore * bpy_prop_py_data_ensure(PropertyRNA *prop)
static PyObject * BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_float_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
static ListBaseT< BPyPropStore > g_bpy_prop_store_list
std::string(*)(PointerRNA *ptr, PropertyRNA *prop) StringPropertyGetFunc
const EnumPropertyItem rna_enum_property_string_search_flag_items[]
static StructRNA * bpy_prop_deferred_data_or_srna(PyObject *self, PyObject *args, PyObject *kw, PyObject *method_object, PyObject **r_deferred_result)
static bool bpy_prop_string_visit_fn_call(PyObject *py_func, PyObject *item, FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
BPy_StructRNA * bpy_context_module
static bool bpy_prop_array_is_matrix_compatible_ex(int subtype, const BPyPropArrayLength *array_len_info)
void(*)(PointerRNA *ptr, PropertyRNA *prop, const float *values) FloatArrayPropertySetFunc
static PyObject * bpy_prop_deferred_function_get(BPy_PropDeferred *self, void *)
static bool bpy_prop_boolean_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, bool new_value, bool curr_value, bool is_set)
static float bpy_prop_float_get_fn(PointerRNA *ptr, PropertyRNA *prop)
static int bpy_prop_string_length_fn(PointerRNA *ptr, PropertyRNA *prop)
static void bpy_prop_int_array_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const int *curr_values, bool is_set, int *r_values)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
static bool bpy_prop_pointer_poll_fn(PointerRNA *self, PointerRNA candidate, PropertyRNA *prop)
void(*)(PointerRNA *ptr, PropertyRNA *prop, const bool *r_values) BooleanArrayPropertySetFunc
static PyObject * BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_array_matrix_swap_row_column_vn(float *values, const BPyPropArrayLength *array_len_info)
void(*)(PointerRNA *ptr, PropertyRNA *prop, float *values) FloatArrayPropertyGetFunc
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
const EnumPropertyItem rna_enum_property_unit_items[]
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static int bpy_prop_deferred_clear(BPy_PropDeferred *self)
void RNA_def_property_string_funcs_runtime(PropertyRNA *prop, StringPropertyGetFunc getfunc, StringPropertyLengthFunc lengthfunc, StringPropertySetFunc setfunc, StringPropertyGetTransformFunc get_transform_fn, StringPropertySetTransformFunc set_transform_fn)
static PyObject * BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
static void bpy_prop_int_array_from_callback_or_error(PyObject *int_array_obj, const BPyPropArrayLength &array_len_info, PyObject *py_func, int *r_values)
static void bpy_prop_assign_flag_override(PropertyRNA *prop, const int flag_override)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void bpy_prop_int_set_fn(PointerRNA *ptr, PropertyRNA *prop, int value)
StructRNA * pointer_type_from_py(PyObject *value, const char *error_prefix)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
int(*)(PointerRNA *ptr, PropertyRNA *prop) IntPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, const int *values) IntArrayPropertySetFunc
bool(*)(PointerRNA *ptr, PropertyRNA *prop, bool new_value, bool curr_value, bool is_set) BooleanPropertySetTransformFunc
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
static bool bpy_prop_array_is_matrix_compatible(PropertyRNA *prop, const BPyPropArrayLength *array_len_info)
static std::string bpy_prop_string_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const std::string &curr_value, bool is_set)
const char * RNA_struct_ui_name(const StructRNA *type)
static void bpy_prop_string_set_fn(PointerRNA *ptr, PropertyRNA *prop, const std::string &value)
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) EnumPropertySetFunc
static PyObject * pymeth_BoolProperty
static void bpy_prop_py_data_remove(PropertyRNA *prop)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
static int bpy_prop_int_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set)
const EnumPropertyItem rna_enum_property_subtype_string_items[]
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
PropertyRNA * RNA_def_pointer_runtime(StructOrFunctionRNA *cont, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
static bool bpy_prop_callback_assign_float(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
PyObject * BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA RNA_PropertyGroup
void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA *prop)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
static void bpy_prop_boolean_set_fn(PointerRNA *ptr, PropertyRNA *prop, bool value)
static PyObject * bpy_py_object_from_prop_array_with_dims(const void *values, const BPyPropArrayLength &array_len_info, const PyTypeObject &type)
static void bpy_prop_int_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const int *values)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void(*)(PointerRNA *ptr, PropertyRNA *prop, int *values) IntArrayPropertyGetFunc
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)
PyObject * BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
int(*)(PointerRNA *ptr, PropertyRNA *prop, int value, bool is_set) IntPropertyGetTransformFunc
static void bpy_prop_int_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, int *values)
static PyObject * BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
float(*)(PointerRNA *ptr, PropertyRNA *prop, float value, bool is_set) FloatPropertyGetTransformFunc
PyObject * PyC_Tuple_PackArray_Multi_Bool(const bool *array, const int dims[], const int dims_len)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
PropertyType RNA_property_type(PropertyRNA *prop)
const EnumPropertyItem rna_enum_property_override_flag_collection_items[]
void RNA_def_property_float_array_funcs_runtime(PropertyRNA *prop, FloatArrayPropertyGetFunc getfunc, FloatArrayPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc, FloatArrayPropertyGetTransformFunc get_transform_fn, FloatArrayPropertySetTransformFunc set_transform_fn)
static bool bpy_prop_callback_assign_enum(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *itemf_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static PyObject * pymeth_FloatProperty
int(*)(PointerRNA *ptr, PropertyRNA *prop) EnumPropertyGetFunc
static PyObject * pymeth_PointerProperty
void RNA_def_property_update_runtime_with_context_and_property(PropertyRNA *prop, RNAPropertyUpdateFuncWithContextAndProperty func)
static int bpy_prop_int_get_fn(PointerRNA *ptr, PropertyRNA *prop)
void(*)(PointerRNA *ptr, PropertyRNA *prop, bool value) BooleanPropertySetFunc
int RNA_property_enum_get_default(PointerRNA *ptr, PropertyRNA *prop)
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
std::string(*)(PointerRNA *ptr, PropertyRNA *prop, const std::string &new_value, const std::string &curr_value, bool is_set) StringPropertySetTransformFunc
static PyObject * bpy_prop_deferred_repr(BPy_PropDeferred *self)
const EnumPropertyItem rna_enum_property_subtype_number_array_items[]
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void bpy_prop_boolean_array_get_fn(PointerRNA *ptr, PropertyRNA *prop, bool *values)
eStringPropertySearchFlag
@ PROP_STRING_SEARCH_SUGGESTION
static float bpy_prop_float_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, float new_value, float curr_value, bool is_set)
static void bpy_prop_assign_flag(PropertyRNA *prop, int flag)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_string_search_func_runtime(PropertyRNA *prop, StringPropertySearchFunc search_fn, const eStringPropertySearchFlag search_flag)
void RNA_def_property_int_funcs_runtime(PropertyRNA *prop, IntPropertyGetFunc getfunc, IntPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc, IntPropertyGetTransformFunc get_transform_fn, IntPropertySetTransformFunc set_transform_fn)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
static std::optional< std::string > bpy_prop_string_from_callback_or_error(PyObject *str_obj, const size_t max_length, PyObject *py_func)
static PyObject * pymeth_IntVectorProperty
static PyObject * pymeth_BoolVectorProperty
static PyObject * pyrna_struct_as_instance(PointerRNA *ptr)
static BPyPropGIL_RNAWritable_State bpy_prop_gil_rna_writable_begin()
static bool bpy_prop_callback_assign_boolean(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static PyModuleDef props_module
static bool bpy_prop_callback_assign_boolean_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static void bpy_prop_boolean_array_set_fn(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
int RNA_property_flag(PropertyRNA *prop)
static int bpy_prop_enum_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set)
static const EnumPropertyItem * enum_items_from_py(PyObject *seq_fast, const bool is_enum_flag, PyObject *default_py, int *r_default_value)
int(*)(PointerRNA *ptr, PropertyRNA *prop) StringPropertyLengthFunc
PyObject * PyC_Tuple_PackArray_Multi_F32(const float *array, const int dims[], const int dims_len)
static void bpy_prop_float_array_set_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const float *new_values, const float *curr_values, bool is_set, float *r_final_values)
static PyObject * pymeth_CollectionProperty
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
int pyrna_enum_bitfield_parse_set(PyObject *o, void *p)
const EnumPropertyItem rna_enum_property_flag_enum_items[]
void(*)(PointerRNA *ptr, PropertyRNA *prop, const float *new_values, const float *curr_values, bool is_set, float *r_values) FloatArrayPropertySetTransformFunc
void BPY_rna_props_clear_all()
static int bpy_prop_enum_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, int curr_value, bool is_set)
PyObject * PyC_Tuple_PackArray_I32(const int *array, uint len)
int(*)(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set) IntPropertySetTransformFunc
void RNA_def_property_enum_funcs_runtime(PropertyRNA *prop, EnumPropertyGetFunc getfunc, EnumPropertySetFunc setfunc, EnumPropertyItemFunc itemfunc, EnumPropertyGetTransformFunc get_transform_fn, EnumPropertySetTransformFunc set_transform_fn)
static PyMethodDef props_methods[]
static PyObject * BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
PyTypeObject bpy_prop_deferred_Type
const EnumPropertyItem rna_enum_dummy_NULL_items[]
static bool bpy_prop_callback_assign_int(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static int bpy_prop_deferred_traverse(BPy_PropDeferred *self, visitproc visit, void *arg)
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
static int icon_id_from_name(const char *name)
static bool bpy_prop_boolean_get_fn(PointerRNA *ptr, PropertyRNA *prop)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
bool RNA_struct_is_ID(const StructRNA *type)
void(*)(PointerRNA *ptr, PropertyRNA *prop, const bool *new_values, const bool *curr_values, bool is_set, bool *r_values) BooleanArrayPropertySetTransformFunc
void PyC_Err_PrintWithFunc(PyObject *py_func)
void(*)(PointerRNA *ptr, PropertyRNA *prop, float value) FloatPropertySetFunc
const EnumPropertyItem rna_enum_property_override_flag_items[]
static PyObject * pymeth_StringProperty
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
const char * RNA_struct_identifier(const StructRNA *type)
int PyC_Long_AsBool(PyObject *value)
static void bpy_prop_float_set_fn(PointerRNA *ptr, PropertyRNA *prop, float value)
static void bpy_prop_float_array_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, const float *curr_values, bool is_set, float *r_values)
static float bpy_prop_float_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, float curr_value, bool is_set)
void(*)( PointerRNA *ptr, PropertyRNA *prop, const float *curr_values, bool is_set, float *r_values) FloatArrayPropertyGetTransformFunc
PropertySubType RNA_property_subtype(PropertyRNA *prop)
static bool bpy_prop_boolean_get_transform_fn(PointerRNA *ptr, PropertyRNA *prop, bool curr_value, bool is_set)
void pyrna_write_set(bool val)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_struct_flag(StructRNA *srna, StructFlag flag)
static int bpy_prop_arg_parse_id(PyObject *o, void *p)
PyObject * PyC_Tuple_PackArray_Multi_I32(const int *array, const int dims[], const int dims_len)
const EnumPropertyItem rna_enum_property_subtype_number_items[]
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool(*)(PointerRNA *ptr, PropertyRNA *prop) BooleanPropertyGetFunc
static PyObject * pymeth_FloatVectorProperty
float(*)(PointerRNA *ptr, PropertyRNA *prop, float new_value, float curr_value, bool is_set) FloatPropertySetTransformFunc
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
bool bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate) ATTR_NONNULL(1)
static void bpy_prop_callback_assign_update(PropertyRNA *prop, PyObject *update_fn)
void(*)(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, FunctionRef< void(StringPropertySearchVisitParams)> visit_fn) StringPropertySearchFunc
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_prop_deferred_data_CreatePyObject(PyObject *fn, PyObject *kw)
static PyObject * pymeth_EnumProperty
void RNA_def_property_poll_runtime(PropertyRNA *prop, const void *func)
PyObject * PyC_Tuple_PackArray_F32(const float *array, uint len)
static PyObject * BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyGetSetDef bpy_prop_deferred_getset[]
static PyObject * BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA * srna_from_self(PyObject *self, const char *error_prefix)
const EnumPropertyItem *(*)(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free) EnumPropertyItemFunc
void RNA_def_property_int_array_funcs_runtime(PropertyRNA *prop, IntArrayPropertyGetFunc getfunc, IntArrayPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc, IntArrayPropertyGetTransformFunc get_transform_fn, IntArrayPropertySetTransformFunc set_transform_fn)
static std::string bpy_prop_string_get_transform_locked_fn(PointerRNA *ptr, PropertyRNA *prop, const std::string &curr_value, bool is_set)
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)
static void bpy_prop_boolean_array_from_callback_or_error(PyObject *bool_array_obj, const BPyPropArrayLength &array_len_info, PyObject *py_func, bool *r_values)
void(*)(PointerRNA *ptr, PropertyRNA *prop, const std::string &value) StringPropertySetFunc
void(*)( PointerRNA *ptr, PropertyRNA *prop, const bool *curr_values, bool is_set, bool *r_values) BooleanArrayPropertyGetTransformFunc
float(*)(PointerRNA *ptr, PropertyRNA *prop) FloatPropertyGetFunc
void(*)(PointerRNA *ptr, PropertyRNA *prop, int value) IntPropertySetFunc
int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier)
static std::string bpy_prop_string_get_fn(PointerRNA *ptr, PropertyRNA *prop)
static PyObject * bpy_prop_deferred_call(BPy_PropDeferred *, PyObject *, PyObject *)
int(*)(PointerRNA *ptr, PropertyRNA *prop, int new_value, int curr_value, bool is_set) EnumPropertySetTransformFunc
PyObject * PyC_ExceptionBuffer()
int RNA_def_property_free_identifier_deferred_prepare(StructOrFunctionRNA *cont_, const char *identifier, void **handle)
static void bpy_prop_callback_assign_float_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static void bpy_prop_callback_assign_pointer(PropertyRNA *prop, PyObject *poll_fn)
static PyObject * BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
static int bpy_prop_callback_check(PyObject *py_func, const char *keyword, int argcount)
static bool bpy_prop_callback_assign_string(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn, PyObject *search_fn, const eStringPropertySearchFlag search_flag)
std::string(*)(PointerRNA *ptr, PropertyRNA *prop, const std::string &value, bool is_set) StringPropertyGetTransformFunc
static PyObject * bpy_prop_deferred_keywords_get(BPy_PropDeferred *self, void *)
static void bpy_prop_callback_assign_int_array(PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *get_transform_fn, PyObject *set_transform_fn)
static int props_clear(PyObject *)
const EnumPropertyItem rna_enum_icon_items[]
int RNA_property_string_maxlength(PropertyRNA *prop)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
static int bpy_prop_enum_get_fn(PointerRNA *ptr, PropertyRNA *prop)
void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate)
PyObject * PyC_Tuple_PackArray_Bool(const bool *array, uint len)
static void bpy_prop_string_visit_for_search_fn(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
void RNA_def_property_array(PropertyRNA *prop, int length)
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 RNA_def_property_boolean_array_funcs_runtime(PropertyRNA *prop, BooleanArrayPropertyGetFunc getfunc, BooleanArrayPropertySetFunc setfunc, BooleanArrayPropertyGetTransformFunc get_transform_fn, BooleanArrayPropertySetTransformFunc set_transform_fn)
void RNA_def_py_data(PropertyRNA *prop, void *py_data)
static int bpy_prop_array_length_parse(PyObject *o, void *p)
static PyObject * pymeth_IntProperty
int pyrna_enum_value_parse_string(PyObject *o, void *p)
static void bpy_prop_gil_rna_writable_end(const BPyPropGIL_RNAWritable_State &prop_state)
static std::string bpy_prop_string_get_locked_fn(PointerRNA *ptr, PropertyRNA *prop)
PyObject * BPY_rna_props()
static PyObject * BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
static const EnumPropertyItem * bpy_prop_enum_itemf_fn(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static void bpy_prop_update_fn(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void(*)( PointerRNA *ptr, PropertyRNA *prop, const int *curr_values, bool is_set, int *r_values) IntArrayPropertyGetTransformFunc
void * RNA_property_py_data_get(PropertyRNA *prop)
header-only compatibility defines.
#define PyTuple_SET_ITEMS(op_arg,...)
int dims[RNA_MAX_ARRAY_DIMENSION]
BPyPropArrayLength(PointerRNA *ptr, PropertyRNA *prop)
bool operator==(const BPyPropArrayLength &other) const
BPyPropArrayLength()=default
PyGILState_STATE gilstate
PyObject * set_transform_fn
PyObject * get_transform_fn
struct blender::BPyPropStore::@272015242115301076255227137215124016151276252032 py_data
BPy_EnumProperty_Parse base
const EnumPropertyItem * items
std::optional< std::string > info
struct blender::BPyPropStore::@272015242115301076255227137215124016151276252032::@260011254212300313036057375375011100041332121006::@171370051204113124243340350112163314233056313365 string_data
struct blender::BPyPropStore::@272015242115301076255227137215124016151276252032::@260011254212300313036057375375011100041332121006::@151171146354075051034366254366370305152246343176 enum_data
struct blender::BPyPropStore::@272015242115301076255227137215124016151276252032::@260011254212300313036057375375011100041332121006::@324322353102055344123176142377205371364333313227 pointer_data