65static bool file_older(
const char *file1,
const char *file2)
69 printf(
"compare: %s %s\n", file1, file2);
72 if (stat(file1, &st1)) {
75 if (stat(file2, &st2)) {
79 return (st1.st_mtime < st2.st_mtime);
85 const char *lfslash, *lbslash;
87 lfslash = strrchr(path,
'/');
88 lbslash = strrchr(path,
'\\');
96 return std::max({path, lfslash, lbslash});
102 FunctionDefRNA *dfunc,
103 const char *name_override,
104 int close_prototype);
116#define WRITE_PARAM(param) \
129#ifdef USE_MAKEFILE_WORKAROUND
130 const bool use_makefile_workaround =
true;
132 const bool use_makefile_workaround =
false;
140 FILE *file_test = fopen(orgfile, "rb"); \
149 if (remove(orgfile) != 0) { \
150 CLOG_ERROR(&LOG, "remove error (%s): \"%s\"", strerror(errno), orgfile); \
155 if (rename(tmpfile, orgfile) != 0) { \
156 CLOG_ERROR(&LOG, "rename error (%s): \"%s\" -> \"%s\"", strerror(errno), tmpfile, orgfile); \
164 FILE *fp_new =
nullptr, *fp_org =
nullptr;
165 int len_new, len_org;
166 char *arr_new, *arr_org;
169 const char *makesrna_source_filepath = __FILE__;
170 const char *makesrna_source_filename =
path_basename(makesrna_source_filepath);
174 const size_t orgfile_len =
STRNCPY_RLEN(orgfile, tmpfile);
175 orgfile[orgfile_len - strlen(
TMP_EXT)] =
'\0';
177 fp_org = fopen(orgfile,
"rb");
179 if (fp_org ==
nullptr) {
193 if (use_makefile_workaround) {
196 if (
file_older(orgfile, makesrna_source_filepath)) {
207 for (pass = 0; dep_files[pass]; pass++) {
208 char from_path[4096];
212 int(makesrna_source_filename - makesrna_source_filepath),
213 makesrna_source_filepath,
224 fp_new = fopen(tmpfile,
"rb");
226 if (fp_new ==
nullptr) {
233 fseek(fp_new, 0
L, SEEK_END);
234 len_new = ftell(fp_new);
235 fseek(fp_new, 0
L, SEEK_SET);
236 fseek(fp_org, 0
L, SEEK_END);
237 len_org = ftell(fp_org);
238 fseek(fp_org, 0
L, SEEK_SET);
240 if (len_new != len_org) {
252 if (fread(arr_new,
sizeof(
char), len_new, fp_new) != len_new) {
253 CLOG_ERROR(&
LOG,
"unable to read file %s for comparison.", tmpfile);
255 if (fread(arr_org,
sizeof(
char), len_org, fp_org) != len_org) {
256 CLOG_ERROR(&
LOG,
"unable to read file %s for comparison.", orgfile);
264 cmp = memcmp(arr_new, arr_org, len_new);
282 if (
id ==
"default") {
283 return "default_value";
285 if (
id ==
"operator") {
286 return "operator_value";
291 if (
id ==
"co_return") {
293 return "coord_return";
303 static const char *escape[] = {
304 "\''",
"\"\"",
"\??",
"\\\\",
"\aa",
"\bb",
"\ff",
"\nn",
"\rr",
"\tt",
"\vv",
nullptr};
308 fprintf(f,
"nullptr");
313 for (i = 0;
str[i]; i++) {
314 for (j = 0; escape[j]; j++) {
315 if (
str[i] == escape[j][0]) {
321 fprintf(f,
"\\%c", escape[j][1]);
324 fprintf(f,
"%c",
str[i]);
334 " %s *data = (%s *)(((%s *)ptr->data)->%s);\n",
342 " %s *data = (%s *)(ptr->data);\n",
350 fprintf(f,
" ID *id = ptr->owner_id;\n");
354 char *buffer,
int size,
const char *structname,
const char *propname,
const char *type)
356 BLI_snprintf(buffer, size,
"%s_%s_%s", structname, propname, type);
360 char *buffer,
int size,
const char *structname,
const char *propname,
const char *type)
362 if (type ==
nullptr || type[0] ==
'\0') {
363 BLI_snprintf(buffer, size,
"%s_%s", structname, propname);
366 BLI_snprintf(buffer, size,
"%s_%s_%s", structname, propname, type);
374 memcpy(alloc->
mem, buffer, buffer_size);
388 const char *propname,
437 switch (prop->
type) {
456 return "const char *";
486 switch (parm->
type) {
496 return "CollectionVector";
499 return "<error, no type specified>";
509 for (a = 0; a < eprop->
totitem; a++) {
535static const char *rna_enum_id_from_pointer(
const EnumPropertyItem *item)
538#define DEF_ENUM(id) \
540 return STRINGIFY(id); \
549 return (func) ?
reinterpret_cast<const char *
>(func) :
"nullptr";
555 fprintf(f,
"-FLT_MAX");
558 fprintf(f,
"FLT_MAX");
561 fprintf(f,
"%.1ff",
num);
563 else if (
num == std::numeric_limits<float>::infinity()) {
564 fprintf(f,
"std::numeric_limits<float>::infinity()");
566 else if (
num == -std::numeric_limits<float>::infinity()) {
567 fprintf(f,
"-std::numeric_limits<float>::infinity()");
570 fprintf(f,
"%.10ff",
num);
578 return "PROP_SCALE_LINEAR";
580 return "PROP_SCALE_LOG";
582 return "PROP_SCALE_CUBIC";
590 if (
num == INT_MIN) {
591 fprintf(f,
"INT_MIN");
594 fprintf(f,
"INT_MAX");
597 fprintf(f,
"INT64_MIN");
600 fprintf(f,
"INT64_MAX");
606 fprintf(f,
"%d",
int(
num));
622 "%s.%s has no valid dna info.",
637 "%s.%s is a '%s' but wrapped as type '%s'.",
650 "%s.%s is a '%s' but wrapped as type '%s'.",
662 "%s.%s is a '%s' but wrapped as type '%s'.",
679 "\"%s.%s\", range for log scale < 0.",
692 "\"%s.%s\", range for log scale <= 0.",
703 switch (prop->
type) {
707 fprintf(f,
"void %s(PointerRNA *ptr, char *value)\n", func);
710 fprintf(f,
" PropStringGetFunc fn = %s;\n", manualfunc);
711 fprintf(f,
" fn(ptr, value);\n");
718 fprintf(f,
" if (data->%s == nullptr) {\n", dp->
dnaname.
c_str());
719 fprintf(f,
" *value = '\\0';\n");
720 fprintf(f,
" return;\n");
722 fprintf(f,
" strcpy(value, data->%s);\n", dp->
dnaname.
c_str());
730 " BLI_assert(strlen(data->%s) < %d);\n",
736 " BLI_assert(strlen(data->%s) < sizeof(data->%s));\n",
742 fprintf(f,
" strcpy(value, data->%s);\n", dp->
dnaname.
c_str());
749 fprintf(f,
"PointerRNA %s(PointerRNA *ptr)\n", func);
752 fprintf(f,
" PropPointerGetFunc fn = %s;\n", manualfunc);
753 fprintf(f,
" return fn(ptr);\n");
760 " return RNA_pointer_create_with_parent(*ptr, RNA_%s, &data->%s);\n",
766 " return RNA_pointer_create_with_parent(*ptr, RNA_%s, data->%s);\n",
777 fprintf(f,
"static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
781 "rna_iterator_listbase_get",
782 "rna_iterator_array_get",
783 "rna_iterator_array_dereference_get"))
786 " return RNA_pointer_create_with_parent(iter->parent, RNA_%s, %s(iter));\n",
792 fprintf(f,
" PropCollectionGetFunc fn = %s;\n", manualfunc);
793 fprintf(f,
" return fn(iter);\n");
802 fprintf(f,
"void %s(PointerRNA *ptr, %s values[])\n", func,
rna_type_type(prop));
806 "void %s(PointerRNA *ptr, %s values[%u])\n",
816 fprintf(f,
" PropBooleanArrayGetFunc fn = %s;\n", manualfunc);
817 fprintf(f,
" fn(ptr, values);\n");
820 fprintf(f,
" PropIntArrayGetFunc fn = %s;\n", manualfunc);
821 fprintf(f,
" fn(ptr, values);\n");
824 fprintf(f,
" PropFloatArrayGetFunc fn = %s;\n", manualfunc);
825 fprintf(f,
" fn(ptr, values);\n");
829 fprintf(f,
" %s(ptr, values);\n", manualfunc);
834 fprintf(f,
" uint64_t i;\n");
839 fprintf(f,
" unsigned int arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
840 fprintf(f,
" unsigned int len = %s(ptr, arraylen);\n\n", lenfunc);
841 fprintf(f,
" for (i = 0; i < len; i++) {\n");
845 fprintf(f,
" for (i = 0; i < %u; i++) {\n", prop->
totarraylength);
851 " values[i] = %s((uint64_t(data->%s) & (uint64_t(",
855 fprintf(f,
") << i)) != 0);\n");
859 " values[i] = (%s)%s((&data->%s)[i]);\n",
868 " values[i] = %s((uint64_t(data->%s[i]) & ",
872 fprintf(f,
") != 0);\n");
876 " values[i] = (%s)(data->%s[i] * (1.0f / 255.0f));\n",
882 " values[i] = (%s)%s(((%s *)data->%s)[i]);\n",
890 " values[i] = (%s)%s((data->%s)[i]);\n",
901 fprintf(f,
"%s %s(PointerRNA *ptr)\n",
rna_type_type(prop), func);
907 fprintf(f,
" PropBooleanGetFunc fn = %s;\n", manualfunc);
908 fprintf(f,
" return fn(ptr);\n");
911 fprintf(f,
" PropIntGetFunc fn = %s;\n", manualfunc);
912 fprintf(f,
" return fn(ptr);\n");
915 fprintf(f,
" PropFloatGetFunc fn = %s;\n", manualfunc);
916 fprintf(f,
" return fn(ptr);\n");
919 fprintf(f,
" PropEnumGetFunc fn = %s;\n", manualfunc);
920 fprintf(f,
" return fn(ptr);\n");
924 fprintf(f,
" return %s(ptr);\n", manualfunc);
931 " return %s((uint64_t(data->%s) & ",
935 fprintf(f,
") != 0);\n");
938 fprintf(f,
" return (uint64_t(data->%s) & ", dp->
dnaname.
c_str());
944 " return (%s)%s(data->%s);\n",
966 " float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, "
969 " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n",
977 " int prop_clamp_min = INT_MIN, prop_clamp_max = INT_MAX, prop_soft_min, "
980 " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n",
986#ifdef USE_RNA_RANGE_CHECK
987static void rna_clamp_value_range_check(FILE *f,
989 const char *dnaname_prefix,
993 IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
995 fprintf(f,
" using T = decltype(%s%s);\n", dnaname_prefix, dnaname);
997 " static_assert(std::numeric_limits<std::decay_t<T>>::max() >= %d);\n",
1000 " static_assert(std::numeric_limits<std::decay_t<T>>::min() <= %d);\n",
1014 fprintf(f,
"std::clamp(values[i], ");
1017 fprintf(f,
"std::clamp(value, ");
1020 fprintf(f,
"prop_clamp_min, prop_clamp_max);\n");
1036 fprintf(f,
"std::clamp(values[i], ");
1039 fprintf(f,
"std::clamp(value, ");
1042 fprintf(f,
"prop_clamp_min, prop_clamp_max);\n");
1055 fprintf(f,
"values[i];\n");
1058 fprintf(f,
"value;\n");
1079 "const bContext *C, "
1081 "PropertyRNA *prop, "
1082 "const char *edit_text, "
1083 "FunctionRef<void(StringPropertySearchVisitParams)> visit_fn)\n",
1086 fprintf(f,
"\n StringPropertySearchFunc fn = %s;\n", manualfunc);
1087 fprintf(f,
"\n fn(C, ptr, prop, edit_text, visit_fn);\n");
1088 fprintf(f,
"}\n\n");
1108 "%s.%s has no valid dna info.",
1119 switch (prop->
type) {
1122 fprintf(f,
"void %s(PointerRNA *ptr, const char *value)\n", func);
1125 fprintf(f,
" PropStringSetFunc fn = %s;\n", manualfunc);
1126 fprintf(f,
" fn(ptr, value);\n");
1135 " if (data->%s != nullptr) { MEM_delete(data->%s); }\n",
1138 fprintf(f,
" const size_t length = strlen(value);\n");
1139 fprintf(f,
" if (length > 0) {\n");
1141 " data->%s = MEM_new_array_uninitialized<char>(length + 1, __func__);\n",
1143 fprintf(f,
" memcpy(data->%s, value, length + 1);\n", dp->
dnaname.
c_str());
1144 fprintf(f,
" } else { data->%s = nullptr; }\n", dp->
dnaname.
c_str());
1147 const char *string_copy_func =
1154 " %s(data->%s, value, %d);\n",
1161 " %s(data->%s, value, sizeof(data->%s));\n",
1168 fprintf(f,
"}\n\n");
1172 fprintf(f,
"void %s(PointerRNA *ptr, PointerRNA value, ReportList *reports)\n", func);
1175 fprintf(f,
" PropPointerSetFunc fn = %s;\n", manualfunc);
1176 fprintf(f,
" fn(ptr, value, reports);\n");
1189 fprintf(f,
" if (id == value.data) {\n");
1190 fprintf(f,
" return;\n");
1197 " if (value && ptr->has_owner_id() && value.has_owner_id() && "
1198 "!BKE_id_can_use_id(*ptr->owner_id, *value.owner_id)) {\n");
1199 fprintf(f,
" return;\n");
1205 fprintf(f,
"\n if (data->%s) {\n", dp->
dnaname.
c_str());
1206 fprintf(f,
" id_us_min((ID *)data->%s);\n", dp->
dnaname.
c_str());
1208 fprintf(f,
" if (value) {\n");
1209 fprintf(f,
" id_us_plus((ID *)value.data);\n");
1214 fprintf(f,
" if (value) {\n");
1215 fprintf(f,
" id_lib_extern((ID *)value.data);\n");
1219 fprintf(f,
" *(void **)&data->%s = value.data;\n", dp->
dnaname.
c_str());
1221 fprintf(f,
"}\n\n");
1227 fprintf(f,
"void %s(PointerRNA *ptr, const %s values[])\n", func,
rna_type_type(prop));
1231 "void %s(PointerRNA *ptr, const %s values[%u])\n",
1241 fprintf(f,
" PropBooleanArraySetFunc fn = %s;\n", manualfunc);
1242 fprintf(f,
" fn(ptr, values);\n");
1245 fprintf(f,
" PropIntArraySetFunc fn = %s;\n", manualfunc);
1246 fprintf(f,
" fn(ptr, values);\n");
1249 fprintf(f,
" PropFloatArraySetFunc fn = %s;\n", manualfunc);
1250 fprintf(f,
" fn(ptr, values);\n");
1254 fprintf(f,
" %s(ptr, values);\n", manualfunc);
1259 fprintf(f,
" uint64_t i;\n");
1264 fprintf(f,
" unsigned int arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
1265 fprintf(f,
" unsigned int len = %s(ptr, arraylen);\n\n", lenfunc);
1267 fprintf(f,
" for (i = 0; i < len; i++) {\n");
1268 MEM_delete(lenfunc);
1272 fprintf(f,
" for (i = 0; i < %u; i++) {\n", prop->
totarraylength);
1279 " if (%svalues[i]) { data->%s = "
1280 "std::remove_reference_t<decltype(data->%s)>"
1281 "(uint64_t(data->%s) | (uint64_t(",
1287 fprintf(f,
") << i)); }\n");
1289 " else { data->%s = "
1290 "std::remove_reference_t<decltype(data->%s)>"
1291 "(uint64_t(data->%s) & ~(uint64_t(",
1296 fprintf(f,
") << i)); }\n");
1300 " (&data->%s)[i] = %s",
1310 " if (%svalues[i]) { data->%s[i] = "
1311 "std::remove_reference_t<decltype(data->%s[i])>"
1312 "(uint64_t(data->%s[i]) | ",
1318 fprintf(f,
"); }\n");
1320 " else { data->%s[i] = "
1321 "std::remove_reference_t<decltype(data->%s[i])>"
1322 "(uint64_t(data->%s[i]) & ~uint64_t(",
1327 fprintf(f,
")); }\n");
1331 " data->%s[i] = unit_float_to_uchar_clamp(values[i]);\n",
1337 " ((%s *)data->%s)[i] = %s",
1344 " (data->%s)[i] = %s",
1354#ifdef USE_RNA_RANGE_CHECK
1357 rna_clamp_value_range_check(f, prop,
"data->", dp->
dnaname.
c_str());
1360 rna_clamp_value_range_check(f, prop,
"*data->", dp->
dnaname.
c_str());
1365 fprintf(f,
"}\n\n");
1368 fprintf(f,
"void %s(PointerRNA *ptr, %s value)\n", func,
rna_type_type(prop));
1374 fprintf(f,
" PropBooleanSetFunc fn = %s;\n", manualfunc);
1375 fprintf(f,
" fn(ptr, value);\n");
1378 fprintf(f,
" PropIntSetFunc fn = %s;\n", manualfunc);
1379 fprintf(f,
" fn(ptr, value);\n");
1382 fprintf(f,
" PropFloatSetFunc fn = %s;\n", manualfunc);
1383 fprintf(f,
" fn(ptr, value);\n");
1386 fprintf(f,
" PropEnumSetFunc fn = %s;\n", manualfunc);
1387 fprintf(f,
" fn(ptr, value);\n");
1391 fprintf(f,
" %s(ptr, value);\n", manualfunc);
1399 " if (%svalue) { data->%s = "
1400 "std::remove_reference_t<decltype(data->%s)>"
1401 "(uint64_t(data->%s) | ",
1407 fprintf(f,
"); }\n");
1409 " else { data->%s = "
1410 "std::remove_reference_t<decltype(data->%s)>"
1411 "(uint64_t(data->%s) & ~uint64_t(",
1416 fprintf(f,
")); }\n");
1421 " data->%s = std::remove_reference_t<decltype(data->%s)>"
1422 "(uint64_t(data->%s) & ~uint64_t(",
1427 fprintf(f,
"));\n");
1429 " data->%s = std::remove_reference_t<decltype(data->%s)>"
1430 "(uint64_t(data->%s) | uint64_t(value));\n",
1442 " data->%s = %s(std::remove_reference_t<decltype(data->%s)>)",
1450#ifdef USE_RNA_RANGE_CHECK
1452 rna_clamp_value_range_check(f, prop,
"data->", dp->
dnaname.
c_str());
1456 fprintf(f,
"}\n\n");
1467 char *func =
nullptr;
1477 "%s.%s has no valid dna info.",
1488 fprintf(f,
"int %s(PointerRNA *ptr)\n", func);
1491 fprintf(f,
" PropStringLengthFunc fn = %s;\n", manualfunc);
1492 fprintf(f,
" return fn(ptr);\n");
1499 " return (data->%s == nullptr) ? 0 : strlen(data->%s);\n",
1505 fprintf(f,
" return strlen(data->%s);\n", dp->
dnaname.
c_str());
1508 fprintf(f,
"}\n\n");
1516 "%s.%s has no valid dna info.",
1527 fprintf(f,
"int %s(PointerRNA *ptr)\n", func);
1530 fprintf(f,
" PropCollectionLengthFunc fn = %s;\n", manualfunc);
1531 fprintf(f,
" return fn(ptr);\n");
1539 fprintf(f,
" return ");
1542 fprintf(f,
" return (data->%s == nullptr) ? 0 : ", dp->
dnaname.
c_str());
1552 fprintf(f,
"}\n\n");
1561 char *func, *getfunc;
1570 "%s.%s has no valid dna info.",
1580 fprintf(f,
"void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
1587 fprintf(f,
"\n *iter = {};\n");
1588 fprintf(f,
" iter->parent = *ptr;\n");
1593 fprintf(f,
"\n PropCollectionBeginFunc fn = %s;\n", manualfunc);
1594 fprintf(f,
" fn(iter, ptr);\n");
1599 "\n rna_iterator_array_begin(iter, ptr, data->%s, sizeof(data->%s[0]), "
1600 "data->%s, 0, nullptr);\n",
1607 "\n rna_iterator_array_begin(iter, ptr, data->%s, sizeof(data->%s[0]), %d, 0, "
1617 fprintf(f,
"\n PropCollectionBeginFunc fn = %s;\n", manualfunc);
1618 fprintf(f,
" fn(iter, ptr);\n");
1622 "\n rna_iterator_listbase_begin(iter, ptr, &data->%s, nullptr);\n",
1627 "\n rna_iterator_listbase_begin(iter, ptr, data->%s, nullptr);\n",
1635 fprintf(f,
"\n if (iter->valid) {\n");
1636 fprintf(f,
" iter->ptr = %s(iter);", getfunc);
1637 fprintf(f,
"\n }\n");
1639 fprintf(f,
"}\n\n");
1657 if (
STREQ(nextfunc,
"rna_iterator_array_next")) {
1659 else if (
STREQ(nextfunc,
"rna_iterator_listbase_next")) {
1669 fprintf(f,
"bool %s(PointerRNA *ptr, int index, PointerRNA *r_ptr)\n", func);
1673 fprintf(f,
"\n PropCollectionLookupIntFunc fn = %s;\n", manualfunc);
1674 fprintf(f,
" return fn(ptr, index, r_ptr);\n");
1675 fprintf(f,
"}\n\n");
1679 fprintf(f,
" bool found = false;\n");
1680 fprintf(f,
" CollectionPropertyIterator iter;\n\n");
1683 " %s_%s_begin(&iter, ptr);\n\n",
1686 fprintf(f,
" if (iter.valid) {\n");
1688 if (
STREQ(nextfunc,
"rna_iterator_array_next")) {
1689 fprintf(f,
" ArrayIterator *internal = &iter.internal.array;\n");
1690 fprintf(f,
" if (index < 0 || index >= internal->length) {\n");
1691 fprintf(f,
"#ifdef __GNUC__\n");
1693 " printf(\"Array iterator out of range: %%s (index %%d)\\n\", __func__, "
1695 fprintf(f,
"#else\n");
1696 fprintf(f,
" printf(\"Array iterator out of range: (index %%d)\\n\", index);\n");
1697 fprintf(f,
"#endif\n");
1699 fprintf(f,
" else if (internal->skip) {\n");
1700 fprintf(f,
" while (index-- > 0 && iter.valid) {\n");
1701 fprintf(f,
" rna_iterator_array_next(&iter);\n");
1703 fprintf(f,
" found = (index == -1 && iter.valid);\n");
1705 fprintf(f,
" else {\n");
1706 fprintf(f,
" internal->ptr += internal->itemsize * index;\n");
1707 fprintf(f,
" found = 1;\n");
1710 else if (
STREQ(nextfunc,
"rna_iterator_listbase_next")) {
1711 fprintf(f,
" ListBaseIterator *internal = &iter.internal.listbase;\n");
1712 fprintf(f,
" if (internal->skip) {\n");
1713 fprintf(f,
" while (index-- > 0 && iter.valid) {\n");
1714 fprintf(f,
" rna_iterator_listbase_next(&iter);\n");
1716 fprintf(f,
" found = (index == -1 && iter.valid);\n");
1718 fprintf(f,
" else {\n");
1719 fprintf(f,
" while (index-- > 0 && internal->link) {\n");
1720 fprintf(f,
" internal->link = internal->link->next;\n");
1722 fprintf(f,
" found = (index == -1 && internal->link);\n");
1727 " if (found) { *r_ptr = %s_%s_get(&iter); }\n",
1730 fprintf(f,
" }\n\n");
1733 fprintf(f,
" return found;\n");
1735 fprintf(f,
"}\n\n");
1744 const char *manualfunc,
1745 const char *item_type)
1750 const int namebuflen = 1024;
1765 item_name_base = item_srna;
1767 item_name_base = item_name_base->
base;
1780 "int %s_%s_length(PointerRNA *);\n",
1784 "void %s_%s_get(PointerRNA *, char *);\n\n",
1789 fprintf(f,
"bool %s(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)\n", func);
1793 fprintf(f,
" PropCollectionLookupStringFunc fn = %s;\n", manualfunc);
1794 fprintf(f,
" return fn(ptr, key, r_ptr);\n");
1795 fprintf(f,
"}\n\n");
1799 fprintf(f,
" bool found = false;\n");
1800 fprintf(f,
" CollectionPropertyIterator iter;\n");
1801 fprintf(f,
" char namebuf[%d];\n", namebuflen);
1802 fprintf(f,
" char *name;\n\n");
1805 " %s_%s_begin(&iter, ptr);\n\n",
1809 fprintf(f,
" while (iter.valid) {\n");
1810 fprintf(f,
" if (iter.ptr) {\n");
1812 " int namelen = %s_%s_length(&iter.ptr);\n",
1815 fprintf(f,
" if (namelen < %d) {\n", namebuflen);
1817 " %s_%s_get(&iter.ptr, namebuf);\n",
1820 fprintf(f,
" if (strcmp(namebuf, key) == 0) {\n");
1821 fprintf(f,
" found = true;\n");
1822 fprintf(f,
" *r_ptr = iter.ptr;\n");
1823 fprintf(f,
" break;\n");
1826 fprintf(f,
" else {\n");
1827 fprintf(f,
" name = MEM_new_array_uninitialized<char>(size_t(namelen) + 1,\n");
1828 fprintf(f,
" \"name string\");\n");
1830 " %s_%s_get(&iter.ptr, name);\n",
1833 fprintf(f,
" if (strcmp(name, key) == 0) {\n");
1834 fprintf(f,
" MEM_delete(name);\n\n");
1835 fprintf(f,
" found = true;\n");
1836 fprintf(f,
" *r_ptr = iter.ptr;\n");
1837 fprintf(f,
" break;\n");
1839 fprintf(f,
" else {\n");
1840 fprintf(f,
" MEM_delete(name);\n");
1849 fprintf(f,
" return found;\n");
1850 fprintf(f,
"}\n\n");
1858 char *func, *getfunc;
1870 fprintf(f,
"void %s(CollectionPropertyIterator *iter)\n", func);
1872 fprintf(f,
" PropCollectionNextFunc fn = %s;\n", manualfunc);
1873 fprintf(f,
" fn(iter);\n");
1878 fprintf(f,
"\n if (iter->valid) {\n");
1879 fprintf(f,
" iter->ptr = %s(iter);", getfunc);
1880 fprintf(f,
"\n }\n");
1882 fprintf(f,
"}\n\n");
1898 fprintf(f,
"void %s(CollectionPropertyIterator *iter)\n", func);
1901 fprintf(f,
" PropCollectionEndFunc fn = %s;\n", manualfunc);
1902 fprintf(f,
" fn(iter);\n");
1904 fprintf(f,
"}\n\n");
1922 else if (dp->
dnatype ==
"int8_t") {
1926 else if (dp->
dnatype ==
"uchar") {
1930 else if (dp->
dnatype ==
"short") {
1934 else if (dp->
dnatype ==
"ushort") {
1938 else if (dp->
dnatype ==
"int") {
1942 else if (dp->
dnatype ==
"float") {
1946 else if (dp->
dnatype ==
"double") {
1950 else if (dp->
dnatype ==
"int64_t") {
1954 else if (dp->
dnatype ==
"uint64_t") {
1965 "\toffsetof(%s, %s), RawPropertyType(%d)",
1977 switch (prop->
type) {
1986 "%s.%s, is read-only but has defines a \"set\" callback.",
1997 "%s.%s, is not an array but defines an array callback.",
2009 f, srna, prop, dp,
reinterpret_cast<const char *
>(bprop->
get)));
2011 f, srna, prop, dp,
reinterpret_cast<const char *
>(bprop->
set)));
2015 f, srna, prop, dp,
reinterpret_cast<const char *
>(bprop->
getarray)));
2017 f, srna, prop, dp,
reinterpret_cast<const char *
>(bprop->
setarray)));
2029 "%s.%s, is read-only but has defines a \"set\" callback.",
2040 "%s.%s, is not an array but defines an array callback.",
2047 if (!iprop->
get && !iprop->
set) {
2052 f, srna, prop, dp,
reinterpret_cast<const char *
>(iprop->
get)));
2054 f, srna, prop, dp,
reinterpret_cast<const char *
>(iprop->
set)));
2062 f, srna, prop, dp,
reinterpret_cast<const char *
>(iprop->
getarray)));
2064 f, srna, prop, dp,
reinterpret_cast<const char *
>(iprop->
setarray)));
2076 "%s.%s, is read-only but has defines a \"set\" callback.",
2087 "%s.%s, is not an array but defines an array callback.",
2094 if (!fprop->
get && !fprop->
set) {
2099 f, srna, prop, dp,
reinterpret_cast<const char *
>(fprop->
get)));
2101 f, srna, prop, dp,
reinterpret_cast<const char *
>(fprop->
set)));
2109 f, srna, prop, dp,
reinterpret_cast<const char *
>(fprop->
getarray)));
2111 f, srna, prop, dp,
reinterpret_cast<const char *
>(fprop->
setarray)));
2123 "%s.%s, bitflag enum should not define an `item` callback function, unless "
2124 "they also define a static list of items, or a custom `set` callback.",
2132 "%s.%s, is read-only but has defines a \"set\" callback.",
2138 if (!eprop->
get && !eprop->
set) {
2143 f, srna, prop, dp,
reinterpret_cast<const char *
>(eprop->
get)));
2145 f, srna, prop, dp,
reinterpret_cast<const char *
>(eprop->
set)));
2153 "%s.%s, is read-only but has defines a \"set\" callback.",
2160 f, srna, prop, dp,
reinterpret_cast<const char *
>(sprop->
get)));
2162 f, srna, prop, dp,
reinterpret_cast<const char *
>(sprop->
length)));
2164 f, srna, prop, dp,
reinterpret_cast<const char *
>(sprop->
set)));
2166 f, srna, prop, dp,
reinterpret_cast<const char *
>(sprop->
search)));
2174 "%s.%s, is read-only but has defines a \"set\" callback.",
2181 f, srna, prop, dp,
reinterpret_cast<const char *
>(pprop->
get)));
2183 f, srna, prop, dp,
reinterpret_cast<const char *
>(pprop->
set)));
2186 "%s.%s, pointer must have a struct type.",
2195 const char *nextfunc =
reinterpret_cast<const char *
>(cprop->
next);
2196 const char *item_type =
reinterpret_cast<const char *
>(cprop->
item_type);
2201 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
length)));
2203 else if (dp->
dnatype ==
"ListBase") {
2208 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
length)));
2213 if (cprop->
next && cprop->
get) {
2214 if (
STREQ((
const char *)cprop->
next,
"rna_iterator_array_next") &&
2215 STREQ((
const char *)cprop->
get,
"rna_iterator_array_get"))
2222 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
get)));
2224 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
begin)));
2226 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
next)));
2228 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
end)));
2231 f, srna, prop,
reinterpret_cast<const char *
>(cprop->
lookupint), nextfunc));
2234 f, srna, prop, dp,
reinterpret_cast<const char *
>(cprop->
lookupstring), item_type));
2237 if (!cprop->
begin) {
2239 "%s.%s, collection must have a begin function.",
2246 "%s.%s, collection must have a next function.",
2253 "%s.%s, collection must have a get function.",
2261 "%s.%s, collection must have a struct type.",
2274 char funcname[2048];
2280 fprintf(f,
"int %s(PointerRNA *ptr, int *arraylen)\n", funcname);
2283 fprintf(f,
"}\n\n");
2294 char funcname[2048];
2305 fprintf(f,
"\n{\n");
2308 fprintf(f,
"\treturn %s(", dfunc->
call);
2311 fprintf(f,
"\t%s(", dfunc->
call);
2340 for (; dparm; dparm = dparm->
next) {
2356 fprintf(f,
"}\n\n");
2365 const char *funcname, *valstr;
2367 const bool has_data = (dfunc->
cont.
properties.first() !=
nullptr);
2368 int flag, flag_parameter, pout, cptr, first;
2382 "static void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)",
2384 fprintf(f,
"\n{\n");
2389 fprintf(f,
"\tID *_selfid;\n");
2394 fprintf(f,
"\tPointerRNA _self;\n");
2407 fprintf(f,
"\tStructRNA *_type;\n");
2411 for (; dparm; dparm = dparm->
next) {
2424 ptrstr = pout ?
"*" :
"";
2427 ptrstr = pout ?
"**" :
"*";
2445 ptrstr = pout ?
"*" :
"";
2462 fprintf(f,
"\tchar *_data");
2464 fprintf(f,
", *_retdata");
2472 fprintf(f,
"\t_selfid = (ID *)_ptr->owner_id;\n");
2477 fprintf(f,
"\t_self = *_ptr;\n");
2483 fprintf(f,
"\t_self = (%s *)_ptr->data;\n", dsrna->
dnaname.
c_str());
2486 fprintf(f,
"\t_self = (%s *)_ptr->data;\n", srna->
identifier.
c_str());
2490 fprintf(f,
"\t_type = _ptr->type;\n");
2494 fprintf(f,
"\t_data = (char *)_parms->data;\n");
2498 for (; dparm; dparm = dparm->
next) {
2506 fprintf(f,
"\t_retdata = _data;\n");
2509 const char *data_str;
2541 "\t%s_num = %s((ParameterDynAlloc *)_data)->array_tot;\n",
2543 pout ?
"(int *)&" :
"(int)");
2544 data_str =
"(&(((ParameterDynAlloc *)_data)->array))";
2552 fprintf(f,
"%s", valstr);
2574 fprintf(f,
"%s(", dfunc->
call);
2579 fprintf(f,
"_selfid");
2587 fprintf(f,
"_self");
2594 fprintf(f,
"_type");
2603 fprintf(f,
"CTX_data_main(C)");
2619 fprintf(f,
"reports");
2623 for (; dparm; dparm = dparm->
next) {
2653 "\t*reinterpret_cast<%s *>(_retdata) = %s;\n",
2654 parameter_type_name,
2666 "\tnew ((CollectionVector *)_retdata) CollectionVector(std::move(%s));\n",
2671 "\t*((%s %s*)_retdata) = %s;\n",
2680 fprintf(f,
"}\n\n");
2685static void rna_sanity_checks()
2689#define DEF_ENUM(id) #id,
2690 const char *rna_enum_id_array[] = {
2693 for (
int i = 0; i <
ARRAY_SIZE(rna_enum_id_array); i++) {
2698 "Error: enum defined in \"RNA_enum_items.hh\" "
2699 "doesn't confirm to \"rna_enum_*_items\" convention!\n");
2713 if (ds->
dnaname ==
"Screen") {
2719 if (ds->
dnaname ==
"GroupObject") {
2720 ds->
dnaname =
"CollectionObject";
2775 return "BoolPropertyRNA";
2777 return "IntPropertyRNA";
2779 return "FloatPropertyRNA";
2781 return "StringPropertyRNA";
2783 return "EnumPropertyRNA";
2785 return "PointerPropertyRNA";
2787 return "CollectionPropertyRNA";
2789 return "UnknownPropertyRNA";
2799 return "PROP_FILEPATH";
2801 return "PROP_FILENAME";
2803 return "PROP_DIRPATH";
2805 return "PROP_PIXEL";
2807 return "PROP_PIXEL_DIAMETER";
2809 return "PROP_BYTESTRING";
2811 return "PROP_UNSIGNED";
2813 return "PROP_PERCENTAGE";
2815 return "PROP_FACTOR";
2819 return "PROP_ANGLE";
2823 return "PROP_TIME_ABSOLUTE";
2825 return "PROP_DISTANCE";
2827 return "PROP_DISTANCE_DIAMETER";
2829 return "PROP_DISTANCE_CAMERA";
2831 return "PROP_COLOR";
2833 return "PROP_TRANSLATION";
2835 return "PROP_DIRECTION";
2837 return "PROP_MATRIX";
2839 return "PROP_EULER";
2841 return "PROP_QUATERNION";
2843 return "PROP_AXISANGLE";
2845 return "PROP_VELOCITY";
2847 return "PROP_ACCELERATION";
2851 return "PROP_COLOR_GAMMA";
2853 return "PROP_COORDS";
2855 return "PROP_LAYER";
2857 return "PROP_LAYER_MEMBER";
2859 return "PROP_PASSWORD";
2861 return "PROP_POWER";
2863 return "PROP_TEMPERATURE";
2865 return "PROP_WAVELENGTH";
2867 return "PROP_COLOR_TEMPERATURE";
2869 return "PROP_FREQUENCY";
2875 return "PROP_SUBTYPE_UNKNOWN";
2884 return "PROP_UNIT_NONE";
2886 return "PROP_UNIT_LENGTH";
2888 return "PROP_UNIT_AREA";
2890 return "PROP_UNIT_VOLUME";
2892 return "PROP_UNIT_MASS";
2894 return "PROP_UNIT_ROTATION";
2896 return "PROP_UNIT_TIME";
2898 return "PROP_UNIT_TIME_ABSOLUTE";
2900 return "PROP_UNIT_VELOCITY";
2902 return "PROP_UNIT_ACCELERATION";
2904 return "PROP_UNIT_CAMERA";
2906 return "PROP_UNIT_POWER";
2908 return "PROP_UNIT_TEMPERATURE";
2910 return "PROP_UNIT_WAVELENGTH";
2912 return "PROP_UNIT_COLOR_TEMPERATURE";
2914 return "PROP_UNIT_FREQUENCY";
2916 return "PROP_UNIT_UNKNOWN";
2922 for (
const std::unique_ptr<StructRNA> &srna : brna->
structs) {
2923 fprintf(f,
"extern struct StructRNA *RNA_%s;\n", srna->identifier.c_str());
2929 fprintf(f,
"struct BlenderRNA;\n");
2930 for (
const std::unique_ptr<StructRNA> &srna : brna->
structs) {
2931 fprintf(f,
"void register_struct_%s(BlenderRNA &brna);\n", srna->identifier.c_str());
2938 "BlenderRNA rna_blender_rna_create()\n"
2940 "\tBlenderRNA brna{};\n");
2944 fprintf(f,
"\tbrna.structs.resize(%d);\n",
int(brna->
structs.size()));
2946 "\tfor (const int i : brna.structs.index_range()) {\n"
2947 "\t\tbrna.structs[i] = std::make_unique<StructRNA>();\n"
2949 for (
const int i : brna->
structs.index_range()) {
2950 fprintf(f,
"\tRNA_%s = brna.structs[%d].get();\n", brna->
structs[i]->identifier.c_str(), i);
2953 for (std::unique_ptr<StructRNA> &srna : brna->
structs) {
2954 fprintf(f,
"\tregister_struct_%s(brna);\n", srna->identifier.c_str());
2960 "BlenderRNA &RNA_blender_rna_get()\n"
2962 "\tstatic BlenderRNA BLENDER_RNA = rna_blender_rna_create();\n");
2965 "\treturn BLENDER_RNA;\n"
2971 fprintf(f,
"struct PropertyRNA;\n");
2972 fprintf(f,
"struct StructRNA;\n\n");
2979 for (std::unique_ptr<StructRNA> &srna : brna->
structs) {
2982 "extern PropertyRNA &rna_%s_%s;\n",
2983 srna->identifier.c_str(),
3003 "extern PropertyRNA &rna_%s_%s;\n",
3030 "extern PropertyRNA &rna_%s_%s_%s;\n",
3047 for (
const std::unique_ptr<FunctionRNA> &func : base->
functions) {
3049 "extern FunctionRNA *rna_%s_%s_func;\n",
3051 func->identifier.c_str());
3062 for (
const std::unique_ptr<FunctionRNA> &func : srna->
functions) {
3064 "extern FunctionRNA *rna_%s_%s_func;\n",
3066 func->identifier.c_str());
3078 const char *name_override,
3079 int close_prototype)
3085 int flag, flag_parameter, pout, cptr, first;
3095 fprintf(f,
"XXX no array return types yet");
3104 dparm_return = &dparm;
3110 if (!dparm_return) {
3111 fprintf(f,
"void ");
3115 if (name_override ==
nullptr || name_override[0] ==
'\0') {
3116 fprintf(f,
"%s(", dfunc->
call);
3119 fprintf(f,
"%s(", name_override);
3126 fprintf(f,
"ID *_selfid");
3135 fprintf(f,
"PointerRNA _self");
3152 fprintf(f,
"StructRNA *_type");
3161 fprintf(f,
"Main *bmain");
3169 fprintf(f,
"bContext *C");
3177 fprintf(f,
"ReportList *reports");
3194 ptrstr = pout ?
"*" :
"";
3197 ptrstr = pout ?
"**" :
"*";
3207 ptrstr = pout ?
"*" :
"";
3242 if (close_prototype) {
3254 for (
const std::unique_ptr<FunctionRNA> &func : srna->
functions) {
3258 if (strstr(dfunc->
call,
"<")) {
3265 fprintf(f,
"/* Repeated prototypes to detect errors */\n\n");
3281 char *strnest = (
char *)
"", *errnest = (
char *)
"";
3282 bool freenest =
false;
3284 if (nest !=
nullptr) {
3285 size_t len = strlen(nest);
3291 memcpy(strnest + 1, nest,
len + 1);
3294 memcpy(errnest + 1, nest,
len + 1);
3303 "static %s rna_%s%s_%s_;\n",
3326 "PropertyRNA &rna_%s%s_%s = reinterpret_cast<PropertyRNA &>(rna_%s%s_%s_);\n\n",
3335 MEM_delete(strnest);
3336 MEM_delete(errnest);
3342 char *strnest =
const_cast<char *
>(
""), *errnest =
const_cast<char *
>(
"");
3343 bool freenest =
false;
3345 if (nest !=
nullptr) {
3346 size_t len = strlen(nest);
3352 memcpy(strnest + 1, nest,
len + 1);
3355 memcpy(errnest + 1, nest,
len + 1);
3362 "\tstatic const DeprecatedRNA rna_%s%s_%s_deprecated = {\n\t",
3368 fprintf(f,
"};\n\n");
3371 switch (prop->
type) {
3374 int i, defaultfound = 0, totflag = 0;
3378 const char *item_global_id = rna_enum_id_from_pointer(eprop->
item);
3379 if (item_global_id ==
nullptr) {
3381 "\tstatic const EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t\t",
3387 for (i = 0; i < eprop->
totitem; i++) {
3388 fprintf(f,
"{%d, ", eprop->
item[i].
value);
3391 fprintf(f,
"%d, ", eprop->
item[i].
icon);
3395 fprintf(f,
"\t},\n\t\t");
3409 fprintf(f,
"\t{0, nullptr, 0, nullptr, nullptr}\n\t};\n");
3412 for (i = 0; i < eprop->
totitem; i++) {
3429 "%s%s.%s, enum default includes unused bits (%d).",
3440 "%s%s.%s, enum default '%d' is not in items.",
3451 "%s%s.%s, enum must have items defined.",
3465 "\tstatic bool rna_%s%s_%s_default[%u] = {\n\t\t",
3479 fprintf(f,
",\n\t\t");
3483 fprintf(f,
"\n\t};\n");
3493 "\tstatic int rna_%s%s_%s_default[%u] = {\n\t\t",
3507 fprintf(f,
",\n\t\t");
3511 fprintf(f,
"\n\t};\n");
3521 "\tstatic float rna_%s%s_%s_default[%u] = {\n\t\t",
3535 fprintf(f,
",\n\t\t");
3539 fprintf(f,
"\n\t};\n");
3577 "\t\t{&rna_%s%s_%s, ",
3583 fprintf(f,
"\t\t{nullptr, ");
3590 fprintf(f,
"\tnullptr,\n");
3592 fprintf(f,
"\t\t%d, ", prop->
magic);
3595 "_ustr, PropertyFlag(%u), PropertyOverrideFlag(%d), ParameterFlag(%d), "
3596 "PropertyFlagIntern(%d), %d, ",
3604 fprintf(f,
",\n\t\t");
3606 fprintf(f,
",\n\t\t");
3607 fprintf(f,
"%d, ", prop->
icon);
3609 fprintf(f,
",\n\t\t");
3613 "&rna_%s%s_%s_deprecated,",
3619 fprintf(f,
"nullptr,\n");
3623 "\t\t%s, PropertySubType(int(%s) | int(%s)), %s, %u, {%u, %u, %u}, %u,\n",
3634 "\t\t%s%s, %d, %s, %s, %s, %s, %s, %s, %s,\n\t",
3651 fprintf(f,
"\t\t0, PROP_RAW_UNSET");
3656 fprintf(f,
", RNA_%s",
reinterpret_cast<const char *
>(prop->
srna));
3659 fprintf(f,
", nullptr");
3664 switch (prop->
type) {
3668 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, ",
3686 "rna_%s%s_%s_default\n",
3692 fprintf(f,
"nullptr\n");
3699 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,\n\t\t",
3735 "rna_%s%s_%s_default\n",
3741 fprintf(f,
"nullptr\n");
3748 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, ",
3785 "rna_%s%s_%s_default\n",
3791 fprintf(f,
"nullptr\n");
3799 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, eStringPropertySearchFlag(%d), %s, %d, ",
3820 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, ",
3830 const char *item_global_id = rna_enum_id_from_pointer(eprop->
item);
3831 if (item_global_id !=
nullptr) {
3832 fprintf(f,
"%s, ", item_global_id);
3836 "rna_%s%s_%s_items, ",
3843 fprintf(f,
"nullptr, ");
3851 "\t\t%s, %s, %s, %s, %d,",
3858 fprintf(f,
"RNA_%s\n",
reinterpret_cast<const char *
>(pprop->
pointer_type));
3861 fprintf(f,
"nullptr\n");
3868 "\t\t%s, %s, %s, %s, %s, %s, %s, %s, ",
3878 fprintf(f,
"RNA_%s\n",
reinterpret_cast<const char *
>(cprop->
item_type));
3881 fprintf(f,
"nullptr\n");
3887 fprintf(f,
"\t};\n");
3890 MEM_delete(strnest);
3891 MEM_delete(errnest);
3900 fprintf(f,
"/* %s */\n", srna->
name);
3906 for (
const std::unique_ptr<FunctionRNA> &func : srna->
functions) {
3911 f,
"FunctionRNA *rna_%s_%s_func;\n", srna->
identifier.
c_str(), func->identifier.c_str());
3916 "StructRNA *RNA_%s;\n"
3917 "void register_struct_%s(BlenderRNA &brna)\n"
3931 "\tStructRNA *srna = RNA_%s;\n",
3937 "\tsrna->cont.properties = {&rna_%s_%s, ",
3942 fprintf(f,
"\tsrna->cont.properties = {nullptr, ");
3950 fprintf(f,
"nullptr};\n");
3952 fprintf(f,
"\tsrna->identifier = ");
3956 "\tsrna->flag = StructFlag(%d);\n",
3958 fprintf(f,
"\tsrna->name = ");
3962 "\tsrna->description = ");
3966 "\tsrna->translation_context = ");
3970 "\tsrna->icon = %d;\n",
3981 "\tsrna->nameproperty = &rna_%s_%s;\n",
3991 fprintf(f,
"\tsrna->iteratorproperty = &rna_%s_rna_properties;\n", base->
identifier.
c_str());
4026 "%s has a register function, must also have refine function.",
4031 for (
const std::unique_ptr<FunctionRNA> &func : srna->
functions) {
4032 fprintf(f,
"\t{\n");
4036 fprintf(f,
"\t\tauto func = std::make_unique<FunctionRNA>();\n");
4037 if (!func->cont.properties.is_empty()) {
4039 "\t\tfunc->cont.properties = {&rna_%s_%s_%s, &rna_%s_%s_%s};\n",
4041 func->identifier.c_str(),
4042 func->cont.properties.first()->identifier.c_str(),
4044 func->identifier.c_str(),
4047 fprintf(f,
"\t\tfunc->identifier = ");
4049 fprintf(f,
"_ustr;\n");
4050 if (func->flag != 0) {
4051 fprintf(f,
"\t\tfunc->flag = FunctionFlag(%d);\n", func->flag);
4053 fprintf(f,
"\t\tfunc->description = ");
4058 fprintf(f,
"\t\tfunc->call = %s;\n", dfunc->
gencall);
4062 "\t\tfunc->c_ret = &rna_%s_%s_%s;\n",
4064 func->identifier.c_str(),
4065 func->c_ret->identifier.c_str());
4068 "\t\trna_%s_%s_func = func.get();\n",
4070 func->identifier.c_str());
4072 "\t\tsrna->functions.append(std::move(func));\n"
4076 fprintf(f,
"};\n\n");
4182 "/* Automatically generated struct definitions for the Data API.\n"
4183 " * Do not edit manually, changes will be overwritten. */\n\n");
4185 fprintf(f,
"#include <float.h>\n");
4186 fprintf(f,
"#include <stdio.h>\n");
4187 fprintf(f,
"#include <limits.h>\n");
4188 fprintf(f,
"#include <limits>\n");
4189 fprintf(f,
"#include <string.h>\n\n");
4190 fprintf(f,
"#include <stddef.h>\n\n");
4191 fprintf(f,
"#include <algorithm>\n\n");
4193 fprintf(f,
"#include \"MEM_guardedalloc.h\"\n\n");
4195 fprintf(f,
"#include \"DNA_ID.h\"\n");
4196 fprintf(f,
"#include \"DNA_scene_types.h\"\n");
4197 fprintf(f,
"#include \"DNA_node_types.h\"\n");
4199 fprintf(f,
"#include \"BLI_fileops.hh\"\n\n");
4200 fprintf(f,
"#include \"BLI_listbase.hh\"\n\n");
4201 fprintf(f,
"#include \"BLI_path_utils.hh\"\n\n");
4202 fprintf(f,
"#include \"BLI_rect.hh\"\n\n");
4203 fprintf(f,
"#include \"BLI_string.hh\"\n\n");
4204 fprintf(f,
"#include \"BLI_string_utf8.hh\"\n\n");
4205 fprintf(f,
"#include \"BLI_utildefines.hh\"\n\n");
4207 fprintf(f,
"#include \"BKE_context.hh\"\n");
4208 fprintf(f,
"#include \"BKE_lib_id.hh\"\n");
4209 fprintf(f,
"#include \"BKE_main.hh\"\n");
4210 fprintf(f,
"#include \"BKE_report.hh\"\n");
4212 fprintf(f,
"#include \"RNA_define.hh\"\n");
4213 fprintf(f,
"#include \"RNA_types.hh\"\n");
4214 fprintf(f,
"#include \"rna_internal.hh\"\n\n");
4217 fprintf(f,
"#include \"RNA_prototypes.hh\"\n\n");
4218 fprintf(f,
"#include \"rna_prototypes_gen.hh\"\n\n");
4221 fprintf(f,
"#include \"%s\"\n",
filename);
4224 fprintf(f,
"#include \"%s\"\n", api_filename);
4230#if defined(__GNUC__) || defined(__clang__)
4231 fprintf(f,
"#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n");
4234#if defined(__clang__)
4237 fprintf(f,
"#pragma GCC diagnostic ignored \"-Wmissing-variable-declarations\"\n\n");
4240 fprintf(f,
"/* Auto-generated Functions. */\n\n");
4241 fprintf(f,
"namespace blender {\n\n");
4264 for (dfunc = ds->
functions.first(); dfunc;
4285 fprintf(f,
"\n} // namespace blender\n");
4290 FILE *fp = fopen(file,
"w");
4292 "#error \"Error! cannot make correct RNA file from %s:%d, "
4293 "check DNA properties.\"\n",
4311 int status = EXIT_SUCCESS;
4312 const char *deps[3];
4314 if (!public_header_outfile) {
4315 public_header_outfile = outfile;
4338 rna_sanity_checks();
4340 status = EXIT_FAILURE;
4345 status = EXIT_FAILURE;
4349 SNPRINTF(deffile,
"%s%s", public_header_outfile,
"RNA_prototypes.hh" TMP_EXT);
4350 if (status != EXIT_SUCCESS) {
4353 file = fopen(deffile,
"w");
4355 fprintf(stderr,
"Unable to open file: %s\n", deffile);
4356 status = EXIT_FAILURE;
4360 "/* Automatically generated RNA property declarations, to statically reference \n"
4361 " * properties as `rna_[struct-name]_[property-name]`.\n"
4363 " * DO NOT EDIT MANUALLY, changes will be overwritten.\n"
4366 fprintf(file,
"#pragma once\n\n");
4367 fprintf(file,
"namespace blender {\n\n");
4369 fprintf(file,
"} // namespace blender\n");
4372 status = EXIT_FAILURE;
4379 if (status != EXIT_SUCCESS) {
4382 file = fopen(deffile,
"w");
4384 fprintf(stderr,
"Unable to open file: %s\n", deffile);
4385 status = EXIT_FAILURE;
4389 "/* Automatically generated function declarations for the Data API.\n"
4390 " * Do not edit manually, changes will be overwritten. */\n\n");
4391 fprintf(file,
"namespace blender {\n\n");
4393 fprintf(file,
"\n} // namespace blender\n");
4397 status = EXIT_FAILURE;
4404 const int ext_len = is_cc ? 3 : 2;
4409 (filename_len - ext_len),
4411 is_cc ?
"_gen.cc" :
"_gen.c");
4412 if (status != EXIT_SUCCESS) {
4416 file = fopen(deffile,
"w");
4419 fprintf(stderr,
"Unable to open file: %s\n", deffile);
4420 status = EXIT_FAILURE;
4426 status = EXIT_FAILURE;
4448 fprintf(stderr,
"%s", errorStr);
4457 int return_status = EXIT_SUCCESS;
4469 fprintf(stderr,
"Usage: %s dna_dir out_dir [header_out_dir]/\n", argv[0]);
4470 return_status = EXIT_FAILURE;
4473 const char *dna_header_path = argv[1];
4479 fprintf(stderr,
"Fatal!\n");
4480 CLOG_FATAL(&
LOG,
"Failed to parse DNA headers for RNA registration");
4484 fprintf(stderr,
"Running makesrna\n");
4487 return_status =
rna_preprocess(argv[2], (argc > 2) ? argv[3] :
nullptr);
4492 return return_status;
#define STRNCPY_RLEN(dst, src)
#define SNPRINTF(dst, format,...)
#define CLOG_ERROR(clg_ref,...)
void CLG_output_use_basename_set(int value)
void CLG_level_set(CLG_Level level)
#define CLOG_FATAL(clg_ref,...)
Read Blender memory allocation and freeing.
#define RNA_SUBTYPE_UNIT(subtype)
#define BLI_assert_unreachable()
#define UNUSED_VARS_NDEBUG(...)
const char * c_str() const
constexpr bool is_empty() const
constexpr const char * c_str() const
void MEM_init_memleak_detection()
#define WRITE_PARAM(param)
void(*) MEM_set_error_callback(void(*func)(const char *))
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
bool substitute_cpp_types(Vector< ParsedStruct > &structs, const Span< ParsedEnum > enums, bool)
bool parse_dna_headers(const StringRefNull base_directory, Vector< ParsedStruct > &r_structs, Vector< ParsedEnum > &r_enums, Span< const char * > include_files)
Span< const char * > default_dna_header_filenames()
std::string filename(const std::string_view &str, size_t pos)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
static const char * rna_type_type_name(PropertyRNA *prop)
void RNA_def_linestyle(BlenderRNA *brna)
void RNA_def_workspace(BlenderRNA *brna)
static char * rna_def_property_lookup_string_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc, const char *item_type)
void RNA_def_brush(BlenderRNA *brna)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void RNA_def_modifier(BlenderRNA *brna)
void RNA_def_node_socket_subtypes(BlenderRNA *brna)
bool(*)(PointerRNA *ptr, const char *key, PointerRNA *r_ptr) PropCollectionLookupStringFunc
void(*)(PointerRNA *ptr, int value) PropEnumSetFunc
void(*)(PointerRNA *ptr, bool *values) PropBooleanArrayGetFunc
static const char * rna_type_type(PropertyRNA *prop)
void RNA_def_ui(BlenderRNA *brna)
bool is_dnatype_boolean_compat(const StringRef dnatype)
void RNA_def_pointcloud(BlenderRNA *brna)
void RNA_def_timeline_marker(BlenderRNA *brna)
bool is_dnatype_float_compat(const StringRef dnatype)
void RNA_def_object(BlenderRNA *brna)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
static char * rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
void RNA_def_collections(BlenderRNA *brna)
void RNA_def_scene(BlenderRNA *brna)
void * rna_calloc(int buffer_size)
int bool bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL(1
void RNA_def_palette(BlenderRNA *brna)
void RNA_def_rna(BlenderRNA *brna)
static const char * rna_find_type(const StringRef type)
int rna_parameter_size_pad(const int size)
int(*)(PointerRNA *ptr) PropStringLengthFunc
static int rna_preprocess(const char *outfile, const char *public_header_outfile)
void RNA_def_view_layer(BlenderRNA *brna)
static const char * rna_ui_scale_type_string(const PropertyScaleType type)
void(*)(PointerRNA *ptr, bool value) PropBooleanSetFunc
void RNA_def_wm_gizmo(BlenderRNA *brna)
int rna_parameter_size(PropertyRNA *parm)
@ PROP_UNIT_TIME_ABSOLUTE
@ PROP_UNIT_COLOR_TEMPERATURE
void RNA_def_light(BlenderRNA *brna)
void RNA_def_animviz(BlenderRNA *brna)
void RNA_def_userdef(BlenderRNA *brna)
static void rna_auto_types()
static void rna_print_id_get(FILE *f, PropertyDefRNA *)
void RNA_def_cloth(BlenderRNA *brna)
static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop)
void RNA_def_wm(BlenderRNA *brna)
void RNA_def_profile(BlenderRNA *brna)
void(*)(CollectionPropertyIterator *iter) PropCollectionNextFunc
void(*)(PointerRNA *ptr, const bool *values) PropBooleanArraySetFunc
static void rna_generate_blender(BlenderRNA *brna, FILE *f)
void RNA_def_boid(BlenderRNA *brna)
static void rna_generate_parameter_prototypes(BlenderRNA *, StructRNA *srna, FunctionRNA *func, FILE *f)
void rna_addtail(ListBase *listbase, void *vlink)
void RNA_def_armature(BlenderRNA *brna)
void RNA_def_constraint(BlenderRNA *brna)
static void rna_construct_wrapper_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
void RNA_def_main(BlenderRNA *brna)
void RNA_def_space(BlenderRNA *brna)
static const char * rna_function_string(T *func)
StructDefRNA * rna_find_struct_def(StructRNA *srna)
void RNA_def_annotations(BlenderRNA *brna)
void RNA_def_depsgraph(BlenderRNA *brna)
static bool file_older(const char *file1, const char *file2)
void RNA_free(BlenderRNA *brna)
void RNA_def_lattice(BlenderRNA *brna)
void RNA_def_asset(BlenderRNA *brna)
void RNA_def_sequencer(BlenderRNA *brna)
void(*)(PointerRNA *ptr, float value) PropFloatSetFunc
void RNA_def_grease_pencil(BlenderRNA *brna)
void RNA_def_key(BlenderRNA *brna)
static bool rna_parameter_is_const(const PropertyDefRNA *dparm)
void RNA_def_particle(BlenderRNA *brna)
void RNA_def_tracking(BlenderRNA *brna)
@ PROP_INTERN_PTR_ID_REFCOUNT_FORCED
@ PROP_INTERN_PTR_OWNERSHIP_FORCED
void RNA_def_fcurve(BlenderRNA *brna)
static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
static char * rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *, const char *manualfunc)
void RNA_def_sound(BlenderRNA *brna)
void RNA_def_sculpt_paint(BlenderRNA *brna)
void(*)(PointerRNA *ptr, const int *values) PropIntArraySetFunc
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static char * rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
void(*)(PointerRNA *ptr, const PointerRNA value, ReportList *reports) PropPointerSetFunc
static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
void RNA_def_attribute(BlenderRNA *brna)
BlenderRNA * RNA_create()
static const char * path_basename(const char *path)
static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
void RNA_def_usd(BlenderRNA *brna)
void(*)(CollectionPropertyIterator *iter, PointerRNA *ptr) PropCollectionBeginFunc
void(*)(PointerRNA *ptr, float *values) PropFloatArrayGetFunc
static void rna_generate_struct_register_prototypes(BlenderRNA *brna, FILE *f)
PointerRNA(*)(CollectionPropertyIterator *iter) PropCollectionGetFunc
void RNA_def_object_force(BlenderRNA *brna)
void RNA_def_mesh(BlenderRNA *brna)
static void rna_int_print(FILE *f, int64_t num)
static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
void RNA_def_texture(BlenderRNA *brna)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
static const char * rna_property_subtype_unit(PropertySubType type)
static bool rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
void(*)(PointerRNA *ptr, int value) PropIntSetFunc
void RNA_def_curve(BlenderRNA *brna)
static const char * rna_parameter_type_name(PropertyRNA *parm)
void RNA_def_action(BlenderRNA *brna)
PropertyDefRNA * rna_find_parameter_def(PropertyRNA *parm)
void RNA_def_vfont(BlenderRNA *brna)
ATTR_WARN_UNUSED_RESULT const size_t num
void RNA_def_lightprobe(BlenderRNA *brna)
static void mem_error_cb(const char *errorStr)
void RNA_def_fluid(BlenderRNA *brna)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
int(*)(PointerRNA *ptr) PropCollectionLengthFunc
static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop)
void RNA_def_blender_project(BlenderRNA *brna)
void(*)(PointerRNA *ptr, const float *values) PropFloatArraySetFunc
void RNA_def_curves(BlenderRNA *brna)
static void rna_print_c_string(FILE *f, const char *str)
FunctionDefRNA * rna_find_function_def(FunctionRNA *func)
static char * rna_def_property_search_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *, const char *manualfunc)
void RNA_def_material(BlenderRNA *brna)
static char * rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static const char * rna_safe_id(const UString id)
void RNA_def_mask(BlenderRNA *brna)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void BLI_system_backtrace(FILE *fp)
bool(*)(PointerRNA *ptr) PropBooleanGetFunc
void RNA_def_image(BlenderRNA *brna)
static char * rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *, const char *manualfunc)
static void rna_def_function_wrapper_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
void RNA_def_camera(BlenderRNA *brna)
void RNA_def_screen(BlenderRNA *brna)
void(*)(PointerRNA *ptr, int *values) PropIntArrayGetFunc
void(*)(PointerRNA *ptr, char *value) PropStringGetFunc
bool is_dnatype_int_compat(const StringRef dnatype)
void(*)(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, FunctionRef< void(StringPropertySearchVisitParams)> visit_fn) StringPropertySearchFunc
void RNA_def_node_tree_interface(BlenderRNA *brna)
void(*)(PointerRNA *ptr, const char *value) PropStringSetFunc
static int replace_if_different(const char *tmpfile, const char *dep_files[])
int bool BLI_str_startswith(const char *__restrict str, const char *__restrict start) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc, const char *name_override, int close_prototype)
const char * RNA_property_typename(PropertyType type)
PropertyDefRNA * rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
static char * rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static void rna_generate_property_decl(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
void RNA_def_nodetree(BlenderRNA *brna)
void RNA_def_ID(BlenderRNA *brna)
PointerRNA(*)(PointerRNA *ptr) PropPointerGetFunc
static StructRNA * rna_find_struct(const char *identifier)
void RNA_def_nla(BlenderRNA *brna)
void RNA_def_animation(BlenderRNA *brna)
bool(*)(PointerRNA *ptr, int key, PointerRNA *r_ptr) PropCollectionLookupIntFunc
void RNA_def_world(BlenderRNA *brna)
static char * rna_alloc_function_name(const char *structname, const char *propname, const char *type)
void RNA_def_pose(BlenderRNA *brna)
void RNA_def_color(BlenderRNA *brna)
static int rna_enum_bitmask(PropertyRNA *prop)
float(*)(PointerRNA *ptr) PropFloatGetFunc
static const char * rna_find_dna_type(const char *type)
static const char * makesrna_path
static void make_bad_file(const StringRefNull filename, int line)
static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna, FILE *f)
void * rna_alloc_from_buffer(const char *buffer, int buffer_size)
void RNA_def_text(BlenderRNA *brna)
static const char * rna_property_subtypename(PropertySubType type)
static void rna_generate_struct_register_func(BlenderRNA *, StructRNA *srna, FILE *f)
static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
void RNA_define_free(BlenderRNA *)
void(*)(CollectionPropertyIterator *iter) PropCollectionEndFunc
int(*)(PointerRNA *ptr) PropEnumGetFunc
void RNA_def_context(BlenderRNA *brna)
static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const char *api_filename)
int(*)(PointerRNA *ptr) PropIntGetFunc
static void rna_generate_external_property_prototypes(BlenderRNA *brna, FILE *f)
static void rna_generate_struct_rna_prototypes(BlenderRNA *brna, FILE *f)
static void rna_def_property_wrapper_funcs(FILE *f, StructDefRNA *dsrna, PropertyDefRNA *dp)
static const char * rna_property_structname(PropertyType type)
static void rna_float_print(FILE *f, float num)
static RNAProcessItem PROCESS_ITEMS[]
static void rna_construct_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
static char * rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, const char *manualfunc, const char *nextfunc)
void RNA_def_dynamic_paint(BlenderRNA *brna)
void RNA_def_packedfile(BlenderRNA *brna)
void RNA_def_volume(BlenderRNA *brna)
void RNA_def_rigidbody(BlenderRNA *brna)
void RNA_def_xr(BlenderRNA *brna)
static void rna_generate_internal_property_prototypes(BlenderRNA *, StructRNA *srna, FILE *f)
void RNA_def_shader_fx(BlenderRNA *brna)
void RNA_def_cachefile(BlenderRNA *brna)
void RNA_def_meta(BlenderRNA *brna)
void RNA_def_undo(BlenderRNA *brna)
static void rna_generate_static_function_prototypes(BlenderRNA *, StructRNA *srna, FILE *f)
void RNA_def_blendfile_import(BlenderRNA *brna)
void RNA_def_speaker(BlenderRNA *brna)
void RNA_def_movieclip(BlenderRNA *brna)
void RNA_def_render(BlenderRNA *brna)
void RNA_def_test(BlenderRNA *brna)
ListBaseT< StructDefRNA > structs
Vector< dna::ParsedStruct > dna_structs
ListBaseT< AllocDefRNA > allocs
Vector< std::unique_ptr< StructRNA > > structs
PropBooleanArraySetFunc setarray
PropBooleanGetTransformFunc get_transform
PropBooleanSetTransformFunc set_transform
PropBooleanArraySetTransformFunc setarray_transform
PropBooleanSetFuncEx set_ex
PropBooleanArraySetFuncEx setarray_ex
PropBooleanGetFuncEx get_default
PropBooleanArrayGetFunc getarray
PropBooleanArrayGetFuncEx getarray_ex
PropBooleanGetFuncEx get_ex
const bool * defaultarray
PropBooleanArrayGetFuncEx get_default_array
PropBooleanArrayGetTransformFunc getarray_transform
PropCollectionBeginFunc begin
PropCollectionGetFunc get
PropCollectionLookupStringFunc lookupstring
PropCollectionAssignIntFunc assignint
PropCollectionEndFunc end
PropCollectionLookupIntFunc lookupint
PropCollectionNextFunc next
PropCollectionLengthFunc length
ListBaseT< PropertyDefRNA > properties
ListBaseT< PropertyRNA > properties
const EnumPropertyItem * item
const char * native_enum_type
PropEnumGetFuncEx get_default
PropEnumSetTransformFunc set_transform
PropEnumGetTransformFunc get_transform
PropFloatArraySetFuncEx setarray_ex
PropFloatGetTransformFunc get_transform
PropFloatRangeFuncEx range_ex
PropFloatSetTransformFunc set_transform
PropFloatArraySetTransformFunc setarray_transform
PropFloatSetFuncEx set_ex
PropFloatArrayGetFuncEx getarray_ex
PropFloatGetFuncEx get_ex
PropertyScaleType ui_scale_type
PropFloatGetFuncEx get_default
PropFloatArraySetFunc setarray
PropFloatArrayGetFuncEx get_default_array
const float * defaultarray
PropFloatArrayGetTransformFunc getarray_transform
PropFloatArrayGetFunc getarray
PropIntArrayGetFunc getarray
PropIntGetFuncEx get_default
PropIntArrayGetTransformFunc getarray_transform
PropIntArrayGetFuncEx getarray_ex
PropIntRangeFuncEx range_ex
PropIntArraySetFuncEx setarray_ex
PropIntArraySetFunc setarray
PropIntArraySetTransformFunc setarray_transform
PropertyScaleType ui_scale_type
PropIntGetTransformFunc get_transform
PropIntSetTransformFunc set_transform
PropIntArrayGetFuncEx get_default_array
PropPointerTypeFunc type_fn
StringRefNull dnastructname
StringRefNull dnalengthname
StringRefNull dnastructfromprop
StringRefNull dnastructfromname
RNAPropOverrideDiff override_diff
PropUINameFunc ui_description_func
const char * translation_context
RNAPropOverrideApply override_apply
PropertyFlagIntern flag_internal
ItemEditableFunc itemeditable
unsigned int totarraylength
PropUINameFunc ui_name_func
ParameterFlag flag_parameter
unsigned int arraydimension
PropArrayLengthGetFunc getlength
const DeprecatedRNA * deprecated
unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]
PropertyOverrideFlag flag_override
RNAPropOverrideStore override_store
PropertyPathTemplateType path_template_type
const char * api_filename
void(*) define(BlenderRNA *brna)
PropStringLengthFunc length
PropStringGetFuncEx get_ex
PropStringGetFuncEx get_default
eStringPropertySearchFlag search_flag
PropStringSetFuncEx set_ex
PropStringGetTransformFunc get_transform
const char * defaultvalue
StringPropertyPathFilterFunc path_filter
PropStringSetTransformFunc set_transform
StringPropertySearchFunc search
PropStringLengthFuncEx length_ex
StringRefNull dnafromname
ListBaseT< FunctionDefRNA > functions
StringRefNull dnafromprop
StructInstanceFunc instance
PropertyRNA * iteratorproperty
IDPropertiesFunc system_idproperties
Vector< std::unique_ptr< FunctionRNA > > functions
IDPropertiesFunc idproperties
PropertyRNA * nameproperty
StructUnregisterFunc unreg
const char * translation_context