15#include <fmt/format.h>
135 type = idtype->
refine(&tmp);
137 if (type == idtype) {
216 while (result.type->refine) {
217 type = result.type->refine(&result);
219 if (type == result.type) {
259 idprop->
flag &= ~IDP_FLAG_GHOST;
265 if (type ==
nullptr) {
268 if (type->idproperties ==
nullptr) {
278 if (property_ptr ==
nullptr) {
282 if (create && *property_ptr ==
nullptr) {
286 return *property_ptr;
305 printf(
"Got unexpected IDProp container when trying to retrieve %s: %d\n", name, group->type);
365 length[0] = idprop->
len;
380 switch (idprop->
type) {
437 &rna_PropertyGroupItem_string,
438 &rna_PropertyGroupItem_int,
439 &rna_PropertyGroupItem_float,
443 &rna_PropertyGroupItem_group,
444 &rna_PropertyGroupItem_id,
445 &rna_PropertyGroupItem_double,
446 &rna_PropertyGroupItem_idp_array,
447 &rna_PropertyGroupItem_bool,
452 &rna_PropertyGroupItem_int_array,
453 &rna_PropertyGroupItem_float_array,
457 &rna_PropertyGroupItem_collection,
459 &rna_PropertyGroupItem_double_array,
461 &rna_PropertyGroupItem_bool_array,
474 *r_prop_rna_or_id = {};
476 r_prop_rna_or_id->
ptr = *
ptr;
477 r_prop_rna_or_id->
rawprop = prop;
480 r_prop_rna_or_id->
rnaprop = prop;
501 r_prop_rna_or_id->
idprop = idprop;
507 r_prop_rna_or_id->
is_set =
true;
515 if (idprop_evaluated !=
nullptr && idprop->
type != idprop_evaluated->
type) {
516 idprop_evaluated =
nullptr;
519 r_prop_rna_or_id->
idprop = idprop_evaluated;
522 r_prop_rna_or_id->
is_set = (idprop_evaluated !=
nullptr);
528 r_prop_rna_or_id->
array_len = idprop_evaluated !=
nullptr ?
uint(idprop_evaluated->
len) : 0;
536 r_prop_rna_or_id->
rnaprop = &rna_PropertyGroupItem_enum;
551 *prop = prop_rna_or_id.
rnaprop;
552 return prop_rna_or_id.
idprop;
574 return &rna_PropertyGroupItem_enum;
632 return CTX_IFACE_(type->translation_context, type->name);
650 return TIP_(type->description);
655 return type->description;
660 return type->translation_context;
665 return type->nameproperty;
670 return type->prop_tag_defines;
675 return type->iteratorproperty;
686 if (type->base == parent_type) {
738 if (srna == &RNA_AnyType) {
747 for (base = type; base; base = base->
base) {
758 if (identifier[0] ==
'[' && identifier[1] ==
'"') {
812 if (prop_type == property_type_check) {
816 "'%s : %s()' expected, got '%s : %s()'",
835 if (prop_type ==
PROP_COLLECTION && prop_struct_type == struct_type_check) {
841 "'%s : %s(type = %s)' expected, got '%s : %s()'",
851 "'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'.",
927 for (; srna; srna = srna->
base) {
929 if (prop !=
nullptr) {
940 for (; srna; srna = srna->
base) {
987 }
while ((type = type->base));
997 if (type->instance) {
1000 }
while ((type = type->base));
1039 if (
UNLIKELY(srna_exists !=
nullptr)) {
1046 if (srna_exists->
base) {
1047 for (
const StructRNA *base = srna_exists->
base; base; base = base->base) {
1067 const char *identifier,
1070 const int len_sep = strlen(sep);
1071 const int len_id = strlen(identifier);
1072 const char *p = strstr(identifier, sep);
1076 const bool failure =
true;
1079 const bool failure =
false;
1081 if (p ==
nullptr || p == identifier || p + len_sep >= identifier + len_id) {
1084 "'%s' does not contain '%s' with prefix and suffix",
1090 const char *c, *start, *end, *last;
1094 for (c = start; c != end; c++) {
1095 if (((*c >=
'A' && *c <=
'Z') || ((c != start) && (*c >=
'0' && *c <=
'9')) ||
1096 ((c != start) && (c != last) && (*c ==
'_'))) == 0)
1100 "'%s' doesn't have upper case alpha-numeric prefix",
1106 start = p + len_sep;
1107 end = identifier + len_id;
1109 for (c = start; c != end; c++) {
1110 if (((*c >=
'A' && *c <=
'Z') || (*c >=
'a' && *c <=
'z') || (*c >=
'0' && *c <=
'9') ||
1111 ((c != start) && (c != last) && (*c ==
'_'))) == 0)
1115 "'%s' doesn't have an alpha-numeric suffix",
1170 switch (rna_prop->
type) {
1236 const char *vectoritem =
"XYZW";
1237 const char *quatitem =
"WXYZ";
1238 const char *coloritem =
"RGBA";
1245 return quatitem[index];
1247 if ((index < 4) &&
ELEM(subtype,
1257 return vectoritem[index];
1260 return coloritem[index];
1285 else if (
ELEM(subtype,
1324 int softmin, softmax;
1330 *hardmin = ui_data->
min;
1331 *hardmax = ui_data->
max;
1344 iprop->
range(
ptr, hardmin, hardmax, &softmin, &softmax);
1350 iprop->
range_ex(
ptr, prop, hardmin, hardmax, &softmin, &softmax);
1362 int hardmin, hardmax;
1370 *step = ui_data_int->
step;
1387 iprop->
range(
ptr, &hardmin, &hardmax, softmin, softmax);
1389 *softmin =
max_ii(*softmin, hardmin);
1390 *softmax =
min_ii(*softmax, hardmax);
1396 iprop->
range_ex(
ptr, prop, &hardmin, &hardmax, softmin, softmax);
1398 *softmin =
max_ii(*softmin, hardmin);
1399 *softmax =
min_ii(*softmax, hardmax);
1402 *step = iprop->
step;
1408 float softmin, softmax;
1428 fprop->
range(
ptr, hardmin, hardmax, &softmin, &softmax);
1434 fprop->
range_ex(
ptr, prop, hardmin, hardmax, &softmin, &softmax);
1450 float hardmin, hardmax;
1458 *step = ui_data->
step;
1477 fprop->
range(
ptr, &hardmin, &hardmax, softmin, softmax);
1479 *softmin =
max_ff(*softmin, hardmin);
1480 *softmax =
min_ff(*softmax, hardmax);
1486 fprop->
range_ex(
ptr, prop, &hardmin, &hardmax, softmin, softmax);
1488 *softmin =
max_ff(*softmin, hardmin);
1489 *softmax =
min_ff(*softmax, hardmax);
1492 *step = fprop->
step;
1569 return &RNA_UnknownType;
1597 return pprop->
poll(
ptr, *value);
1603 const bool use_static,
1619 BLI_assert(idprop_item.identifier !=
nullptr);
1622 idprop_item.identifier,
1625 idprop_item.description ? idprop_item.description :
""};
1634 *r_totitem = totitem - 1;
1645 if (!use_static && (eprop->
item_fn !=
nullptr)) {
1649 if (C !=
nullptr || no_context) {
1652 item = eprop->
item_fn(no_context ?
nullptr :
C,
ptr, prop, r_free);
1670 *r_item = eprop->
item;
1686#ifdef WITH_INTERNATIONAL
1687static void property_enum_translate(
PropertyRNA *prop,
1700 if (!(do_iface || do_tooltip)) {
1729 if (nitem[i].name && do_iface) {
1732 if (nitem[i].description && do_tooltip) {
1751#ifdef WITH_INTERNATIONAL
1754 property_enum_translate(prop, (
EnumPropertyItem **)r_item, r_totitem, r_free);
1771 memcpy(item_array, eprop->
item, mem_size);
1777 if (eprop->
item_fn !=
nullptr) {
1781 if (C !=
nullptr || no_context) {
1786 item = eprop->
item_fn(no_context ?
nullptr :
nullptr,
ptr, prop, &
free);
1791 for (i = 0; i < eprop->
totitem; i++) {
1792 bool exists =
false;
1797 for (i_fixed = 0; item[i_fixed].
identifier; i_fixed++) {
1798 if (
STREQ(item[i_fixed].identifier, item_array[i].identifier)) {
1805 item_array[i].
name =
nullptr;
1816#ifdef WITH_INTERNATIONAL
1817 property_enum_translate(prop, &item_array, r_totitem, r_free);
1819 *r_item = item_array;
1834 *r_value = item[i].
value;
1863 const char **r_identifier)
1871 r_identifier[index] =
nullptr;
1879 *r_name = item[i].
name;
1887 const char **r_description)
1909 const char *identifier,
1916 *r_value = item[i].
value;
2100 const char **r_info)
2106 const char *info =
"";
2110 if (r_info !=
nullptr) {
2121 if (r_info !=
nullptr && (*r_info)[0] ==
'\0') {
2122 *r_info =
N_(
"This property is for internal use only and can't be edited");
2128 if (
id ==
nullptr) {
2135 if (is_linked_prop_exception) {
2138 if (r_info !=
nullptr && (*r_info)[0] ==
'\0') {
2139 *r_info =
N_(
"Can't edit this property from a linked data-block");
2146 if (r_info !=
nullptr && (*r_info)[0] ==
'\0') {
2147 *r_info =
N_(
"Can't edit this property from an override data-block");
2151 if (is_liboverride_system && !is_linked_prop_exception) {
2152 if (r_info !=
nullptr && (*r_info)[0] ==
'\0') {
2153 *r_info =
N_(
"Can't edit this property from a system override data-block");
2181 const char *dummy_info;
2221 if (anim_data && anim_data->
action &&
2245 if (linked_reference_anim_data) {
2256 bool driven, special;
2266 for (index = 0; index <
len; index++) {
2285 ret = (prop == r_prop);
2417 else if (bprop->
get) {
2420 else if (bprop->
get_ex) {
2437#define USE_INT_IDPROPS_FOR_BOOLEAN_RNA_PROP
2455 else if (bprop->
set) {
2458 else if (bprop->
set_ex) {
2463#ifdef USE_INT_IDPROPS_FOR_BOOLEAN_RNA_PROP
2479 const bool *defarr,
int defarr_length,
bool defvalue,
int out_length,
bool *r_values)
2481 if (defarr && defarr_length > 0) {
2482 defarr_length = std::min(defarr_length, out_length);
2483 memcpy(r_values, defarr,
sizeof(
bool) * defarr_length);
2489 for (
int i = defarr_length; i < out_length; i++) {
2490 r_values[i] = defvalue;
2495 const int *defarr,
int defarr_length,
bool defvalue,
int out_length,
bool *r_values)
2497 if (defarr && defarr_length > 0) {
2498 defarr_length = std::min(defarr_length, out_length);
2499 for (
int i = 0; i < defarr_length; i++) {
2500 r_values[i] = defarr[i] != 0;
2507 for (
int i = defarr_length; i < out_length; i++) {
2508 r_values[i] = defvalue;
2543 int *values_src =
static_cast<int *
>(
IDP_Array(idprop));
2544 for (
uint i = 0; i < idprop->
len; i++) {
2545 values[i] = bool(values_src[i]);
2549 bool *values_src =
static_cast<bool *
>(
IDP_Array(idprop));
2550 for (
int i = 0; i < idprop->
len; i++) {
2551 values[i] = values_src[i];
2587 tmparray =
static_cast<bool *
>(
MEM_mallocN(
sizeof(
bool) *
len, __func__));
2589 value = tmparray[index];
2618 int *values_dst =
static_cast<int *
>(
IDP_Array(idprop));
2619 for (
uint i = 0; i < idprop->
len; i++) {
2620 values_dst[i] =
int(values[i]);
2639#ifdef USE_INT_IDPROPS_FOR_BOOLEAN_RNA_PROP
2648 int *values_dst =
static_cast<int *
>(
IDP_Array(idprop));
2649 for (
uint i = 0; i < idprop->
len; i++) {
2650 values_dst[i] = values[i];
2675 tmparray =
static_cast<bool *
>(
MEM_mallocN(
sizeof(
bool) *
len, __func__));
2677 tmparray[index] = value;
2787 bool *tmparray, value;
2789 tmparray =
static_cast<bool *
>(
MEM_mallocN(
sizeof(
bool) *
len, __func__));
2791 value = tmparray[index];
2832 else if (iprop->
set) {
2835 else if (iprop->
set_ex) {
2849 const int *defarr,
int defarr_length,
int defvalue,
int out_length,
int *r_values)
2851 if (defarr && defarr_length > 0) {
2852 defarr_length = std::min(defarr_length, out_length);
2853 memcpy(r_values, defarr,
sizeof(
int) * defarr_length);
2859 for (
int i = defarr_length; i < out_length; i++) {
2860 r_values[i] = defvalue;
2895 memcpy(values,
IDP_Array(idprop),
sizeof(
int) * idprop->
len);
2916 if (array_len <= 0) {
2920 else if (array_len == 1) {
2922 values[1] = values[0];
2929 if (array_len > 32) {
2930 arr =
static_cast<int *
>(
MEM_mallocN(
sizeof(
int) * array_len, __func__));
2937 values[0] = values[1] = arr[0];
2938 for (i = 1; i < array_len; i++) {
2939 values[0] = std::min(values[0], arr[i]);
2940 values[1] = std::max(values[1], arr[i]);
2943 if (arr != arr_stack) {
2963 int *tmparray, value;
2965 tmparray =
static_cast<int *
>(
MEM_mallocN(
sizeof(
int) *
len, __func__));
2967 value = tmparray[index];
2989 memcpy(
IDP_Array(idprop), values,
sizeof(
int) * idprop->
len);
3033 tmparray =
static_cast<int *
>(
MEM_mallocN(
sizeof(
int) *
len, __func__));
3035 tmparray[index] = value;
3123 int *tmparray, value;
3125 tmparray =
static_cast<int *
>(
MEM_mallocN(
sizeof(
int) *
len, __func__));
3127 value = tmparray[index];
3177 else if (fprop->
set) {
3180 else if (fprop->
set_ex) {
3194 const float *defarr,
int defarr_length,
float defvalue,
int out_length,
float *r_values)
3196 if (defarr && defarr_length > 0) {
3197 defarr_length = std::min(defarr_length, out_length);
3198 memcpy(r_values, defarr,
sizeof(
float) * defarr_length);
3204 for (
int i = defarr_length; i < out_length; i++) {
3205 r_values[i] = defvalue;
3213 const int default_array_len,
3214 const double default_value,
3215 const int out_length,
3218 const int array_copy_len = std::min(out_length, default_array_len);
3220 for (
int i = 0; i < array_copy_len; i++) {
3221 r_values[i] =
float(default_array[i]);
3224 for (
int i = array_copy_len; i < out_length; i++) {
3225 r_values[i] =
float(default_value);
3261 memcpy(values,
IDP_Array(idprop),
sizeof(
float) * idprop->
len);
3264 for (i = 0; i < idprop->
len; i++) {
3287 if (array_len <= 0) {
3291 else if (array_len == 1) {
3293 values[1] = values[0];
3296 float arr_stack[32];
3300 if (array_len > 32) {
3301 arr =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * array_len, __func__));
3308 values[0] = values[1] = arr[0];
3309 for (i = 1; i < array_len; i++) {
3310 values[0] = std::min(values[0], arr[i]);
3311 values[1] = std::max(values[1], arr[i]);
3314 if (arr != arr_stack) {
3334 float *tmparray, value;
3336 tmparray =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) *
len, __func__));
3338 value = tmparray[index];
3365 memcpy(
IDP_Array(idprop), values,
sizeof(
float) * idprop->
len);
3368 for (i = 0; i < idprop->
len; i++) {
3369 ((
double *)
IDP_Array(idprop))[i] = values[i];
3414 tmparray =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) *
len, __func__));
3416 tmparray[index] = value;
3502 float *tmparray, value;
3504 tmparray =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) *
len, __func__));
3506 value = tmparray[index];
3521 return std::string{
IDP_String(idprop), size_t(idprop->
len)};
3529 std::string string_ret{};
3530 string_ret.reserve(length + 1);
3536 sprop->
get_ex(
ptr, prop, string_ret.data());
3554 value[idprop->
len] =
'\0';
3560 else if (sprop->
get) {
3563 else if (sprop->
get_ex) {
3585 if (length + 1 < fixedlen) {
3589 buf =
static_cast<char *
>(
MEM_mallocN(
sizeof(
char) * (length + 1), __func__));
3625 return idprop->
len - 1;
3648 else if (sprop->
set) {
3651 else if (sprop->
set_ex) {
3681 else if (sprop->
set) {
3685 else if (sprop->
set_ex) {
3735 if (length + 1 < fixedlen) {
3739 buf =
static_cast<char *
>(
MEM_callocN(
sizeof(
char) * (length + 1), __func__));
3793 const char *edit_text,
3798 sprop->
search(C,
ptr, prop, edit_text, visit_fn);
3831 else if (eprop->
set) {
3834 else if (eprop->
set_ex) {
3865 int result_value = from_value;
3867 int single_step = (step < 0) ? -1 : 1;
3875 i =
mod_i(i + single_step, totitem);
3876 if (item_array[i].identifier[0]) {
3877 step_tot += single_step;
3879 }
while ((i != i_init) && (step_tot != step));
3882 result_value = item_array[i].
value;
3889 return result_value;
3948 "%s: expected %s type, not %s",
3957 pprop->
set(
ptr, ptr_value, reports);
3963 ID *value =
static_cast<ID *
>(ptr_value.
data);
3971 BKE_reportf(reports,
RPT_ERROR,
"%s: cannot assign an embedded ID to an IDProperty", __func__);
3976 if (idprop !=
nullptr) {
4034 printf(
"%s %s.%s: only supported for id properties.\n",
4055 printf(
"%s %s.%s: only supported for id properties.\n",
4130 if (!internal->
skip) {
4141 for (i = 0; i < num && iter->
valid; i++) {
4188 bool test = iter.
valid;
4198 bool *r_is_liboverride)
4201 if (
id ==
nullptr) {
4202 *r_is_liboverride =
false;
4208 if (!is_liboverride) {
4238 bool is_liboverride;
4250 if (is_liboverride) {
4268 if (is_liboverride) {
4299 bool is_liboverride;
4311 if (key >= 0 && key <
len) {
4317 if (key + 1 <
len) {
4342 bool is_liboverride;
4354 if (key >= 0 && key < len && pos >= 0 &&
pos <
len && key !=
pos) {
4385 bool is_liboverride;
4391 if (is_liboverride) {
4395 for (
int i = 0; i <
len; i++) {
4516 char name_buf[256], *name;
4518 int keylen = strlen(key);
4528 &iter.
ptr, nameprop, name_buf,
sizeof(name_buf), &namelen);
4530 if ((keylen == namelen) &&
STREQ(name, key)) {
4535 if (name != name_buf) {
4611 arrayp = (iter.
valid) ?
static_cast<char *
>(iter.
ptr.
data) :
nullptr;
4633#define RAW_GET(dtype, var, raw, a) \
4635 switch (raw.type) { \
4636 case PROP_RAW_CHAR: \
4637 var = (dtype)((char *)raw.array)[a]; \
4639 case PROP_RAW_INT8: \
4640 var = (dtype)((int8_t *)raw.array)[a]; \
4642 case PROP_RAW_UINT8: \
4643 var = (dtype)((uint8_t *)raw.array)[a]; \
4645 case PROP_RAW_SHORT: \
4646 var = (dtype)((short *)raw.array)[a]; \
4648 case PROP_RAW_UINT16: \
4649 var = (dtype)((uint16_t *)raw.array)[a]; \
4651 case PROP_RAW_INT: \
4652 var = (dtype)((int *)raw.array)[a]; \
4654 case PROP_RAW_BOOLEAN: \
4655 var = (dtype)((bool *)raw.array)[a]; \
4657 case PROP_RAW_FLOAT: \
4658 var = (dtype)((float *)raw.array)[a]; \
4660 case PROP_RAW_DOUBLE: \
4661 var = (dtype)((double *)raw.array)[a]; \
4663 case PROP_RAW_INT64: \
4664 var = (dtype)((int64_t *)raw.array)[a]; \
4666 case PROP_RAW_UINT64: \
4667 var = (dtype)((uint64_t *)raw.array)[a]; \
4675#define RAW_SET(dtype, raw, a, var) \
4677 switch (raw.type) { \
4678 case PROP_RAW_CHAR: \
4679 ((char *)raw.array)[a] = char(var); \
4681 case PROP_RAW_INT8: \
4682 ((int8_t *)raw.array)[a] = int8_t(var); \
4684 case PROP_RAW_UINT8: \
4685 ((uint8_t *)raw.array)[a] = uint8_t(var); \
4687 case PROP_RAW_SHORT: \
4688 ((short *)raw.array)[a] = short(var); \
4690 case PROP_RAW_UINT16: \
4691 ((uint16_t *)raw.array)[a] = uint16_t(var); \
4693 case PROP_RAW_INT: \
4694 ((int *)raw.array)[a] = int(var); \
4696 case PROP_RAW_BOOLEAN: \
4697 ((bool *)raw.array)[a] = bool(var); \
4699 case PROP_RAW_FLOAT: \
4700 ((float *)raw.array)[a] = float(var); \
4702 case PROP_RAW_DOUBLE: \
4703 ((double *)raw.array)[a] = double(var); \
4705 case PROP_RAW_INT64: \
4706 ((int64_t *)raw.array)[a] = int64_t(var); \
4708 case PROP_RAW_UINT64: \
4709 ((uint64_t *)raw.array)[a] = uint64_t(var); \
4721 return sizeof(char);
4727 return sizeof(short);
4733 return sizeof(bool);
4735 return sizeof(
float);
4757 for (size = 1, i = 0; i < dim; i++) {
4767 const char *propname,
4799 BKE_report(reports,
RPT_ERROR,
"Only boolean, int, float, and enum properties supported");
4812 int arraylen = (itemlen == 0) ? 1 : itemlen;
4813 if (in.len != arraylen * out.len) {
4816 "Array length mismatch (expected %d, got %d)",
4823 if (out.type == in.type) {
4824 void *inp = in.array;
4825 void *outp = out.array;
4830 if (size == out.stride) {
4833 memcpy(outp, inp, size * out.len);
4836 memcpy(inp, outp, size * out.len);
4840 for (
int a = 0; a < out.len; a++) {
4842 memcpy(outp, inp, size);
4845 memcpy(inp, outp, size);
4848 inp = (
char *)inp + size;
4849 outp = (
char *)outp + out.stride;
4860 "Enum array properties should not exist");
4864 void *tmparray =
nullptr;
4866 int err = 0, j, a = 0;
4900 reports,
RPT_ERROR,
"Only boolean, int, float and enum properties supported");
4905 "Enum array properties should not exist");
4910 if (a + itemlen > in.len) {
4912 reports,
RPT_ERROR,
"Array length mismatch (got %d, expected more)", in.len);
4979 else if (needconv == 1) {
4981 if (tmparray && tmplen != itemlen) {
4986 tmparray =
MEM_callocN(
sizeof(
float) * itemlen,
"RNA tmparray");
4994 bool *
array =
static_cast<bool *
>(tmparray);
4995 for (j = 0; j < itemlen; j++, a++) {
5002 int *
array =
static_cast<int *
>(tmparray);
5003 for (j = 0; j < itemlen; j++, a++) {
5010 float *
array =
static_cast<float *
>(tmparray);
5011 for (j = 0; j < itemlen; j++, a++) {
5025 bool *
array =
static_cast<bool *
>(tmparray);
5027 for (j = 0; j < itemlen; j++, a++) {
5028 RAW_SET(
int, in, a, ((
bool *)tmparray)[j]);
5033 int *
array =
static_cast<int *
>(tmparray);
5035 for (j = 0; j < itemlen; j++, a++) {
5041 float *
array =
static_cast<float *
>(tmparray);
5043 for (j = 0; j < itemlen; j++, a++) {
5118 switch (prop->
type) {
5137 const char *propname,
5148 const char *propname,
5164 internal->
link = (lb) ?
static_cast<Link *
>(lb->
first) :
nullptr;
5165 internal->
skip = skip;
5167 iter->
valid = (internal->
link !=
nullptr);
5169 if (skip && iter->
valid && skip(iter, internal->
link)) {
5178 if (internal->
skip) {
5181 iter->
valid = (internal->
link !=
nullptr);
5182 }
while (iter->
valid && internal->
skip(iter, internal->
link));
5186 iter->
valid = (internal->
link !=
nullptr);
5194 return internal->
link;
5214 if (
ptr ==
nullptr) {
5217 else if (length == 0) {
5223 internal->
ptr =
static_cast<char *
>(
ptr);
5225 internal->
endptr = ((
char *)
ptr) + length * itemsize;
5227 internal->
skip = skip;
5232 if (skip && iter->
valid && skip(iter, internal->
ptr)) {
5241 if (internal->
skip) {
5245 }
while (iter->
valid && internal->
skip(iter, internal->
ptr));
5257 return internal->
ptr;
5265 return *(
void **)(internal->
ptr);
5278 if (index < 0 || index >= length) {
5504 *r_value = item[i].
value;
5524 *r_icon = item[i].
icon;
5534 *r_name = item[i].
name;
5554 PointerRNA *
ptr,
const char *name,
char *fixedbuf,
int fixedlen,
int *r_len)
5562 if (r_len !=
nullptr) {
5690 return ((idprop !=
nullptr) && (use_ghost ==
false || !(idprop->
flag &
IDP_FLAG_GHOST)));
5762 std::stringstream ss;
5764 const char *propname;
5772 if (
STREQ(propname,
"rna_type")) {
5776 if (first_time == 0) {
5782 ss << fmt::format(
"\"{}\":{}", propname,
str);
5808 if (ptr_prop->
data ==
nullptr) {
5819 const bool as_function,
5820 const bool all_args,
5821 const bool nested_args,
5822 const int max_prop_length,
5825 const char *arg_name =
nullptr;
5829 std::stringstream ss;
5831 bool first_iter =
true;
5832 int flag, flag_parameter;
5840 if (as_function && (flag_parameter &
PARM_OUTPUT)) {
5846 if (
STREQ(arg_name,
"rna_type")) {
5856 ss << fmt::format(first_iter ?
"{}" :
", {}", arg_name);
5862 if (all_args ==
true) {
5885 ss << fmt::format(first_iter ?
"{}={}" :
", {}={}", arg_name, buf);
5897 const bool as_function,
5898 const bool all_args,
5899 const bool nested_args,
5900 const int max_prop_length)
5907 C,
ptr, as_function, all_args, nested_args, max_prop_length, iterprop);
5912 const bool as_function,
5913 const bool all_args,
5914 const int max_prop_length)
5923 C, &funcptr, as_function, all_args,
true, max_prop_length, iterprop);
5928 return var ?
"True" :
"False";
5936 bool *buf =
static_cast<bool *
>(
MEM_mallocN(
sizeof(*buf) *
len, __func__));
5938 *r_buf_end = buf +
len;
5942 int *buf =
static_cast<int *
>(
MEM_mallocN(
sizeof(*buf) *
len, __func__));
5944 *r_buf_end = buf +
len;
5948 float *buf =
static_cast<float *
>(
MEM_mallocN(
sizeof(*buf) *
len, __func__));
5950 *r_buf_end = buf +
len;
5963 const int end =
len - 1;
5966 bool *buf =
static_cast<bool *
>(*buf_p);
5967 for (
int i = 0; i <
len; i++, buf++) {
5974 int *buf =
static_cast<int *
>(*buf_p);
5975 for (
int i = 0; i <
len; i++, buf++) {
5976 ss << fmt::format((i < end || !end) ?
"{}, " :
"{}", *buf);
5982 float *buf =
static_cast<float *
>(*buf_p);
5983 for (
int i = 0; i <
len; i++, buf++) {
5984 ss << fmt::format((i < end || !end) ?
"{:g}, " :
"{:g}", *buf);
5995 int type,
void **buf_p,
int totdim,
const int *dim_size, std::stringstream &ss)
6000 const int end = dim_size[totdim] - 1;
6001 for (
int i = 0; i <= end; i++) {
6003 if (i < end || !end) {
6019 void *buf_step = buf;
6035 std::stringstream ss;
6084 buf =
static_cast<char *
>(
6085 MEM_mallocN(
sizeof(
char) * (length + 1),
"RNA_property_as_string"));
6086 buf_esc =
static_cast<char *
>(
6087 MEM_mallocN(
sizeof(
char) * (length * 2 + 1),
"RNA_property_as_string esc"));
6091 ss << fmt::format(
"\"{}\"", buf_esc);
6097 const char *identifier;
6111 bool is_first =
true;
6114 ss << fmt::format(is_first ?
"'{}'" :
", '{}'", item->
identifier);
6132 ss << fmt::format(
"'{}'", identifier);
6135 return "'<UNKNOWN ENUM>'";
6150 (i < max_prop_length) && collect_iter.
valid;
6168 return "'<UNKNOWN TYPE>'";
6198 return func->
call !=
nullptr;
6208 const char *identifier)
6213 for (; parm; parm = parm->
next) {
6240 int alloc_size = 0,
size;
6271 data_alloc->
array =
nullptr;
6275 switch (parm->type) {
6277 if (parm->arraydimension) {
6286 if (parm->arraydimension) {
6295 if (parm->arraydimension) {
6308 if (defvalue && defvalue[0]) {
6314 memcpy(data, &defvalue, size);
6337 for (tot = 0; parm; parm = parm->
next) {
6344 (
void *)(((
char *)parms->
data) + tot));
6345 if (data_alloc->
array) {
6354 parms->
data =
nullptr;
6356 parms->
func =
nullptr;
6379 iter->
parms = parms;
6414 if (iter.
parm == parm) {
6423 *r_value = data_alloc->
array;
6426 *r_value = iter.
data;
6441 for (; parm; parm = parm->
next) {
6459 if (iter.
parm == parm) {
6469 switch (parm->
type) {
6471 size =
sizeof(char);
6478 size =
sizeof(
float);
6484 if (data_alloc->
array) {
6488 memcpy(data_alloc->
array, value, size);
6491 memcpy(iter.
data, value, iter.
size);
6503 for (; parm; parm = parm->
next) {
6522 if (iter.
parm == parm) {
6543 if (iter.
parm == parm) {
6577 func->
call(C, reports,
ptr, parms);
6603 bool *tmparray =
static_cast<bool *
>(
MEM_callocN(
sizeof(
bool) *
len, __func__));
6623 int *tmparray =
static_cast<int *
>(
MEM_callocN(
sizeof(
int) *
len, __func__));
6643 float *tmparray =
static_cast<float *
>(
MEM_callocN(
sizeof(
float) *
len, __func__));
6723 fputc(
'\n', stdout);
6735 const int prop_index,
6740 if ((array_len == 0) || (prop_index < array_len)) {
6742 r_anim_rna->
prop = prop;
6743 r_anim_rna->
prop_index = array_len ? prop_index : -1;
bool id_can_have_animdata(const ID *id)
AnimData * BKE_animdata_from_id(const ID *id)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
FCurve * BKE_fcurve_find_by_rna(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special)
IDProperty * IDP_NewIDPArray(const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define IDP_IDPArray(prop)
void IDP_FreeFromGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
eIDPropertyUIDataType IDP_ui_data_type(const IDProperty *prop)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_AssignStringMaxSize(IDProperty *prop, const char *st, size_t st_maxncpy) ATTR_NONNULL()
void IDP_ResizeIDPArray(IDProperty *prop, int len)
@ IDP_UI_DATA_TYPE_BOOLEAN
IDProperty * IDP_GetIndexArray(IDProperty *prop, int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_ReplaceInGroup_ex(IDProperty *group, IDProperty *prop, IDProperty *prop_exist)
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, const char *name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void IDP_AppendArray(IDProperty *prop, IDProperty *item)
void IDP_AssignID(IDProperty *prop, ID *id, int flag)
void IDP_ResizeArray(IDProperty *prop, int newlen)
IDProperty * IDP_NewStringMaxSize(const char *st, size_t st_maxncpy, const char *name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(3)
IDPropertyUIData * IDP_ui_data_ensure(IDProperty *prop)
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
bool BKE_id_can_use_id(const ID &id_from, const ID &id_to)
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id)
IDOverrideLibrary * BKE_lib_override_library_get(Main *bmain, ID *id, ID *owner_id_hint, ID **r_owner_id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
A dynamically sized string ADT.
char * BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL()
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_str_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_kdtree_nd_ free(KDTree *tree)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void * BLI_findstring_ptr(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE int mod_i(int i, int n)
#define STRNCPY(dst, src)
#define BLI_string_debug_size(str, str_maxncpy)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define BLI_MUTEX_INITIALIZER
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
bool BLT_translate_iface()
const char * BLT_pgettext(const char *msgctxt, const char *msgid)
#define CTX_IFACE_(context, msgid)
const char * BLT_translate_do_tooltip(const char *msgctxt, const char *msgid)
bool BLT_translate_tooltips()
const char * BLT_translate_do_iface(const char *msgctxt, const char *msgid)
typedef double(DMatrix)[4][4]
#define CLOG_WARN(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
#define ID_TYPE_USE_COPY_ON_EVAL(_id_type)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ IDP_FLAG_OVERRIDELIBRARY_LOCAL
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define RNA_STRUCT_BEGIN(sptr, prop)
#define RNA_PROP_BEGIN(sptr, itemptr, prop)
StructRNA * ID_code_to_RNA_type(short idcode)
#define RNA_MAX_ARRAY_LENGTH
#define RNA_MAX_ARRAY_DIMENSION
bool(*)(CollectionPropertyIterator *iter, void *data) IteratorSkipFunc
@ STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID
@ STRUCT_PUBLIC_NAMESPACE
@ STRUCT_NO_DATABLOCK_IDPROPERTIES
@ STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES
eStringPropertySearchFlag
@ PROP_STRING_SEARCH_SUPPORTED
bool(*)(Main *bmain, StructRNA *type) StructUnregisterFunc
StructRNA *(*)(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) StructRegisterFunc
#define RNA_SUBTYPE_UNIT(subtype)
@ PROPOVERRIDE_LIBRARY_INSERTION
@ PROP_CONTEXT_PROPERTY_UPDATE
constexpr PointerRNA PointerRNA_NULL
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_bool(StringRefNull prop_name, bool value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_BOOLEAN, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_INT, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRefNull prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, ListBase *lb, int index)
StructUnregisterFunc RNA_struct_unregister(StructRNA *type)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_is_runtime(const PropertyRNA *prop)
bool RNA_property_collection_lookup_int_has_fn(PropertyRNA *prop)
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values)
bool RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value)
StructRegisterFunc RNA_struct_register(StructRNA *type)
bool RNA_property_enum_item_from_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
IDProperty * rna_idproperty_find(PointerRNA *ptr, const char *name)
void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_identifier)
int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item, const int value, const char **r_identifier)
static void rna_property_float_fill_default_array_values_double(const double *default_array, const int default_array_len, const double default_value, const int out_length, float *r_values)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
const char * RNA_property_ui_name_raw(const PropertyRNA *prop)
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
const StructRNA * RNA_struct_base_child_of(const StructRNA *type, const StructRNA *parent_type)
void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
const char * RNA_property_ui_description(const PropertyRNA *prop)
bool RNA_property_update_check(PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PropertyRNA * RNA_struct_find_collection_property_check(PointerRNA &props, const char *name, const StructRNA *struct_type_check)
bool RNA_property_is_unlink(PropertyRNA *prop)
std::string RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr)
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value)
void rna_property_rna_or_id_get(PropertyRNA *prop, PointerRNA *ptr, PropertyRNAOrID *r_prop_rna_or_id)
StructRNA * RNA_struct_find(const char *identifier)
static void rna_property_int_fill_default_array_values(const int *defarr, int defarr_length, int defvalue, int out_length, int *r_values)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_assign_default(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_function_identifier(FunctionRNA *func)
void RNA_parameter_list_end(ParameterIterator *)
PropertyScaleType RNA_property_ui_scale(PropertyRNA *prop)
void RNA_struct_state_owner_set(const char *name)
static void rna_pointer_inherit_id(const StructRNA *type, const PointerRNA *parent, PointerRNA *ptr)
bool RNA_property_int_set_default(PropertyRNA *prop, int value)
void RNA_struct_py_type_set(StructRNA *srna, void *py_type)
void rna_iterator_array_end(CollectionPropertyIterator *iter)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
static void rna_property_int_get_default_array_values(PointerRNA *ptr, IntPropertyRNA *iprop, int *r_values)
IDProperty ** RNA_struct_idprops_p(PointerRNA *ptr)
bool RNA_property_float_set_default(PropertyRNA *prop, float value)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
static void rna_property_float_get_default_array_values(PointerRNA *ptr, FloatPropertyRNA *fprop, float *r_values)
const char * RNA_translate_ui_text(const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, int translate)
static void rna_idproperty_free(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
int RNA_collection_length(PointerRNA *ptr, const char *name)
int RNA_enum_from_name(const EnumPropertyItem *item, const char *name)
int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
int RNA_parameter_dynamic_length_get_data(ParameterList *, PropertyRNA *parm, void *data)
int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
int RNA_property_int_get_default(PointerRNA *ptr, PropertyRNA *prop)
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_identifier)
bool RNA_struct_available_or_report(ReportList *reports, const char *identifier)
bool RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname)
PropertyRNA * RNA_struct_find_property_check(PointerRNA &props, const char *name, const PropertyType property_type_check)
bool RNA_struct_is_ID(const StructRNA *type)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
char * RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
const ListBase * RNA_struct_type_properties(StructRNA *srna)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
const ListBase * RNA_struct_type_functions(StructRNA *srna)
PropertyRNA * rna_struct_find_nested(PointerRNA *ptr, StructRNA *srna)
void rna_iterator_listbase_end(CollectionPropertyIterator *)
bool RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr)
static void rna_property_boolean_get_default_array_values(PointerRNA *ptr, BoolPropertyRNA *bprop, bool *r_values)
eStringPropertySearchFlag RNA_property_string_search_flag(PropertyRNA *prop)
bool RNA_property_collection_is_empty(PointerRNA *ptr, PropertyRNA *prop)
PropertyUnit RNA_property_unit(PropertyRNA *prop)
int RNA_property_enum_get_default(PointerRNA *, PropertyRNA *prop)
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
int RNA_function_defined(FunctionRNA *func)
int RNA_property_ui_icon(const PropertyRNA *prop)
static const char * rna_ensure_property_identifier(const PropertyRNA *prop)
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, const PointerRNA *t_ptr)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_parameter_dynamic_length_set(ParameterList *parms, PropertyRNA *parm, int length)
static void rna_array_as_string_elem(int type, void **buf_p, int len, std::stringstream &ss)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void RNA_parameter_dynamic_length_set_data(ParameterList *, PropertyRNA *parm, void *data, int length)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_path_resolved_create(PointerRNA *ptr, PropertyRNA *prop, const int prop_index, PathResolvedRNA *r_anim_rna)
bool RNA_collection_is_empty(PointerRNA *ptr, const char *name)
static const char * bool_as_py_string(const int var)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_property_string_search(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, blender::FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
char * RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
void _RNA_warning(const char *format,...)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
void RNA_property_collection_skip(CollectionPropertyIterator *iter, int num)
#define RAW_GET(dtype, var, raw, a)
float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_pointer_add(PointerRNA *ptr, const char *name)
bool RNA_property_collection_lookup_string_has_nameprop(PropertyRNA *prop)
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
std::string RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, const bool as_function, const bool all_args, const bool nested_args, const int max_prop_length, PropertyRNA *iterprop)
uint RNA_enum_items_count(const EnumPropertyItem *item)
bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost)
bool RNA_property_editable_index(const PointerRNA *ptr, PropertyRNA *prop, const int index)
const char * RNA_property_ui_description_raw(const PropertyRNA *prop)
bool RNA_property_collection_lookup_string_supported(PropertyRNA *prop)
void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, const void *value)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_description(PropertyRNA *prop)
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
bool RNA_enum_icon_from_value(const EnumPropertyItem *item, int value, int *r_icon)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop_orig)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
PropertyType RNA_property_type(PropertyRNA *prop)
const char * RNA_function_ui_description_raw(FunctionRNA *func)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
static PropertyRNA * arraytypemap[IDP_NUMTYPES]
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PointerRNA RNA_property_pointer_get_default(PointerRNA *, PropertyRNA *)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void * RNA_struct_blender_type_get(StructRNA *srna)
void ** RNA_struct_instance(PointerRNA *ptr)
char RNA_property_array_item_char(PropertyRNA *prop, int index)
int RNA_property_enum_step(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, int from_value, int step)
void RNA_parameter_list_free(ParameterList *parms)
static const char * rna_ensure_property_name(const PropertyRNA *prop)
bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
std::string RNA_pointer_as_string_keywords(bContext *C, PointerRNA *ptr, const bool as_function, const bool all_args, const bool nested_args, const int max_prop_length)
IDProperty * RNA_struct_idprops(PointerRNA *ptr, bool create)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void rna_idproperty_touch(IDProperty *idprop)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
size_t RNA_raw_type_sizeof(RawPropertyType type)
PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
const char * RNA_struct_identifier(const StructRNA *type)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
static int rna_property_array_length_all_dimensions(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_enum_name_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_translation_context(const PropertyRNA *prop)
void RNA_property_collection_next(CollectionPropertyIterator *iter)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
void RNA_parameter_list_next(ParameterIterator *iter)
void * rna_iterator_array_get(CollectionPropertyIterator *iter)
void RNA_enum_set_identifier(bContext *C, PointerRNA *ptr, const char *name, const char *id)
static void * rna_array_as_string_alloc(int type, int len, PointerRNA *ptr, PropertyRNA *prop, void **r_buf_end)
static bool rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDProperty *idprop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
static void rna_property_float_fill_default_array_values(const float *defarr, int defarr_length, float defvalue, int out_length, float *r_values)
const char * RNA_function_ui_description(FunctionRNA *func)
int RNA_int_get(PointerRNA *ptr, const char *name)
static void rna_ensure_property_multi_array_length(const PointerRNA *ptr, PropertyRNA *prop, int length[])
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
bool RNA_enum_value_from_identifier(const EnumPropertyItem *item, const char *identifier, int *r_value)
bool RNA_enum_name_from_value(const EnumPropertyItem *item, int value, const char **r_name)
PropertyRNA * RNA_struct_type_find_property_no_base(StructRNA *srna, const char *identifier)
int RNA_function_flag(FunctionRNA *func)
void * RNA_property_py_data_get(PropertyRNA *prop)
std::string RNA_function_as_string_keywords(bContext *C, FunctionRNA *func, const bool as_function, const bool all_args, const int max_prop_length)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
float RNA_property_float_get_default(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_anim_editable(const PointerRNA *ptr, PropertyRNA *prop_orig)
static bool rna_property_editable_do(const PointerRNA *ptr, PropertyRNA *prop_orig, const int index, const char **r_info)
bool RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value)
int RNA_property_flag(PropertyRNA *prop)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
RawPropertyType RNA_property_raw_type(PropertyRNA *prop)
static void rna_property_boolean_fill_default_array_values_from_ints(const int *defarr, int defarr_length, bool defvalue, int out_length, bool *r_values)
const char * RNA_struct_ui_description_raw(const StructRNA *type)
int RNA_struct_ui_icon(const StructRNA *type)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_property_builtin(PropertyRNA *prop)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
const char * RNA_struct_ui_description(const StructRNA *type)
int RNA_parameter_list_arg_count(const ParameterList *parms)
bool RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
bool RNA_struct_idprops_register_check(const StructRNA *type)
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value)
static char rna_struct_state_owner[128]
void RNA_property_string_get_default(PropertyRNA *prop, char *value, const int value_maxncpy)
void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
int RNA_string_length(PointerRNA *ptr, const char *name)
static PropertyRNA * typemap[IDP_NUMTYPES]
bool RNA_property_enum_item_from_value_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
const char * RNA_struct_ui_name(const StructRNA *type)
bool RNA_struct_undo_check(const StructRNA *type)
void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
bool RNA_pointer_is_null(const PointerRNA *ptr)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_enum_description(const EnumPropertyItem *item, const int value, const char **r_description)
const char * RNA_property_ui_name(const PropertyRNA *prop)
StructRNA * RNA_struct_base(StructRNA *type)
static std::optional< std::string > rna_pointer_as_string__bldata(PointerRNA *ptr)
FunctionRNA * RNA_struct_find_function(StructRNA *srna, const char *identifier)
static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
bool RNA_property_is_idprop(const PropertyRNA *prop)
static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_string_maxlength(PropertyRNA *prop)
void RNA_property_enum_items_gettexted_all(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_struct_state_owner_get()
std::optional< std::string > RNA_pointer_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
bool RNA_struct_idprops_datablock_allowed(const StructRNA *type)
static void rna_array_as_string(int type, int len, PointerRNA *ptr, PropertyRNA *prop, std::stringstream &ss)
int RNA_property_string_default_length(PointerRNA *, PropertyRNA *prop)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_collection_lookup_string_index(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr, int *r_index)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
static bool property_collection_liboverride_editable(PointerRNA *ptr, PropertyRNA *prop, bool *r_is_liboverride)
bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
bool RNA_property_editable_info(const PointerRNA *ptr, PropertyRNA *prop, const char **r_info)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void rna_iterator_array_next(CollectionPropertyIterator *iter)
PointerRNA RNA_pointer_recast(PointerRNA *ptr)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
static const char * rna_ensure_property_description(const PropertyRNA *prop)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
bool RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
int RNA_parameter_list_ret_count(const ParameterList *parms)
PointerRNA RNA_main_pointer_create(Main *main)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_function_call(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
int RNA_parameter_dynamic_length_get(ParameterList *parms, PropertyRNA *parm)
static void rna_array_as_string_recursive(int type, void **buf_p, int totdim, const int *dim_size, std::stringstream &ss)
const char * RNA_struct_ui_name_raw(const StructRNA *type)
bool RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
ParameterList * RNA_parameter_list_create(ParameterList *parms, PointerRNA *, FunctionRNA *func)
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
PropertyRNA * RNA_function_get_parameter(PointerRNA *, FunctionRNA *func, int index)
bool RNA_property_driver_editable(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_tags(PropertyRNA *prop)
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
void * rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
static bool rna_ensure_property_array_check(PropertyRNA *prop)
bool RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
void RNA_property_collection_end(CollectionPropertyIterator *iter)
bool RNA_property_collection_lookup_string_has_fn(PropertyRNA *prop)
bool RNA_struct_idprops_check(StructRNA *srna)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_property_array_item_index(PropertyRNA *prop, char name)
static void rna_property_boolean_fill_default_array_values(const bool *defarr, int defarr_length, bool defvalue, int out_length, bool *r_values)
PointerRNA RNA_blender_rna_pointer_create()
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
bool RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifier, const char *sep)
bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
#define RAW_SET(dtype, raw, a, var)
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
uint RNA_struct_count_properties(StructRNA *srna)
void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter)
IDProperty * rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
std::string RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index, int max_prop_length)
int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_iterator_property(StructRNA *type)
void RNA_property_enum_items_ex(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const bool use_static, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
int RNA_parameter_list_size(const ParameterList *parms)
int RNA_parameter_flag(PropertyRNA *prop)
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value)
void * RNA_struct_py_type_get(StructRNA *srna)
bool RNA_property_editable_flag(const PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_function_find_parameter(PointerRNA *, FunctionRNA *func, const char *identifier)
const char * RNA_struct_translation_context(const StructRNA *type)
int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_identifier(const PropertyRNA *prop)
int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, bool set, RawArray *array)
const ListBase * RNA_function_defined_parameters(FunctionRNA *func)
int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dim)
static const char * rna_property_type_identifier(PropertyType prop_type)
PropertyRNA * rna_ensure_property(PropertyRNA *prop)
static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *inarray, RawPropertyType intype, int inlen, int set)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
static void rna_property_collection_get_idp(CollectionPropertyIterator *iter)
bool RNA_property_overridable_get(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_free(BlenderRNA *brna)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
int rna_parameter_size(PropertyRNA *parm)
int rna_parameter_size_pad(const int size)
StructRNA * rna_ID_refine(PointerRNA *ptr)
const char * rna_translate_ui_text(const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, bool translate)
void(*)(bContext *C, PointerRNA *ptr, PropertyRNA *prop) ContextPropUpdateFunc
void(*)(bContext *C, PointerRNA *ptr) ContextUpdateFunc
bool(*)(PointerRNA *ptr, const PointerRNA value, const PropertyRNA *prop) PropPointerPollFuncPy
std::optional< std::string > RNA_path_full_struct_py(const PointerRNA *ptr)
std::string RNA_path_full_ID_py(ID *id)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool RNA_path_resolve(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
unsigned __int64 uint64_t
PropBooleanGetFuncEx get_default
PropBooleanArraySetFuncEx setarray_ex
PropBooleanArrayGetFuncEx getarray_ex
PropBooleanArraySetFunc setarray
const bool * defaultarray
PropBooleanArrayGetFuncEx get_default_array
PropBooleanSetFuncEx set_ex
PropBooleanGetFuncEx get_ex
PropBooleanArrayGetFunc getarray
ListBaseIterator listbase
union CollectionPropertyIterator::@1329 internal
PropCollectionNextFunc next
PropCollectionLookupStringFunc lookupstring
PropCollectionLengthFunc length
PropCollectionLookupIntFunc lookupint
PropCollectionBeginFunc begin
PropCollectionAssignIntFunc assignint
PropCollectionEndFunc end
const EnumPropertyItem * item
PropFloatSetFuncEx set_ex
PropertyScaleType ui_scale_type
PropFloatRangeFuncEx range_ex
PropFloatArrayGetFuncEx getarray_ex
PropFloatArraySetFuncEx setarray_ex
PropFloatArrayGetFunc getarray
PropFloatGetFuncEx get_default
const float * defaultarray
PropFloatArraySetFunc setarray
PropFloatGetFuncEx get_ex
PropFloatArrayGetFuncEx get_default_array
IDPropertyUIDataEnumItem * enum_items
IDPropertyUIData * ui_data
PropIntRangeFuncEx range_ex
PropIntArrayGetFunc getarray
PropIntArrayGetFuncEx getarray_ex
PropIntArraySetFunc setarray
PropIntArrayGetFuncEx get_default_array
PropIntArraySetFuncEx setarray_ex
PropertyScaleType ui_scale_type
PropIntGetFuncEx get_default
PropPointerTypeFunc type_fn
bool is_rna_storage_idprop
ItemEditableFunc itemeditable
PropArrayLengthGetFunc getlength
const char * translation_context
unsigned int arraydimension
unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]
unsigned int totarraylength
const char * defaultvalue
PropStringLengthFuncEx length_ex
PropStringLengthFunc length
PropStringGetFuncEx get_ex
PropStringSetFuncEx set_ex
StringPropertySearchFunc search
eStringPropertySearchFlag search_flag
StructInstanceFunc instance
PropertyRNA * nameproperty
IDPropertiesFunc idproperties
struct IDPropertyTemplate::@30 array
struct IDPropertyTemplate::@29 string
void WM_main_add_notifier(uint type, void *reference)
void WM_msg_publish_rna(wmMsgBus *mbus, PointerRNA *ptr, PropertyRNA *prop)