12 #define PY_SSIZE_T_CLEAN
30 #include "RNA_prototypes.h"
36 #include "../generic/py_capi_rna.h"
37 #include "../generic/py_capi_utils.h"
48 #define BPY_PROPDEF_OPTIONS_DOC \
49 " :arg options: Enumerator in :ref:`rna_enum_property_flag_items`.\n" \
50 " :type options: set\n"
52 #define BPY_PROPDEF_OPTIONS_ENUM_DOC \
53 " :arg options: Enumerator in :ref:`rna_enum_property_flag_enum_items`.\n" \
54 " :type options: set\n"
56 #define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC \
57 " :arg override: Enumerator in :ref:`rna_enum_property_override_flag_items`.\n" \
58 " :type override: set\n"
60 #define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC \
61 " :arg override: Enumerator in :ref:`rna_enum_property_override_flag_collection_items`.\n" \
62 " :type override: set\n"
64 #define BPY_PROPDEF_SUBTYPE_STRING_DOC \
65 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_string_items`.\n" \
66 " :type subtype: string\n"
68 #define BPY_PROPDEF_SUBTYPE_NUMBER_DOC \
69 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_items`.\n" \
70 " :type subtype: string\n"
72 #define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC \
73 " :arg subtype: Enumerator in :ref:`rna_enum_property_subtype_number_array_items`.\n" \
74 " :type subtype: string\n"
151 #define BPY_PROP_STORE_PY_DATA_SIZE \
152 (sizeof(((struct BPyPropStore *)NULL)->py_data) / sizeof(PyObject *))
154 #define ASSIGN_PYOBJECT_INCREF(a, b) \
156 BLI_assert((a) == NULL); \
171 if (prop_store ==
NULL) {
172 prop_store =
MEM_callocN(
sizeof(*prop_store), __func__);
185 if (prop_store ==
NULL) {
208 PyObject_GC_UnTrack(
self);
210 PyObject_GC_Del(
self);
227 return PyUnicode_FromFormat(
"<%.200s, %R, %R>", Py_TYPE(
self)->tp_name,
self->fn,
self->kw);
252 PyObject *
ret =
self->fn;
263 PyObject *
ret =
self->kw;
275 "Intermediate storage for properties before registration.\n"
279 " This is not part of the stable API and may change between releases.");
282 PyVarObject_HEAD_INIT(
NULL, 0)
284 .tp_name =
"_PropertyDeferred",
290 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
292 .tp_doc = bpy_prop_deferred_doc,
310 PyObject_GC_Track(
self);
311 return (PyObject *)
self;
335 PyObject *
self =
NULL;
395 if (PyLong_CheckExact(o)) {
397 if (((
size = PyLong_AsLong(o)) == -1)) {
399 PyExc_ValueError,
"expected number or sequence of numbers, got %s", Py_TYPE(o)->tp_name);
414 if (!(seq_fast = PySequence_Fast(o,
"size must be a number of a sequence of numbers"))) {
417 const int seq_len = PySequence_Fast_GET_SIZE(seq_fast);
427 PyObject **seq_items = PySequence_Fast_ITEMS(seq_fast);
428 for (
int i = 0; i < seq_len; i++) {
430 if (((
size = PyLong_AsLong(seq_items[i])) == -1)) {
432 PyErr_Format(PyExc_ValueError,
433 "expected number in sequence, got %s at index %d",
440 PyErr_Format(PyExc_TypeError,
458 size_t values_elem_size,
461 const PyTypeObject *
type,
462 const char *error_str)
464 if (array_len_info->
dims_len == 0) {
466 values, values_elem_size, py_values, array_len_info->
len_total,
type, error_str);
468 const int *
dims = array_len_info->
dims;
477 ((array_len_info->
dims[0] >= 2) && (array_len_info->
dims[0] >= 4)) &&
478 ((array_len_info->
dims[1] >= 2) && (array_len_info->
dims[1] >= 4)));
492 float *values_dst,
const float *values_src,
const struct BPyPropArrayLength *array_len_info)
495 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
497 for (
int i = 0; i < dim0; i++) {
498 for (
int j = 0; j < dim1; j++) {
499 values_dst[(j * dim0) + i] = values_src[(i * dim1) + j];
507 const int dim0 = array_len_info->
dims[0], dim1 = array_len_info->
dims[1];
509 float values_orig[4 * 4];
510 memcpy(values_orig, values,
sizeof(
float) * (dim0 * dim1));
528 PyGILState_STATE gilstate;
545 args = PyTuple_New(2);
547 PyTuple_SET_ITEM(args, 0,
self);
552 ret = PyObject_CallObject(py_func, args);
560 if (
ret != Py_None) {
561 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
588 PyGILState_STATE gilstate;
602 gilstate = PyGILState_Ensure();
607 args = PyTuple_New(1);
609 PyTuple_SET_ITEM(args, 0,
self);
611 ret = PyObject_CallObject(py_func, args);
622 if (value_i == -1 && PyErr_Occurred()) {
627 value = (
bool)value_i;
634 PyGILState_Release(gilstate);
651 PyGILState_STATE gilstate;
664 gilstate = PyGILState_Ensure();
669 args = PyTuple_New(2);
671 PyTuple_SET_ITEM(args, 0,
self);
673 PyTuple_SET_ITEM(args, 1, PyBool_FromLong(value));
675 ret = PyObject_CallObject(py_func, args);
683 if (
ret != Py_None) {
684 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
692 PyGILState_Release(gilstate);
709 PyGILState_STATE gilstate;
712 bool is_values_set =
false;
726 gilstate = PyGILState_Ensure();
731 args = PyTuple_New(1);
733 PyTuple_SET_ITEM(args, 0,
self);
735 ret = PyObject_CallObject(py_func, args);
745 "BoolVectorProperty get callback") == -1) {
749 is_values_set =
true;
754 if (is_values_set ==
false) {
756 for (i = 0; i <
len; i++) {
762 PyGILState_Release(gilstate);
780 PyGILState_STATE gilstate;
796 gilstate = PyGILState_Ensure();
801 args = PyTuple_New(2);
803 PyTuple_SET_ITEM(args, 0,
self);
812 PyTuple_SET_ITEM(args, 1, py_values);
814 ret = PyObject_CallObject(py_func, args);
822 if (
ret != Py_None) {
823 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
831 PyGILState_Release(gilstate);
852 PyGILState_STATE gilstate;
866 gilstate = PyGILState_Ensure();
871 args = PyTuple_New(1);
873 PyTuple_SET_ITEM(args, 0,
self);
875 ret = PyObject_CallObject(py_func, args);
884 value = PyC_Long_AsI32(
ret);
886 if (value == -1 && PyErr_Occurred()) {
895 PyGILState_Release(gilstate);
912 PyGILState_STATE gilstate;
925 gilstate = PyGILState_Ensure();
930 args = PyTuple_New(2);
932 PyTuple_SET_ITEM(args, 0,
self);
934 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
936 ret = PyObject_CallObject(py_func, args);
944 if (
ret != Py_None) {
945 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
953 PyGILState_Release(gilstate);
970 PyGILState_STATE gilstate;
973 bool is_values_set =
false;
987 gilstate = PyGILState_Ensure();
992 args = PyTuple_New(1);
994 PyTuple_SET_ITEM(args, 0,
self);
996 ret = PyObject_CallObject(py_func, args);
1006 "IntVectorProperty get callback") == -1) {
1010 is_values_set =
true;
1015 if (is_values_set ==
false) {
1017 for (i = 0; i <
len; i++) {
1023 PyGILState_Release(gilstate);
1040 PyObject *py_values;
1041 PyGILState_STATE gilstate;
1057 gilstate = PyGILState_Ensure();
1062 args = PyTuple_New(2);
1064 PyTuple_SET_ITEM(args, 0,
self);
1066 if (array_len_info.
dims_len == 0) {
1074 PyTuple_SET_ITEM(args, 1, py_values);
1076 ret = PyObject_CallObject(py_func, args);
1084 if (
ret != Py_None) {
1085 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1093 PyGILState_Release(gilstate);
1114 PyGILState_STATE gilstate;
1128 gilstate = PyGILState_Ensure();
1133 args = PyTuple_New(1);
1135 PyTuple_SET_ITEM(args, 0,
self);
1137 ret = PyObject_CallObject(py_func, args);
1146 value = PyFloat_AsDouble(
ret);
1148 if (value == -1.0f && PyErr_Occurred()) {
1157 PyGILState_Release(gilstate);
1174 PyGILState_STATE gilstate;
1187 gilstate = PyGILState_Ensure();
1192 args = PyTuple_New(2);
1194 PyTuple_SET_ITEM(args, 0,
self);
1196 PyTuple_SET_ITEM(args, 1, PyFloat_FromDouble(value));
1198 ret = PyObject_CallObject(py_func, args);
1206 if (
ret != Py_None) {
1207 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1215 PyGILState_Release(gilstate);
1232 PyGILState_STATE gilstate;
1235 bool is_values_set =
false;
1249 gilstate = PyGILState_Ensure();
1254 args = PyTuple_New(1);
1256 PyTuple_SET_ITEM(args, 0,
self);
1258 ret = PyObject_CallObject(py_func, args);
1268 "FloatVectorProperty get callback") == -1) {
1276 is_values_set =
true;
1281 if (is_values_set ==
false) {
1283 for (i = 0; i <
len; i++) {
1289 PyGILState_Release(gilstate);
1299 const float *values)
1306 PyObject *py_values;
1307 PyGILState_STATE gilstate;
1323 gilstate = PyGILState_Ensure();
1328 args = PyTuple_New(2);
1330 PyTuple_SET_ITEM(args, 0,
self);
1332 if (array_len_info.
dims_len == 0) {
1340 PyTuple_SET_ITEM(args, 1, py_values);
1342 ret = PyObject_CallObject(py_func, args);
1350 if (
ret != Py_None) {
1351 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1359 PyGILState_Release(gilstate);
1380 PyGILState_STATE gilstate;
1393 gilstate = PyGILState_Ensure();
1398 args = PyTuple_New(1);
1400 PyTuple_SET_ITEM(args, 0,
self);
1402 ret = PyObject_CallObject(py_func, args);
1410 else if (!PyUnicode_Check(
ret)) {
1412 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1425 PyGILState_Release(gilstate);
1440 PyGILState_STATE gilstate;
1454 gilstate = PyGILState_Ensure();
1459 args = PyTuple_New(1);
1461 PyTuple_SET_ITEM(args, 0,
self);
1463 ret = PyObject_CallObject(py_func, args);
1471 else if (!PyUnicode_Check(
ret)) {
1473 PyExc_TypeError,
"return value must be a string, not %.200s", Py_TYPE(
ret)->tp_name);
1479 Py_ssize_t length_ssize_t = 0;
1480 PyUnicode_AsUTF8AndSize(
ret, &length_ssize_t);
1486 PyGILState_Release(gilstate);
1505 PyGILState_STATE gilstate;
1519 gilstate = PyGILState_Ensure();
1524 args = PyTuple_New(2);
1526 PyTuple_SET_ITEM(args, 0,
self);
1528 py_value = PyUnicode_FromString(value);
1530 PyErr_SetString(PyExc_ValueError,
"the return value must be a string");
1534 PyTuple_SET_ITEM(args, 1, py_value);
1537 ret = PyObject_CallObject(py_func, args);
1545 if (
ret != Py_None) {
1546 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1554 PyGILState_Release(gilstate);
1565 void *visit_user_data)
1568 const char *info =
NULL;
1570 if (PyTuple_CheckExact(item)) {
1572 static const char *_keywords[] = {
1577 static _PyArg_Parser _parser = {
1584 if (!_PyArg_ParseTupleAndKeywordsFast(item,
NULL, &_parser, &text, &info)) {
1590 text = PyUnicode_AsUTF8(item);
1593 PyErr_Format(PyExc_TypeError,
1594 "expected sequence of strings or tuple pairs of strings, not %.200s",
1595 Py_TYPE(item)->tp_name);
1602 visit_params.
text = text;
1603 visit_params.
info = info;
1604 visit_fn(visit_user_data, &visit_params);
1611 const char *edit_text,
1613 void *visit_user_data)
1620 PyGILState_STATE gilstate;
1621 PyObject *py_edit_text;
1629 gilstate = PyGILState_Ensure();
1634 args = PyTuple_New(3);
1636 PyTuple_SET_ITEM(args, 0,
self);
1641 py_edit_text = PyUnicode_FromString(edit_text);
1642 PyTuple_SET_ITEM(args, 2, py_edit_text);
1644 ret = PyObject_CallObject(py_func, args);
1652 if (PyIter_Check(
ret)) {
1655 PyObject *(*iternext)(PyObject *);
1656 it = PyObject_GetIter(
ret);
1661 iternext = *Py_TYPE(it)->tp_iternext;
1663 PyObject *py_text = iternext(it);
1664 if (py_text ==
NULL) {
1668 py_func, py_text, visit_fn, visit_user_data);
1675 if (PyErr_Occurred()) {
1676 if (PyErr_ExceptionMatches(PyExc_StopIteration)) {
1687 PyObject *ret_fast = PySequence_Fast(
1689 "StringProperty(...): "
1690 "return value from search callback was not a sequence, iterator or generator");
1691 if (ret_fast ==
NULL) {
1695 const Py_ssize_t ret_num = PySequence_Fast_GET_SIZE(ret_fast);
1696 PyObject **ret_fast_items = PySequence_Fast_ITEMS(ret_fast);
1697 for (Py_ssize_t i = 0; i < ret_num; i++) {
1699 py_func, ret_fast_items[i], visit_fn, visit_user_data);
1704 Py_DECREF(ret_fast);
1715 PyGILState_Release(gilstate);
1731 PyObject *py_candidate;
1737 const PyGILState_STATE gilstate = PyGILState_Ensure();
1749 args = PyTuple_New(2);
1750 PyTuple_SET_ITEM(args, 0, py_self);
1751 PyTuple_SET_ITEM(args, 1, py_candidate);
1753 ret = PyObject_CallObject(py_func, args);
1766 PyGILState_Release(gilstate);
1787 PyGILState_STATE gilstate;
1801 gilstate = PyGILState_Ensure();
1806 args = PyTuple_New(1);
1808 PyTuple_SET_ITEM(args, 0,
self);
1810 ret = PyObject_CallObject(py_func, args);
1819 value = PyC_Long_AsI32(
ret);
1821 if (value == -1 && PyErr_Occurred()) {
1830 PyGILState_Release(gilstate);
1847 PyGILState_STATE gilstate;
1860 gilstate = PyGILState_Ensure();
1865 args = PyTuple_New(2);
1867 PyTuple_SET_ITEM(args, 0,
self);
1869 PyTuple_SET_ITEM(args, 1, PyLong_FromLong(value));
1871 ret = PyObject_CallObject(py_func, args);
1879 if (
ret != Py_None) {
1880 PyErr_SetString(PyExc_ValueError,
"the return value must be None");
1888 PyGILState_Release(gilstate);
1899 if (PyLong_CheckExact(py_long)) {
1900 *r_int = (int)PyLong_AS_LONG(py_long);
1907 #ifdef USE_ENUM_COPY_STRINGS
1909 static size_t strswapbufcpy(
char *buf,
const char **orig)
1911 const char *
src = *orig;
1915 while ((*dst = *
src)) {
1941 const bool is_enum_flag,
1942 PyObject *default_py,
1943 int *r_default_value)
1947 const Py_ssize_t seq_len = PySequence_Fast_GET_SIZE(seq_fast);
1948 PyObject **seq_fast_items = PySequence_Fast_ITEMS(seq_fast);
1950 #ifdef USE_ENUM_COPY_STRINGS
1951 Py_ssize_t totbuf = 0;
1953 short default_used = 0;
1954 const char *default_str_cmp =
NULL;
1955 int default_int_cmp = 0;
1959 PyErr_SetString(PyExc_TypeError,
1960 "EnumProperty(...): maximum " STRINGIFY(
1964 if (default_py && !PySet_Check(default_py)) {
1965 PyErr_Format(PyExc_TypeError,
1966 "EnumProperty(...): default option must be a 'set' "
1967 "type when ENUM_FLAG is enabled, not a '%.200s'",
1968 Py_TYPE(default_py)->tp_name);
1975 default_str_cmp = PyUnicode_AsUTF8(default_py);
1976 if (default_str_cmp ==
NULL) {
1977 PyErr_Format(PyExc_TypeError,
1978 "EnumProperty(...): default option must be a 'str' or 'int' "
1979 "type when ENUM_FLAG is disabled, not a '%.200s'",
1980 Py_TYPE(default_py)->tp_name);
1988 *r_default_value = 0;
1992 for (i = 0; i < seq_len; i++) {
1994 const char *tmp_icon =
NULL;
1995 Py_ssize_t item_size;
1996 Py_ssize_t id_str_size;
1997 Py_ssize_t name_str_size;
1998 Py_ssize_t desc_str_size;
2000 item = seq_fast_items[i];
2002 if (PyTuple_CheckExact(item) && (item_size = PyTuple_GET_SIZE(item)) &&
2003 (item_size >= 3 && item_size <= 5) &&
2004 (tmp.
identifier = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
2005 (tmp.
name = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
2006 (tmp.
description = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
2010 (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) &&
2013 if (item_size < 4) {
2017 if (default_py && PySet_Contains(default_py, PyTuple_GET_ITEM(item, 0))) {
2018 *r_default_value |= tmp.
value;
2023 if (item_size < 4) {
2027 if (default_py && default_used == 0) {
2029 (default_str_cmp ==
NULL && default_int_cmp == tmp.
value)) {
2030 *r_default_value = tmp.
value;
2042 #ifdef USE_ENUM_COPY_STRINGS
2044 totbuf += id_str_size + name_str_size + desc_str_size + 3;
2047 else if (item == Py_None) {
2053 PyErr_SetString(PyExc_TypeError,
2054 "EnumProperty(...): expected a tuple containing "
2055 "(identifier, name, description) and optionally an "
2056 "icon name and unique number");
2063 if (default_py && default_used != PySet_GET_SIZE(default_py)) {
2066 PyErr_Format(PyExc_TypeError,
2067 "EnumProperty(..., default={...}): set has %d unused member(s)",
2068 PySet_GET_SIZE(default_py) - default_used);
2073 if (default_py && default_used == 0) {
2076 if (default_str_cmp) {
2077 PyErr_Format(PyExc_TypeError,
2078 "EnumProperty(..., default=\'%s\'): not found in enum members",
2082 PyErr_Format(PyExc_TypeError,
2083 "EnumProperty(..., default=%d): not found in enum members",
2090 #ifdef USE_ENUM_COPY_STRINGS
2095 (
sizeof(
char) * totbuf),
2096 "enum_items_from_py2");
2098 char *buf = ((
char *)items_dup) + (
sizeof(
EnumPropertyItem) * (seq_len + 1));
2100 for (i = 0; i < seq_len; i++, items_ptr++) {
2101 buf += strswapbufcpy(buf, &items_ptr->
identifier);
2102 buf += strswapbufcpy(buf, &items_ptr->
name);
2103 buf += strswapbufcpy(buf, &items_ptr->
description);
2119 PyGILState_STATE gilstate;
2122 PyObject *
self =
NULL;
2133 gilstate = PyGILState_Ensure();
2136 args = PyTuple_New(2);
2138 PyTuple_SET_ITEM(args, 0,
self);
2146 PyTuple_SET_ITEM(args, 1, Py_None);
2150 items = PyObject_CallObject(py_func, args);
2154 if (items ==
NULL) {
2158 PyObject *items_fast;
2159 int default_value_dummy = 0;
2161 if (!(items_fast = PySequence_Fast(items,
2162 "EnumProperty(...): "
2163 "return value from the callback was not a sequence"))) {
2170 Py_DECREF(items_fast);
2193 PyGILState_Release(gilstate);
2201 if (py_func && py_func != Py_None) {
2202 if (!PyFunction_Check(py_func)) {
2203 PyErr_Format(PyExc_TypeError,
2204 "%s keyword: expected a function type, not a %.200s",
2206 Py_TYPE(py_func)->tp_name);
2210 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(py_func);
2211 if (f_code->co_argcount != argcount) {
2212 PyErr_Format(PyExc_TypeError,
2213 "%s keyword: expected a function taking %d arguments, not %d",
2216 f_code->co_argcount);
2430 if (rna_search_fn) {
2489 PyObject *method_object,
2490 PyObject **r_deferred_result)
2493 BLI_assert(PyCFunction_CheckExact(method_object));
2495 const int args_len = PyTuple_GET_SIZE(args);
2496 PyMethodDef *method_def = ((PyCFunctionObject *)method_object)->m_ml;
2499 if (args_len == 1) {
2500 self = PyTuple_GET_ITEM(args, 0);
2501 args = PyTuple_New(0);
2504 PyCFunctionWithKeywords method_fn = (PyCFunctionWithKeywords)method_def->ml_meth;
2505 *r_deferred_result = method_fn(
self, args, kw);
2511 const char *error_prefix = method_def->ml_name;
2513 PyErr_Format(PyExc_ValueError,
"%s: all args must be keywords", error_prefix);
2514 *r_deferred_result =
NULL;
2521 *r_deferred_result = PyErr_Occurred() ?
2530 *r_deferred_result = (PyObject *)(
intptr_t)1;
2557 if (!PyUnicode_Check(o)) {
2558 PyErr_Format(PyExc_TypeError,
"expected a string (got %.200s)", Py_TYPE(o)->tp_name);
2565 id = PyUnicode_AsUTF8AndSize(o, &id_len);
2567 PyErr_Format(PyExc_TypeError,
"'%.200s' too long, max length is %d",
id,
MAX_IDPROP_NAME - 1);
2574 PyErr_Format(PyExc_TypeError,
2575 "'%s' is defined as a non-dynamic type for '%s'",
2601 PyErr_Format(PyExc_TypeError,
2602 "property-tags not available for '%s'",
2615 #define BPY_PROPDEF_NAME_DOC \
2616 " :arg name: Name used in the user interface.\n" \
2617 " :type name: string\n"
2619 #define BPY_PROPDEF_DESC_DOC \
2620 " :arg description: Text used for the tooltip and api documentation.\n" \
2621 " :type description: string\n"
2623 #define BPY_PROPDEF_UNIT_DOC \
2624 " :arg unit: Enumerator in :ref:`rna_enum_property_unit_items`.\n" \
2625 " :type unit: string\n"
2627 #define BPY_PROPDEF_NUM_MIN_DOC \
2628 " :arg min: Hard minimum, trying to assign a value below will silently assign this minimum " \
2631 #define BPY_PROPDEF_NUM_MAX_DOC \
2632 " :arg max: Hard maximum, trying to assign a value above will silently assign this maximum " \
2635 #define BPY_PROPDEF_NUM_SOFTMIN_DOC \
2636 " :arg soft_min: Soft minimum (>= *min*), user won't be able to drag the widget below this " \
2637 "value in the UI.\n"
2639 #define BPY_PROPDEF_NUM_SOFTMAX_DOC \
2640 " :arg soft_max: Soft maximum (<= *max*), user won't be able to drag the widget above this " \
2641 "value in the UI.\n"
2643 #define BPY_PROPDEF_VECSIZE_DOC \
2644 " :arg size: Vector dimensions in [1, " STRINGIFY(PYRNA_STACK_ARRAY) "]. " \
2645 "An int sequence can be used to define multi-dimension arrays.\n" \
2646 " :type size: int or int sequence\n"
2648 #define BPY_PROPDEF_INT_STEP_DOC \
2649 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 1 (WARNING: unused " \
2651 " :type step: int\n"
2653 #define BPY_PROPDEF_FLOAT_STEP_DOC \
2654 " :arg step: Step of increment/decrement in UI, in [1, 100], defaults to 3 (WARNING: actual " \
2655 "value is /100).\n" \
2656 " :type step: int\n"
2658 #define BPY_PROPDEF_FLOAT_PREC_DOC \
2659 " :arg precision: Maximum number of decimal digits to display, in [0, 6]. Fraction is " \
2660 "automatically hidden for exact integer values of fields with unit 'NONE' or 'TIME' (frame " \
2661 "count) and step divisible by 100.\n" \
2662 " :type precision: int\n"
2664 #define BPY_PROPDEF_UPDATE_DOC \
2665 " :arg update: Function to be called when this value is modified,\n" \
2666 " This function must take 2 values (self, context) and return None.\n" \
2667 " *Warning* there are no safety checks to avoid infinite recursion.\n" \
2668 " :type update: function\n"
2670 #define BPY_PROPDEF_POLL_DOC \
2671 " :arg poll: function to be called to determine whether an item is valid for this " \
2673 " The function must take 2 values (self, object) and return Bool.\n" \
2674 " :type poll: function\n"
2676 #define BPY_PROPDEF_GET_DOC \
2677 " :arg get: Function to be called when this value is 'read',\n" \
2678 " This function must take 1 value (self) and return the value of the property.\n" \
2679 " :type get: function\n"
2681 #define BPY_PROPDEF_SET_DOC \
2682 " :arg set: Function to be called when this value is 'written',\n" \
2683 " This function must take 2 values (self, value) and return None.\n" \
2684 " :type set: function\n"
2686 #define BPY_PROPDEF_SEARCH_DOC \
2687 " :arg search: Function to be called to show candidates for this string (shown in the UI).\n" \
2688 " This function must take 3 values (self, context, edit_text)\n" \
2689 " and return a sequence, iterator or generator where each item must be:\n" \
2691 " - A single string (representing a candidate to display).\n" \
2692 " - A tuple-pair of strings, where the first is a candidate and the second\n" \
2693 " is additional information about the candidate.\n" \
2694 " :type search: function\n" \
2695 " :arg search_options: Set of strings in:\n" \
2697 " - 'SORT' sorts the resulting items.\n" \
2698 " - 'SUGGESTION' lets the user enter values not found in search candidates.\n" \
2699 " **WARNING** disabling this flag causes the search callback to run on redraw,\n" \
2700 " so only disable this flag if it's not likely to cause performance issues.\n" \
2702 " :type search_options: set\n"
2704 #define BPY_PROPDEF_POINTER_TYPE_DOC \
2705 " :arg type: A subclass of :class:`bpy.types.PropertyGroup` or :class:`bpy.types.ID`.\n" \
2706 " :type type: class\n"
2708 #define BPY_PROPDEF_COLLECTION_TYPE_DOC \
2709 " :arg type: A subclass of :class:`bpy.types.PropertyGroup`.\n" \
2710 " :type type: class\n"
2712 #define BPY_PROPDEF_TAGS_DOC \
2713 " :arg tags: Enumerator of tags that are defined by parent class.\n" \
2714 " :type tags: set\n"
2717 static int bpy_struct_id_used(
StructRNA *
srna,
char *identifier)
2739 ".. function:: BoolProperty(name=\"\", "
2740 "description=\"\", "
2742 "options={'ANIMATABLE'}, "
2750 " Returns a new boolean property definition.\n"
2759 PyObject *deferred_result;
2762 return deferred_result;
2769 const char *name =
NULL, *description =
"";
2770 bool default_value =
false;
2788 PyObject *update_fn =
NULL;
2789 PyObject *get_fn =
NULL;
2790 PyObject *set_fn =
NULL;
2792 static const char *_keywords[] = {
2806 static _PyArg_Parser _parser = {
2823 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2867 if (options_enum.
is_set) {
2870 if (override_enum.
is_set) {
2881 BPy_BoolVectorProperty_doc,
2882 ".. function:: BoolVectorProperty(name=\"\", "
2883 "description=\"\", "
2884 "default=(False, False, False), "
2885 "options={'ANIMATABLE'}, "
2894 " Returns a new vector boolean property definition.\n"
2896 " :arg default: sequence of booleans the length of *size*.\n"
2904 PyObject *deferred_result;
2908 return deferred_result;
2915 const char *name =
NULL, *description =
"";
2919 PyObject *default_py =
NULL;
2935 PyObject *update_fn =
NULL;
2936 PyObject *get_fn =
NULL;
2937 PyObject *set_fn =
NULL;
2939 static const char *_keywords[] = {
2954 static _PyArg_Parser _parser = {
2968 ":BoolVectorProperty",
2972 if (!_PyArg_ParseTupleAndKeywordsFast(args,
2996 if (default_py !=
NULL) {
2998 sizeof(*default_value[0]),
3002 "BoolVectorProperty(default=sequence)") == -1) {
3022 if (array_len_info.
dims_len == 0) {
3024 if (default_py !=
NULL) {
3030 if (default_py !=
NULL) {
3040 if (options_enum.
is_set) {
3043 if (override_enum.
is_set) {
3054 BPy_IntProperty_doc,
3055 ".. function:: IntProperty(name=\"\", "
3056 "description=\"\", "
3058 "min=-2**31, max=2**31-1, "
3059 "soft_min=-2**31, soft_max=2**31-1, "
3061 "options={'ANIMATABLE'}, "
3069 " Returns a new int property definition.\n"
3080 PyObject *deferred_result;
3083 return deferred_result;
3090 const char *name =
NULL, *description =
"";
3091 int min = INT_MIN,
max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX;
3093 int default_value = 0;
3111 PyObject *update_fn =
NULL;
3112 PyObject *get_fn =
NULL;
3113 PyObject *set_fn =
NULL;
3115 static const char *_keywords[] = {
3134 static _PyArg_Parser _parser = {
3156 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3206 if (options_enum.
is_set) {
3209 if (override_enum.
is_set) {
3220 ".. function:: IntVectorProperty(name=\"\", "
3221 "description=\"\", "
3222 "default=(0, 0, 0), min=-2**31, max=2**31-1, "
3224 "soft_max=2**31-1, "
3226 "options={'ANIMATABLE'}, "
3235 " Returns a new vector int property definition.\n"
3237 " :arg default: sequence of ints the length of *size*.\n"
3250 PyObject *deferred_result;
3254 return deferred_result;
3261 const char *name =
NULL, *description =
"";
3262 int min = INT_MIN,
max = INT_MAX, soft_min = INT_MIN, soft_max = INT_MAX;
3267 PyObject *default_py =
NULL;
3284 PyObject *update_fn =
NULL;
3285 PyObject *get_fn =
NULL;
3286 PyObject *set_fn =
NULL;
3288 static const char *_keywords[] = {
3308 static _PyArg_Parser _parser = {
3327 ":IntVectorProperty",
3331 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3360 if (default_py !=
NULL) {
3362 sizeof(*default_value[0]),
3366 "IntVectorProperty(default=sequence)") == -1) {
3386 if (array_len_info.
dims_len == 0) {
3388 if (default_py !=
NULL) {
3394 if (default_py !=
NULL) {
3406 if (options_enum.
is_set) {
3409 if (override_enum.
is_set) {
3420 ".. function:: FloatProperty(name=\"\", "
3421 "description=\"\", "
3423 "min=-3.402823e+38, max=3.402823e+38, "
3424 "soft_min=-3.402823e+38, soft_max=3.402823e+38, "
3427 "options={'ANIMATABLE'}, "
3436 " Returns a new float (single precision) property definition.\n"
3449 PyObject *deferred_result;
3452 return deferred_result;
3459 const char *name =
NULL, *description =
"";
3460 float min = -FLT_MAX,
max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX;
3462 float default_value = 0.0f;
3486 PyObject *update_fn =
NULL;
3487 PyObject *get_fn =
NULL;
3488 PyObject *set_fn =
NULL;
3490 static const char *_keywords[] = {
3491 "attr",
"name",
"description",
"default",
"min",
"max",
"soft_min",
3492 "soft_max",
"step",
"precision",
"options",
"override",
"tags",
"subtype",
3493 "unit",
"update",
"get",
"set",
NULL,
3495 static _PyArg_Parser _parser = {
3519 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3572 if (options_enum.
is_set) {
3575 if (override_enum.
is_set) {
3586 ".. function:: FloatVectorProperty(name=\"\", "
3587 "description=\"\", "
3588 "default=(0.0, 0.0, 0.0), "
3589 "min=sys.float_info.min, max=sys.float_info.max, "
3590 "soft_min=sys.float_info.min, soft_max=sys.float_info.max, "
3593 "options={'ANIMATABLE'}, "
3603 " Returns a new vector float property definition.\n"
3605 " :arg default: sequence of floats the length of *size*.\n"
3619 PyObject *deferred_result;
3623 return deferred_result;
3630 const char *name =
NULL, *description =
"";
3631 float min = -FLT_MAX,
max = FLT_MAX, soft_min = -FLT_MAX, soft_max = FLT_MAX;
3637 PyObject *default_py =
NULL;
3659 PyObject *update_fn =
NULL;
3660 PyObject *get_fn =
NULL;
3661 PyObject *set_fn =
NULL;
3663 static const char *_keywords[] = {
3664 "attr",
"name",
"description",
"default",
"min",
"max",
"soft_min",
3665 "soft_max",
"step",
"precision",
"options",
"override",
"tags",
"subtype",
3666 "unit",
"size",
"update",
"get",
"set",
NULL,
3668 static _PyArg_Parser _parser = {
3689 ":FloatVectorProperty",
3693 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3725 if (default_py !=
NULL) {
3727 sizeof(*default_value[0]),
3731 "FloatVectorProperty(default=sequence)") == -1) {
3754 if (array_len_info.
dims_len == 0) {
3756 if (default_py !=
NULL) {
3762 if (default_py !=
NULL) {
3774 if (options_enum.
is_set) {
3777 if (override_enum.
is_set) {
3788 ".. function:: StringProperty(name=\"\", "
3789 "description=\"\", "
3792 "options={'ANIMATABLE'}, "
3800 "search_options={'SUGGESTION'})\n"
3802 " Returns a new string property definition.\n"
3804 " :arg default: initializer string.\n"
3805 " :type default: string\n"
3806 " :arg maxlen: maximum length of the string.\n"
3814 PyObject *deferred_result;
3817 return deferred_result;
3824 const char *name =
NULL, *description =
"", *default_value =
"";
3843 PyObject *update_fn =
NULL;
3844 PyObject *get_fn =
NULL;
3845 PyObject *set_fn =
NULL;
3846 PyObject *search_fn =
NULL;
3852 static const char *_keywords[] = {
3869 static _PyArg_Parser _parser = {
3889 if (!_PyArg_ParseTupleAndKeywordsFast(args,
3911 &search_options_enum)) {
3937 if (default_value && default_value[0]) {
3945 if (options_enum.
is_set) {
3948 if (override_enum.
is_set) {
3959 BPy_EnumProperty_doc,
3960 ".. function:: EnumProperty(items, "
3962 "description=\"\", "
3964 "options={'ANIMATABLE'}, "
3971 " Returns a new enumerator property definition.\n"
3973 " :arg items: sequence of enum items formatted:\n"
3974 " ``[(identifier, name, description, icon, number), ...]``.\n"
3976 " The first three elements of the tuples are mandatory.\n"
3978 " :identifier: The identifier is used for Python access.\n"
3979 " :name: Name for the interface.\n"
3980 " :description: Used for documentation and tooltips.\n"
3981 " :icon: An icon string identifier or integer icon value\n"
3982 " (e.g. returned by :class:`bpy.types.UILayout.icon`)\n"
3983 " :number: Unique value used as the identifier for this item (stored in file data).\n"
3984 " Use when the identifier may need to change. If the *ENUM_FLAG* option is used,\n"
3985 " the values are bit-masks and should be powers of two.\n"
3987 " When an item only contains 4 items they define ``(identifier, name, description, "
3990 " Separators may be added using None instead of a tuple."
3992 " For dynamic values a callback can be passed which returns a list in\n"
3993 " the same format as the static list.\n"
3994 " This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
3998 " There is a known bug with using a callback,\n"
3999 " Python must keep a reference to the strings returned by the callback or Blender\n"
4000 " will misbehave or even crash."
4004 " :arg default: The default value for this enum, a string from the identifiers used in "
4005 "*items*, or integer matching an item number.\n"
4006 " If the *ENUM_FLAG* option is used this must be a set of such string identifiers "
4008 " WARNING: Strings can not be specified for dynamic enums\n"
4009 " (i.e. if a callback function is given as *items* parameter).\n"
4017 PyObject *deferred_result;
4020 return deferred_result;
4027 const char *name =
NULL, *description =
"";
4028 PyObject *default_py =
NULL;
4029 int default_value = 0;
4030 PyObject *items, *items_fast;
4045 bool is_itemf =
false;
4046 PyObject *update_fn =
NULL;
4047 PyObject *get_fn =
NULL;
4048 PyObject *set_fn =
NULL;
4050 static const char *_keywords[] = {
4064 static _PyArg_Parser _parser = {
4081 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4112 if (default_py == Py_None) {
4119 if (PyFunction_Check(
4121 PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items);
4122 if (f_code->co_argcount != 2) {
4123 PyErr_Format(PyExc_ValueError,
4124 "EnumProperty(...): expected 'items' function to take 2 arguments, not %d",
4125 f_code->co_argcount);
4135 "EnumProperty(...): 'default' can only be an integer when 'items' is a function");
4144 if (!(items_fast = PySequence_Fast(
4146 "EnumProperty(...): "
4147 "expected a sequence of tuples for the enum items or a function"))) {
4155 Py_DECREF(items_fast);
4165 srna, id_data.
value, eitems, default_value, name ? name : id_data.
value, description);
4169 srna, id_data.
value, eitems, default_value, name ? name : id_data.
value, description);
4175 if (options_enum.
is_set) {
4178 if (override_enum.
is_set) {
4185 if (is_itemf ==
false) {
4188 Py_DECREF(items_fast);
4202 if (PyErr_Occurred()) {
4204 const char *msg_char = PyUnicode_AsUTF8(msg);
4208 PyExc_TypeError,
"%.200s expected an RNA type, failed with: %s", error_prefix, msg_char);
4212 PyErr_Format(PyExc_TypeError,
4213 "%.200s expected an RNA type, failed with type '%s'",
4215 Py_TYPE(value)->tp_name);
4224 ".. function:: PointerProperty(type=None, "
4226 "description=\"\", "
4227 "options={'ANIMATABLE'}, "
4233 " Returns a new pointer property definition.\n"
4241 PyObject *deferred_result;
4245 return deferred_result;
4252 const char *name =
NULL, *description =
"";
4255 PyObject *
type = Py_None;
4268 PyObject *update_fn =
NULL, *poll_fn =
NULL;
4270 static const char *_keywords[] = {
4282 static _PyArg_Parser _parser = {
4297 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4321 PyErr_Format(PyExc_TypeError,
4322 "PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
4338 srna, id_data.
value, ptype, name ? name : id_data.
value, description);
4343 if (options_enum.
is_set) {
4346 if (override_enum.
is_set) {
4363 ".. function:: CollectionProperty(type=None, "
4365 "description=\"\", "
4366 "options={'ANIMATABLE'}, "
4370 " Returns a new collection property definition.\n"
4378 PyObject *deferred_result;
4382 return deferred_result;
4389 const char *name =
NULL, *description =
"";
4392 PyObject *
type = Py_None;
4406 static const char *_keywords[] = {
4416 static _PyArg_Parser _parser = {
4425 ":CollectionProperty",
4429 if (!_PyArg_ParseTupleAndKeywordsFast(args,
4452 PyErr_Format(PyExc_TypeError,
4453 "CollectionProperty(...) expected an RNA type derived from %.200s",
4462 srna, id_data.
value, ptype, name ? name : id_data.
value, description);
4467 if (options_enum.
is_set) {
4470 if (override_enum.
is_set) {
4485 ".. function:: RemoveProperty(cls, attr)\n"
4487 " Removes a dynamically defined property.\n"
4489 " :arg cls: The class containing the property (must be a positional argument).\n"
4490 " :type cls: type\n"
4491 " :arg attr: Property name (must be passed as a keyword).\n"
4492 " :type attr: string\n"
4494 ".. note:: Typically this function doesn't need to be accessed directly.\n"
4495 " Instead use ``del cls.attr``\n");
4500 if (PyTuple_GET_SIZE(args) == 1) {
4502 self = PyTuple_GET_ITEM(args, 0);
4503 args = PyTuple_New(0);
4508 if (PyTuple_GET_SIZE(args) > 1) {
4509 PyErr_SetString(PyExc_ValueError,
"expected one positional arg, one keyword arg");
4514 if (
srna ==
NULL && PyErr_Occurred()) {
4518 PyErr_SetString(PyExc_TypeError,
"RemoveProperty(): struct rna not available for this type");
4522 const char *
id =
NULL;
4524 static const char *_keywords[] = {
4528 static _PyArg_Parser _parser = {
4534 if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, &
id)) {
4539 PyErr_Format(PyExc_TypeError,
"RemoveProperty(): '%s' not a defined dynamic property",
id);
4555 METH_VARARGS | METH_KEYWORDS,
4556 BPy_BoolProperty_doc},
4557 {
"BoolVectorProperty",
4559 METH_VARARGS | METH_KEYWORDS,
4560 BPy_BoolVectorProperty_doc},
4563 METH_VARARGS | METH_KEYWORDS,
4564 BPy_IntProperty_doc},
4565 {
"IntVectorProperty",
4567 METH_VARARGS | METH_KEYWORDS,
4568 BPy_IntVectorProperty_doc},
4571 METH_VARARGS | METH_KEYWORDS,
4572 BPy_FloatProperty_doc},
4573 {
"FloatVectorProperty",
4575 METH_VARARGS | METH_KEYWORDS,
4576 BPy_FloatVectorProperty_doc},
4579 METH_VARARGS | METH_KEYWORDS,
4580 BPy_StringProperty_doc},
4583 METH_VARARGS | METH_KEYWORDS,
4584 BPy_EnumProperty_doc},
4587 METH_VARARGS | METH_KEYWORDS,
4588 BPy_PointerProperty_doc},
4589 {
"CollectionProperty",
4591 METH_VARARGS | METH_KEYWORDS,
4592 BPy_CollectionProperty_doc},
4596 METH_VARARGS | METH_KEYWORDS,
4597 BPy_RemoveProperty_doc},
4604 PyObject **py_data = (PyObject **)&prop_store->py_data;
4606 Py_VISIT(py_data[i]);
4615 PyObject **py_data = (PyObject **)&prop_store->py_data;
4617 Py_CLEAR(py_data[i]);
4624 PyModuleDef_HEAD_INIT,
4626 "This module defines properties to extend Blender's internal data. The result of these "
4628 " is used to assign properties to classes registered with Blender and can't be used "
4631 ".. note:: All parameters to these functions must be passed as keywords.\n",
4642 PyObject *submodule;
4643 PyObject *submodule_dict;
4646 PyDict_SetItemString(PyImport_GetModuleDict(),
props_module.m_name, submodule);
4649 submodule_dict = PyModule_GetDict(submodule);
4651 #define ASSIGN_STATIC(_name) pymeth_##_name = PyDict_GetItemString(submodule_dict, #_name)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
ID and Library types, which are fundamental for sdna.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object instance
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(* EnumPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
float(* FloatPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
@ STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES
void(* IntPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
void(* EnumPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
#define RNA_ENUM_BITFLAG_SIZE
void(* StringPropertySearchFunc)(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
void(* IntArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values)
eStringPropertySearchFlag
@ PROP_STRING_SEARCH_SUGGESTION
void(* FloatPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float value)
void(* StringPropertySearchVisitFunc)(void *visit_user_data, const StringPropertySearchVisitParams *params)
struct EnumPropertyItem EnumPropertyItem
void(* BooleanArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const bool *values)
void(* FloatArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values)
bool(* BooleanPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
void(* BooleanArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool *values)
void(* StringPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value)
void(* StringPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value)
void(* IntArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values)
int(* StringPropertyLengthFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
int(* IntPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop)
const EnumPropertyItem *(* EnumPropertyItemFunc)(struct bContext *C, PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
@ PROP_CONTEXT_PROPERTY_UPDATE
void(* FloatArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values)
void(* BooleanPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, bool value)
void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate)
void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate)
#define BPY_PROPDEF_SUBTYPE_STRING_DOC
void BPY_rna_props_clear_all(void)
static bool bpy_prop_boolean_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static PyObject * pymeth_FloatProperty
#define BPY_PROPDEF_NUM_MIN_DOC
#define ASSIGN_PYOBJECT_INCREF(a, b)
static int bpy_prop_enum_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static PyObject * BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_OPTIONS_OVERRIDE_COLLECTION_DOC
static void bpy_prop_callback_assign_pointer(struct PropertyRNA *prop, PyObject *poll_fn)
static bool py_long_as_int(PyObject *py_long, int *r_int)
static struct PyModuleDef props_module
static void bpy_prop_float_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, float value)
PyObject * BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_NAME_DOC
static PyGetSetDef bpy_prop_deferred_getset[]
PyObject * BPY_rna_props(void)
static const EnumPropertyItem * enum_items_from_py(PyObject *seq_fast, const bool is_enum_flag, PyObject *default_py, int *r_default_value)
static void bpy_prop_int_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values)
static void bpy_prop_string_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value)
#define BPY_PROPDEF_FLOAT_STEP_DOC
static PyObject * pymeth_IntVectorProperty
PyDoc_STRVAR(bpy_prop_deferred_doc, "Intermediate storage for properties before registration.\n" "\n" ".. note::\n" "\n" " This is not part of the stable API and may change between releases.")
#define BPY_PROPDEF_UPDATE_DOC
static PyObject * pymeth_EnumProperty
#define BPY_PROPDEF_GET_DOC
static struct BPyPropStore * bpy_prop_py_data_ensure(struct PropertyRNA *prop)
static void bpy_prop_callback_assign_update(struct PropertyRNA *prop, PyObject *update_fn)
static PyObject * bpy_prop_deferred_function_get(BPy_PropDeferred *self, void *UNUSED(closure))
static void bpy_prop_callback_assign_string(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *search_fn, const eStringPropertySearchFlag search_flag)
static void bpy_prop_callback_assign_float(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static void bpy_prop_enum_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
static void bpy_prop_string_visit_for_search_fn(const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
static int bpy_prop_deferred_clear(BPy_PropDeferred *self)
static void bpy_prop_py_data_remove(PropertyRNA *prop)
static void bpy_prop_boolean_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, bool value)
#define BPY_PROPDEF_NUM_SOFTMIN_DOC
static void bpy_prop_boolean_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const bool *values)
static bool bpy_prop_array_is_matrix_compatible(PropertyRNA *prop, const struct BPyPropArrayLength *array_len_info)
static int props_visit(PyObject *UNUSED(self), visitproc visit, void *arg)
#define BPY_PROPDEF_FLOAT_PREC_DOC
#define BPY_PROPDEF_POLL_DOC
static PyObject * pymeth_FloatVectorProperty
static bool bpy_prop_pointer_poll_fn(struct PointerRNA *self, PointerRNA candidate, struct PropertyRNA *prop)
static PyObject * pymeth_IntProperty
static int bpy_prop_array_from_py_with_dims(void *values, size_t values_elem_size, PyObject *py_values, const struct BPyPropArrayLength *array_len_info, const PyTypeObject *type, const char *error_str)
static int props_clear(PyObject *UNUSED(self))
static const EnumPropertyItem * bpy_prop_enum_itemf_fn(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static PyObject * bpy_prop_deferred_data_CreatePyObject(PyObject *fn, PyObject *kw)
static PyObject * BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
StructRNA * pointer_type_from_py(PyObject *value, const char *error_prefix)
static void bpy_prop_callback_assign_boolean(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define BPY_PROPDEF_POINTER_TYPE_DOC
static PyObject * BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
static bool bpy_prop_array_is_matrix_compatible_ex(int subtype, const struct BPyPropArrayLength *array_len_info)
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
static void bpy_prop_update_fn(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop)
static PyObject * pymeth_RemoveProperty
static StructRNA * bpy_prop_deferred_data_or_srna(PyObject *self, PyObject *args, PyObject *kw, PyObject *method_object, PyObject **r_deferred_result)
static PyObject * BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static int icon_id_from_name(const char *name)
PyObject * BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * pymeth_CollectionProperty
static int bpy_prop_int_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static void bpy_prop_assign_flag(PropertyRNA *prop, const int flag)
#define BPY_PROPDEF_COLLECTION_TYPE_DOC
#define BPY_PROPDEF_TAGS_DOC
static void bpy_prop_float_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values)
static int bpy_prop_deferred_traverse(BPy_PropDeferred *self, visitproc visit, void *arg)
#define BPY_PROP_STORE_PY_DATA_SIZE
static int bpy_prop_array_length_parse(PyObject *o, void *p)
static void bpy_prop_string_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value)
static void bpy_prop_int_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values)
static PyObject * pymeth_PointerProperty
static void bpy_prop_callback_assign_int_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define BPY_PROPDEF_OPTIONS_DOC
static void bpy_prop_callback_assign_enum(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn, PyObject *itemf_fn)
static int bpy_prop_arg_parse_id(PyObject *o, void *p)
static PyObject * pyrna_struct_as_instance(PointerRNA *ptr)
static void bpy_prop_callback_assign_int(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define BPY_PROPDEF_NUM_SOFTMAX_DOC
static void bpy_prop_int_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, int value)
#define BPY_PROPDEF_SEARCH_DOC
static void bpy_prop_boolean_array_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, bool *values)
static struct PyMethodDef props_methods[]
static void bpy_prop_callback_assign_float_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
static PyObject * BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * pymeth_BoolProperty
#define BPY_PROPDEF_OPTIONS_ENUM_DOC
static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p)
#define BPY_PROPDEF_UNIT_DOC
#define BPY_PROPDEF_NUM_MAX_DOC
#define BPY_PROPDEF_SUBTYPE_NUMBER_DOC
static PyObject * bpy_prop_deferred_keywords_get(BPy_PropDeferred *self, void *UNUSED(closure))
static float bpy_prop_float_get_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
static bool bpy_prop_string_visit_fn_call(PyObject *py_func, PyObject *item, StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
static int bpy_prop_callback_check(PyObject *py_func, const char *keyword, int argcount)
static void bpy_prop_callback_assign_boolean_array(struct PropertyRNA *prop, PyObject *get_fn, PyObject *set_fn)
#define ASSIGN_STATIC(_name)
static int bpy_prop_string_length_fn(struct PointerRNA *ptr, struct PropertyRNA *prop)
#define BPY_PROPDEF_SUBTYPE_NUMBER_ARRAY_DOC
#define BPY_PROPDEF_VECSIZE_DOC
static void bpy_prop_float_array_set_fn(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values)
static PyObject * bpy_prop_deferred_call(BPy_PropDeferred *UNUSED(self), PyObject *UNUSED(args), PyObject *UNUSED(kw))
static void bpy_prop_array_matrix_swap_row_column_vn(float *values, const struct BPyPropArrayLength *array_len_info)
static void bpy_prop_array_matrix_swap_row_column_vn_vn(float *values_dst, const float *values_src, const struct BPyPropArrayLength *array_len_info)
#define BPY_PROPDEF_INT_STEP_DOC
#define BPY_PROPDEF_DESC_DOC
PyTypeObject bpy_prop_deferred_Type
static PyObject * pymeth_BoolVectorProperty
static PyObject * BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
static ListBase g_bpy_prop_store_list
static void bpy_prop_assign_flag_override(PropertyRNA *prop, const int flag_override)
#define BPY_PROPDEF_OPTIONS_OVERRIDE_DOC
static PyObject * pymeth_StringProperty
static PyObject * bpy_prop_deferred_repr(BPy_PropDeferred *self)
static PyObject * BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
#define BPY_PROPDEF_SET_DOC
#define PYRNA_STACK_ARRAY
bool pyrna_write_check(void)
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
StructRNA * srna_from_self(PyObject *self, const char *error_prefix)
void pyrna_write_set(bool val)
BPy_StructRNA * bpy_context_module
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SyclQueue void void * src
ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
T length(const vec_base< T, Size > &a)
int pyrna_enum_bitfield_parse_set(PyObject *o, void *p)
int pyrna_enum_value_parse_string(PyObject *o, void *p)
PyObject * PyC_Tuple_PackArray_Multi_Bool(const bool *array, const int dims[], const int dims_len)
PyObject * PyC_Tuple_PackArray_Bool(const bool *array, uint len)
PyObject * PyC_Tuple_PackArray_Multi_I32(const int *array, const int dims[], const int dims_len)
PyObject * PyC_Tuple_PackArray_Multi_F32(const float *array, const int dims[], const int dims_len)
PyObject * PyC_ExceptionBuffer(void)
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_F32(const float *array, uint len)
PyObject * PyC_Tuple_PackArray_I32(const int *array, uint 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)
int PyC_ParseBool(PyObject *o, void *p)
const char * RNA_struct_identifier(const StructRNA *type)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void ** RNA_struct_instance(PointerRNA *ptr)
bool RNA_struct_is_ID(const StructRNA *type)
const char * RNA_struct_ui_name(const StructRNA *type)
PropertyType RNA_property_type(PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
int RNA_property_flag(PropertyRNA *prop)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void * RNA_property_py_data_get(PropertyRNA *prop)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_string_search_func_runtime(PropertyRNA *prop, StringPropertySearchFunc search_fn, const eStringPropertySearchFlag search_flag)
void RNA_def_struct_flag(StructRNA *srna, int flag)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_int_funcs_runtime(PropertyRNA *prop, IntPropertyGetFunc getfunc, IntPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_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)
void RNA_def_property_int_default(PropertyRNA *prop, int value)
void RNA_def_py_data(PropertyRNA *prop, void *py_data)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_poll_runtime(PropertyRNA *prop, const void *func)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_float_funcs_runtime(PropertyRNA *prop, FloatPropertyGetFunc getfunc, FloatPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_default(PropertyRNA *prop, const char *value)
void RNA_def_property_int_array_funcs_runtime(PropertyRNA *prop, IntArrayPropertyGetFunc getfunc, IntArrayPropertySetFunc setfunc, IntPropertyRangeFunc rangefunc)
void RNA_def_property_float_array_funcs_runtime(PropertyRNA *prop, FloatArrayPropertyGetFunc getfunc, FloatArrayPropertySetFunc setfunc, FloatPropertyRangeFunc rangefunc)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_update_runtime(PropertyRNA *prop, const void *func)
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const bool *array)
void RNA_def_property_boolean_funcs_runtime(PropertyRNA *prop, BooleanPropertyGetFunc getfunc, BooleanPropertySetFunc setfunc)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_tags(PropertyRNA *prop, int tags)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_string_funcs_runtime(PropertyRNA *prop, StringPropertyGetFunc getfunc, StringPropertyLengthFunc lengthfunc, StringPropertySetFunc setfunc)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
StructRNA RNA_PropertyGroup
const EnumPropertyItem rna_enum_property_override_flag_collection_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 DummyRNA_NULL_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::@1158::@1159::@1162 pointer_data
struct BPyPropStore::@1158 py_data
struct BPyPropStore * prev
struct BPyPropStore::@1158::@1159::@1161 enum_data
struct BPyPropStore::@1158::@1159::@1163 string_data
struct BPyPropStore * next
struct BPy_EnumProperty_Parse base
const struct EnumPropertyItem * items