44 # define snprintf _snprintf
69 #define TMP_EXT ".tmp"
73 static int file_older(
const char *file1,
const char *file2)
77 printf(
"compare: %s %s\n", file1, file2);
80 if (stat(file1, &st1)) {
83 if (stat(file2, &st2)) {
87 return (st1.st_mtime < st2.st_mtime);
95 const char *name_override,
108 #define WRITE_PARAM(param) \
119 #define REN_IF_DIFF \
121 FILE *file_test = fopen(orgfile, "rb"); \
130 if (remove(orgfile) != 0) { \
131 CLOG_ERROR(&LOG, "remove error (%s): \"%s\"", strerror(errno), orgfile); \
136 if (rename(tmpfile, orgfile) != 0) { \
137 CLOG_ERROR(&LOG, "rename error (%s): \"%s\" -> \"%s\"", strerror(errno), tmpfile, orgfile); \
145 FILE *fp_new =
NULL, *fp_org =
NULL;
146 int len_new, len_org;
147 char *arr_new, *arr_org;
152 strcpy(orgfile, tmpfile);
153 orgfile[strlen(orgfile) - strlen(
TMP_EXT)] =
'\0';
155 fp_org = fopen(orgfile,
"rb");
157 if (fp_org ==
NULL) {
178 for (pass = 0; dep_files[pass]; pass++) {
179 const char from_path[4096] = __FILE__;
183 p1 = strrchr(from_path,
'/');
184 p2 = strrchr(from_path,
'\\');
185 strcpy((p1 > p2 ? p1 : p2) + 1, dep_files[pass]);
195 fp_new = fopen(tmpfile,
"rb");
197 if (fp_new ==
NULL) {
204 fseek(fp_new, 0
L, SEEK_END);
205 len_new = ftell(fp_new);
206 fseek(fp_new, 0
L, SEEK_SET);
207 fseek(fp_org, 0
L, SEEK_END);
208 len_org = ftell(fp_org);
209 fseek(fp_org, 0
L, SEEK_SET);
211 if (len_new != len_org) {
220 arr_new =
MEM_mallocN(
sizeof(
char) * len_new,
"rna_cmp_file_new");
221 arr_org =
MEM_mallocN(
sizeof(
char) * len_org,
"rna_cmp_file_org");
223 if (fread(arr_new,
sizeof(
char), len_new, fp_new) != len_new) {
224 CLOG_ERROR(&
LOG,
"unable to read file %s for comparison.", tmpfile);
226 if (fread(arr_org,
sizeof(
char), len_org, fp_org) != len_org) {
227 CLOG_ERROR(&
LOG,
"unable to read file %s for comparison.", orgfile);
235 cmp = memcmp(arr_new, arr_org, len_new);
253 if (
STREQ(
id,
"default")) {
254 return "default_value";
256 if (
STREQ(
id,
"operator")) {
257 return "operator_value";
259 if (
STREQ(
id,
"new")) {
262 if (
STREQ(
id,
"co_return")) {
264 return "coord_return";
299 return strcmp(propa->
name, propb->
name);
328 for (
size = 0, link = listbase->
first; link; link = link->
next) {
333 for (
a = 0, link = listbase->
first; link; link = link->
next,
a++) {
353 static const char *escape[] = {
354 "\''",
"\"\"",
"\??",
"\\\\",
"\aa",
"\bb",
"\ff",
"\nn",
"\rr",
"\tt",
"\vv",
NULL};
363 for (i = 0;
str[i]; i++) {
364 for (j = 0; escape[j]; j++) {
365 if (
str[i] == escape[j][0]) {
371 fprintf(f,
"\\%c", escape[j][1]);
374 fprintf(f,
"%c",
str[i]);
384 " %s *data = (%s *)(((%s *)ptr->data)->%s);\n",
397 fprintf(f,
" ID *id = ptr->owner_id;\n");
401 char *
buffer,
int size,
const char *structname,
const char *propname,
const char *
type)
407 char *
buffer,
int size,
const char *structname,
const char *propname,
const char *
type)
435 const char *propname,
484 switch (prop->
type) {
503 return "const char *";
546 switch (parm->
type) {
556 return "CollectionListBase";
559 return "<error, no type specified>";
587 return (func) ? (
const char *)func :
"NULL";
592 if (num == -FLT_MAX) {
593 fprintf(f,
"-FLT_MAX");
595 else if (num == FLT_MAX) {
596 fprintf(f,
"FLT_MAX");
599 fprintf(f,
"%.1ff", num);
602 fprintf(f,
"%.10ff", num);
608 if (num == INT_MIN) {
609 fprintf(f,
"INT_MIN");
611 else if (num == INT_MAX) {
612 fprintf(f,
"INT_MAX");
615 fprintf(f,
"INT64_MIN");
618 fprintf(f,
"INT64_MAX");
620 else if (num < INT_MIN || num > INT_MAX) {
621 fprintf(f,
"%" PRId64 "LL", num);
624 fprintf(f,
"%d", (
int)num);
652 "%s.%s is a '%s' but wrapped as type '%s'.",
665 "%s.%s is a '%s' but wrapped as type '%s'.",
677 "%s.%s is a '%s' but wrapped as type '%s'.",
691 switch (prop->
type) {
694 fprintf(f,
"void %s(PointerRNA *ptr, char *value)\n", func);
697 fprintf(f,
" %s(ptr, value);\n", manualfunc);
710 fprintf(f,
" if (data->%s == NULL) {\n", dp->
dnaname);
711 fprintf(f,
" *value = '\\0';\n");
712 fprintf(f,
" return;\n");
715 " %s(value, data->%s, strlen(data->%s) + 1);\n",
724 " %s(value, data->%s, %d);\n",
731 " %s(value, data->%s, sizeof(data->%s));\n",
742 fprintf(f,
"PointerRNA %s(PointerRNA *ptr)\n", func);
745 fprintf(f,
" return %s(ptr);\n", manualfunc);
752 " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n",
753 (
const char *)pprop->
type,
758 " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n",
759 (
const char *)pprop->
type,
769 fprintf(f,
"static PointerRNA %s(CollectionPropertyIterator *iter)\n", func);
773 "rna_iterator_listbase_get",
774 "rna_iterator_array_get",
775 "rna_iterator_array_dereference_get")) {
777 " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n",
782 fprintf(f,
" return %s(iter);\n", manualfunc);
791 fprintf(f,
"void %s(PointerRNA *ptr, %s values[])\n", func,
rna_type_type(prop));
795 "void %s(PointerRNA *ptr, %s values[%u])\n",
803 fprintf(f,
" %s(ptr, values);\n", manualfunc);
811 fprintf(f,
" unsigned int arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
812 fprintf(f,
" unsigned int i;\n");
813 fprintf(f,
" unsigned int len = %s(ptr, arraylen);\n\n", lenfunc);
814 fprintf(f,
" for (i = 0; i < len; i++) {\n");
818 fprintf(f,
" unsigned int i;\n\n");
819 fprintf(f,
" for (i = 0; i < %u; i++) {\n", prop->
totarraylength);
825 " values[i] = %s((data->%s & (",
829 fprintf(f,
" << i)) != 0);\n");
833 " values[i] = (%s)%s((&data->%s)[i]);\n",
842 " values[i] = %s((data->%s[i] & ",
846 fprintf(f,
") != 0);\n");
850 " values[i] = (%s)(data->%s[i] * (1.0f / 255.0f));\n",
856 " values[i] = (%s)%s(((%s *)data->%s)[i]);\n",
864 " values[i] = (%s)%s((data->%s)[i]);\n",
875 fprintf(f,
"%s %s(PointerRNA *ptr)\n",
rna_type_type(prop), func);
879 fprintf(f,
" return %s(ptr);\n", manualfunc);
887 fprintf(f,
") != 0);\n");
890 fprintf(f,
" return ((data->%s) & ", dp->
dnaname);
896 " return (%s)%s(data->%s);\n",
918 " float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, "
921 " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n",
929 " int prop_clamp_min = INT_MIN, prop_clamp_max = INT_MAX, prop_soft_min, "
932 " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n",
938 #ifdef USE_RNA_RANGE_CHECK
939 static void rna_clamp_value_range_check(FILE *f,
941 const char *dnaname_prefix,
947 " { BLI_STATIC_ASSERT("
948 "(TYPEOF_MAX(%s%s) >= %d) && "
949 "(TYPEOF_MIN(%s%s) <= %d), "
950 "\"invalid limits\"); }\n",
968 fprintf(f,
"CLAMPIS(values[i], ");
971 fprintf(f,
"CLAMPIS(value, ");
974 fprintf(f,
"prop_clamp_min, prop_clamp_max);");
990 fprintf(f,
"CLAMPIS(values[i], ");
993 fprintf(f,
"CLAMPIS(value, ");
996 fprintf(f,
"prop_clamp_min, prop_clamp_max);");
1009 fprintf(f,
"values[i];\n");
1012 fprintf(f,
"value;\n");
1040 switch (prop->
type) {
1043 fprintf(f,
"void %s(PointerRNA *ptr, const char *value)\n", func);
1046 fprintf(f,
" %s(ptr, value);\n", manualfunc);
1060 f,
" if (data->%s != NULL) { MEM_freeN(data->%s); }\n", dp->
dnaname, dp->
dnaname);
1061 fprintf(f,
" const int length = strlen(value);\n");
1062 fprintf(f,
" data->%s = MEM_mallocN(length + 1, __func__);\n", dp->
dnaname);
1063 fprintf(f,
" %s(data->%s, value, length + 1);\n", string_copy_func, dp->
dnaname);
1069 " %s(data->%s, value, %d);\n",
1076 " %s(data->%s, value, sizeof(data->%s));\n",
1083 fprintf(f,
"}\n\n");
1087 fprintf(f,
"void %s(PointerRNA *ptr, PointerRNA value, struct ReportList *reports)\n", func);
1090 fprintf(f,
" %s(ptr, value, reports);\n", manualfunc);
1097 fprintf(f,
" if (id == value.data) {\n");
1098 fprintf(f,
" return;\n");
1103 fprintf(f,
"\n if (data->%s) {\n", dp->
dnaname);
1104 fprintf(f,
" id_us_min((ID *)data->%s);\n", dp->
dnaname);
1106 fprintf(f,
" if (value.data) {\n");
1107 fprintf(f,
" id_us_plus((ID *)value.data);\n");
1114 fprintf(f,
" if (value.data) {\n");
1115 fprintf(f,
" id_lib_extern((ID *)value.data);\n");
1120 fprintf(f,
" data->%s = value.data;\n", dp->
dnaname);
1122 fprintf(f,
"}\n\n");
1128 fprintf(f,
"void %s(PointerRNA *ptr, const %s values[])\n", func,
rna_type_type(prop));
1132 "void %s(PointerRNA *ptr, const %s values[%u])\n",
1140 fprintf(f,
" %s(ptr, values);\n", manualfunc);
1148 fprintf(f,
" unsigned int i, arraylen[RNA_MAX_ARRAY_DIMENSION];\n");
1149 fprintf(f,
" unsigned int len = %s(ptr, arraylen);\n\n", lenfunc);
1151 fprintf(f,
" for (i = 0; i < len; i++) {\n");
1155 fprintf(f,
" unsigned int i;\n\n");
1157 fprintf(f,
" for (i = 0; i < %u; i++) {\n", prop->
totarraylength);
1163 " if (%svalues[i]) { data->%s |= (",
1167 fprintf(f,
" << i); }\n");
1168 fprintf(f,
" else { data->%s &= ~(", dp->
dnaname);
1170 fprintf(f,
" << i); }\n");
1181 " if (%svalues[i]) { data->%s[i] |= ",
1185 fprintf(f,
"; }\n");
1186 fprintf(f,
" else { data->%s[i] &= ~", dp->
dnaname);
1188 fprintf(f,
"; }\n");
1192 f,
" data->%s[i] = unit_float_to_uchar_clamp(values[i]);\n", dp->
dnaname);
1197 " ((%s *)data->%s)[i] = %s",
1204 " (data->%s)[i] = %s",
1214 #ifdef USE_RNA_RANGE_CHECK
1217 rna_clamp_value_range_check(f, prop,
"data->", dp->
dnaname);
1220 rna_clamp_value_range_check(f, prop,
"*data->", dp->
dnaname);
1225 fprintf(f,
"}\n\n");
1228 fprintf(f,
"void %s(PointerRNA *ptr, %s value)\n", func,
rna_type_type(prop));
1232 fprintf(f,
" %s(ptr, value);\n", manualfunc);
1238 " if (%svalue) { data->%s |= ",
1242 fprintf(f,
"; }\n");
1243 fprintf(f,
" else { data->%s &= ~", dp->
dnaname);
1245 fprintf(f,
"; }\n");
1248 fprintf(f,
" data->%s &= ~", dp->
dnaname);
1251 fprintf(f,
" data->%s |= value;\n", dp->
dnaname);
1260 #ifdef USE_RNA_RANGE_CHECK
1262 rna_clamp_value_range_check(f, prop,
"data->", dp->
dnaname);
1266 fprintf(f,
"}\n\n");
1294 fprintf(f,
"int %s(PointerRNA *ptr)\n", func);
1297 fprintf(f,
" return %s(ptr);\n", manualfunc);
1304 " return (data->%s == NULL) ? 0 : strlen(data->%s);\n",
1310 fprintf(f,
" return strlen(data->%s);\n", dp->
dnaname);
1313 fprintf(f,
"}\n\n");
1327 fprintf(f,
"int %s(PointerRNA *ptr)\n", func);
1330 fprintf(f,
" return %s(ptr);\n", manualfunc);
1338 fprintf(f,
" return ");
1341 fprintf(f,
" return (data->%s == NULL) ? 0 : ", dp->
dnaname);
1351 fprintf(f,
"}\n\n");
1360 char *func, *getfunc;
1376 fprintf(f,
"void %s(CollectionPropertyIterator *iter, PointerRNA *ptr)\n", func);
1383 fprintf(f,
"\n memset(iter, 0, sizeof(*iter));\n");
1384 fprintf(f,
" iter->parent = *ptr;\n");
1389 fprintf(f,
"\n %s(iter, ptr);\n", manualfunc);
1394 "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), data->%s, 0, "
1403 "\n rna_iterator_array_begin(iter, data->%s, sizeof(data->%s[0]), %d, 0, NULL);\n",
1412 fprintf(f,
"\n %s(iter, ptr);\n", manualfunc);
1415 fprintf(f,
"\n rna_iterator_listbase_begin(iter, &data->%s, NULL);\n", dp->
dnaname);
1418 fprintf(f,
"\n rna_iterator_listbase_begin(iter, data->%s, NULL);\n", dp->
dnaname);
1424 fprintf(f,
"\n if (iter->valid) {\n");
1425 fprintf(f,
" iter->ptr = %s(iter);", getfunc);
1426 fprintf(f,
"\n }\n");
1428 fprintf(f,
"}\n\n");
1437 const char *manualfunc,
1438 const char *nextfunc)
1454 if (
STREQ(nextfunc,
"rna_iterator_array_next")) {
1456 else if (
STREQ(nextfunc,
"rna_iterator_listbase_next")) {
1465 fprintf(f,
"int %s(PointerRNA *ptr, int index, PointerRNA *r_ptr)\n", func);
1469 fprintf(f,
"\n return %s(ptr, index, r_ptr);\n", manualfunc);
1470 fprintf(f,
"}\n\n");
1474 fprintf(f,
" int found = 0;\n");
1475 fprintf(f,
" CollectionPropertyIterator iter;\n\n");
1478 fprintf(f,
" if (iter.valid) {\n");
1480 if (
STREQ(nextfunc,
"rna_iterator_array_next")) {
1481 fprintf(f,
" ArrayIterator *internal = &iter.internal.array;\n");
1482 fprintf(f,
" if (index < 0 || index >= internal->length) {\n");
1483 fprintf(f,
"#ifdef __GNUC__\n");
1485 " printf(\"Array iterator out of range: %%s (index %%d)\\n\", __func__, "
1487 fprintf(f,
"#else\n");
1488 fprintf(f,
" printf(\"Array iterator out of range: (index %%d)\\n\", index);\n");
1489 fprintf(f,
"#endif\n");
1491 fprintf(f,
" else if (internal->skip) {\n");
1492 fprintf(f,
" while (index-- > 0 && iter.valid) {\n");
1493 fprintf(f,
" rna_iterator_array_next(&iter);\n");
1495 fprintf(f,
" found = (index == -1 && iter.valid);\n");
1497 fprintf(f,
" else {\n");
1498 fprintf(f,
" internal->ptr += internal->itemsize * index;\n");
1499 fprintf(f,
" found = 1;\n");
1502 else if (
STREQ(nextfunc,
"rna_iterator_listbase_next")) {
1503 fprintf(f,
" ListBaseIterator *internal = &iter.internal.listbase;\n");
1504 fprintf(f,
" if (internal->skip) {\n");
1505 fprintf(f,
" while (index-- > 0 && iter.valid) {\n");
1506 fprintf(f,
" rna_iterator_listbase_next(&iter);\n");
1508 fprintf(f,
" found = (index == -1 && iter.valid);\n");
1510 fprintf(f,
" else {\n");
1511 fprintf(f,
" while (index-- > 0 && internal->link) {\n");
1512 fprintf(f,
" internal->link = internal->link->next;\n");
1514 fprintf(f,
" found = (index == -1 && internal->link);\n");
1519 " if (found) { *r_ptr = %s_%s_get(&iter); }\n",
1522 fprintf(f,
" }\n\n");
1525 fprintf(f,
" return found;\n");
1529 item_type = (cprop->item_type) ? (
const char *)cprop->item_type :
"UnknownType";
1534 "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), data->%s, "
1544 "\n rna_array_lookup_int(ptr, &RNA_%s, data->%s, sizeof(data->%s[0]), %d, index);\n",
1554 "\n return rna_listbase_lookup_int(ptr, &RNA_%s, &data->%s, index);\n",
1560 "\n return rna_listbase_lookup_int(ptr, &RNA_%s, data->%s, index);\n",
1567 fprintf(f,
"}\n\n");
1576 const char *manualfunc,
1577 const char *item_type)
1582 const int namebuflen = 1024;
1597 item_name_base = item_srna;
1599 item_name_base = item_name_base->
base;
1609 fprintf(f,
"int %s(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)\n", func);
1613 fprintf(f,
" return %s(ptr, key, r_ptr);\n", manualfunc);
1614 fprintf(f,
"}\n\n");
1622 " extern int %s_%s_length(PointerRNA *);\n",
1626 " extern void %s_%s_get(PointerRNA *, char *);\n\n",
1630 fprintf(f,
" bool found = false;\n");
1631 fprintf(f,
" CollectionPropertyIterator iter;\n");
1632 fprintf(f,
" char namebuf[%d];\n", namebuflen);
1633 fprintf(f,
" char *name;\n\n");
1637 fprintf(f,
" while (iter.valid) {\n");
1638 fprintf(f,
" if (iter.ptr.data) {\n");
1640 " int namelen = %s_%s_length(&iter.ptr);\n",
1643 fprintf(f,
" if (namelen < %d) {\n", namebuflen);
1645 " %s_%s_get(&iter.ptr, namebuf);\n",
1648 fprintf(f,
" if (strcmp(namebuf, key) == 0) {\n");
1649 fprintf(f,
" found = true;\n");
1650 fprintf(f,
" *r_ptr = iter.ptr;\n");
1651 fprintf(f,
" break;\n");
1654 fprintf(f,
" else {\n");
1655 fprintf(f,
" name = MEM_mallocN(namelen+1, \"name string\");\n");
1657 " %s_%s_get(&iter.ptr, name);\n",
1660 fprintf(f,
" if (strcmp(name, key) == 0) {\n");
1661 fprintf(f,
" MEM_freeN(name);\n\n");
1662 fprintf(f,
" found = true;\n");
1663 fprintf(f,
" *r_ptr = iter.ptr;\n");
1664 fprintf(f,
" break;\n");
1666 fprintf(f,
" else {\n");
1667 fprintf(f,
" MEM_freeN(name);\n");
1675 fprintf(f,
" return found;\n");
1676 fprintf(f,
"}\n\n");
1685 const char *manualfunc)
1687 char *func, *getfunc;
1699 fprintf(f,
"void %s(CollectionPropertyIterator *iter)\n", func);
1701 fprintf(f,
" %s(iter);\n", manualfunc);
1705 fprintf(f,
"\n if (iter->valid) {\n");
1706 fprintf(f,
" iter->ptr = %s(iter);", getfunc);
1707 fprintf(f,
"\n }\n");
1709 fprintf(f,
"}\n\n");
1718 const char *manualfunc)
1728 fprintf(f,
"void %s(CollectionPropertyIterator *iter)\n", func);
1731 fprintf(f,
" %s(iter);\n", manualfunc);
1733 fprintf(f,
"}\n\n");
1782 switch (prop->
type) {
1792 f, srna, prop, dp, (
const char *)bprop->
get);
1794 f, srna, prop, dp, (
const char *)bprop->
set);
1798 f, srna, prop, dp, (
const char *)bprop->
getarray);
1800 f, srna, prop, dp, (
const char *)bprop->
setarray);
1808 if (!iprop->
get && !iprop->
set) {
1813 f, srna, prop, dp, (
const char *)iprop->
get);
1815 f, srna, prop, dp, (
const char *)iprop->
set);
1823 f, srna, prop, dp, (
const char *)iprop->
getarray);
1825 f, srna, prop, dp, (
const char *)iprop->
setarray);
1833 if (!fprop->
get && !fprop->
set) {
1838 f, srna, prop, dp, (
const char *)fprop->
get);
1840 f, srna, prop, dp, (
const char *)fprop->
set);
1848 f, srna, prop, dp, (
const char *)fprop->
getarray);
1850 f, srna, prop, dp, (
const char *)fprop->
setarray);
1857 if (!eprop->
get && !eprop->
set) {
1870 f, srna, prop, dp, (
const char *)sprop->
length);
1888 const char *nextfunc = (
const char *)cprop->
next;
1889 const char *item_type = (
const char *)cprop->
item_type;
1894 f, srna, prop, dp, (
const char *)cprop->
length);
1901 f, srna, prop, dp, (
const char *)cprop->
length);
1906 if (cprop->
next && cprop->
get) {
1907 if (
STREQ((
const char *)cprop->
next,
"rna_iterator_array_next") &&
1908 STREQ((
const char *)cprop->
get,
"rna_iterator_array_get")) {
1915 f, srna, prop, dp, (
const char *)cprop->
begin);
1917 f, srna, prop, dp, (
const char *)cprop->
next);
1920 f, srna, prop, dp, (
const char *)cprop->
lookupint, nextfunc);
1922 f, srna, prop, dp, (
const char *)cprop->
lookupstring, item_type);
1925 if (!cprop->
begin) {
1927 "%s.%s, collection must have a begin function.",
1934 "%s.%s, collection must have a next function.",
1941 "%s.%s, collection must have a get function.",
1949 "%s.%s, collection must have a struct type.",
1972 switch (prop->
type) {
1975 fprintf(f,
"bool %sget(PointerRNA *ptr);\n", func);
1976 fprintf(f,
"void %sset(PointerRNA *ptr, bool value);\n", func);
1979 fprintf(f,
"void %sget(PointerRNA *ptr, bool values[%u]);\n", func, prop->
totarraylength);
1981 "void %sset(PointerRNA *ptr, const bool values[%u]);\n",
1986 fprintf(f,
"void %sget(PointerRNA *ptr, bool values[]);\n", func);
1987 fprintf(f,
"void %sset(PointerRNA *ptr, const bool values[]);\n", func);
1993 fprintf(f,
"int %sget(PointerRNA *ptr);\n", func);
1994 fprintf(f,
"void %sset(PointerRNA *ptr, int value);\n", func);
1997 fprintf(f,
"void %sget(PointerRNA *ptr, int values[%u]);\n", func, prop->
totarraylength);
1999 f,
"void %sset(PointerRNA *ptr, const int values[%u]);\n", func, prop->
totarraylength);
2002 fprintf(f,
"void %sget(PointerRNA *ptr, int values[]);\n", func);
2003 fprintf(f,
"void %sset(PointerRNA *ptr, const int values[]);\n", func);
2009 fprintf(f,
"float %sget(PointerRNA *ptr);\n", func);
2010 fprintf(f,
"void %sset(PointerRNA *ptr, float value);\n", func);
2013 fprintf(f,
"void %sget(PointerRNA *ptr, float values[%u]);\n", func, prop->
totarraylength);
2015 "void %sset(PointerRNA *ptr, const float values[%u]);\n",
2020 fprintf(f,
"void %sget(PointerRNA *ptr, float values[]);\n", func);
2021 fprintf(f,
"void %sset(PointerRNA *ptr, const float values[]);", func);
2030 fprintf(f,
"enum {\n");
2032 for (i = 0; i < eprop->
totitem; i++) {
2035 "\t%s_%s_%s = %d,\n",
2043 fprintf(f,
"};\n\n");
2046 fprintf(f,
"int %sget(PointerRNA *ptr);\n", func);
2047 fprintf(f,
"void %sset(PointerRNA *ptr, int value);\n", func);
2059 fprintf(f,
"void %sget(PointerRNA *ptr, char *value);\n", func);
2060 fprintf(f,
"int %slength(PointerRNA *ptr);\n", func);
2061 fprintf(f,
"void %sset(PointerRNA *ptr, const char *value);\n", func);
2066 fprintf(f,
"PointerRNA %sget(PointerRNA *ptr);\n", func);
2072 fprintf(f,
"void %sbegin(CollectionPropertyIterator *iter, PointerRNA *ptr);\n", func);
2073 fprintf(f,
"void %snext(CollectionPropertyIterator *iter);\n", func);
2074 fprintf(f,
"void %send(CollectionPropertyIterator *iter);\n", func);
2076 fprintf(f,
"int %slength(PointerRNA *ptr);\n", func);
2079 fprintf(f,
"int %slookup_int(PointerRNA *ptr, int key, PointerRNA *r_ptr);\n", func);
2083 "int %slookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr);\n",
2091 char funcname[2048];
2094 fprintf(f,
"int %s(PointerRNA *ptr, int *arraylen);\n", funcname);
2103 char funcname[2048];
2125 else if (prop->
name) {
2126 fprintf(f,
"\t/* %s */\n", prop->
name);
2129 fprintf(f,
"\t/* */\n");
2133 switch (prop->
type) {
2141 "\tinline Array<bool, %u> %s(void);\n",
2145 "\tinline void %s(bool values[%u]);",
2162 "\tinline Array<int, %u> %s(void);\n",
2166 "\tinline void %s(int values[%u]);",
2183 "\tinline Array<float, %u> %s(void);\n",
2187 "\tinline void %s(float values[%u]);",
2204 for (i = 0; i < eprop->
totitem; i++) {
2207 "\t\t%s_%s = %d,\n",
2214 fprintf(f,
"\t};\n");
2218 "\tinline %s_enum %s(void);\n",
2222 "\tinline void %s(%s_enum value);",
2246 const char *collection_funcs =
"DefaultCollectionFunctions";
2255 "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s, %s)",
2260 (cprop->
length ?
"true" :
"false"),
2266 "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s, %s)",
2271 (cprop->
length ?
"true" :
"false"),
2288 return (
const char *)pprop->
type;
2296 const char *
namespace,
2297 int close_prototype)
2303 const char *retval_type =
"void";
2310 if (
namespace &&
namespace[0]) {
2326 int type, flag, flag_parameter, pout;
2339 ptrstr = pout ?
"**" :
"*";
2342 ptrstr = pout ?
"*" :
"";
2351 ptrstr = pout ?
"*" :
"";
2379 if (close_prototype) {
2407 switch (prop->
type) {
2414 "\tBOOLEAN_ARRAY_PROPERTY(%s, %u, %s)",
2421 "\tBOOLEAN_DYNAMIC_ARRAY_PROPERTY(%s, %s)",
2433 "\tINT_ARRAY_PROPERTY(%s, %u, %s)",
2440 "\tINT_DYNAMIC_ARRAY_PROPERTY(%s, %s)",
2452 "\tFLOAT_ARRAY_PROPERTY(%s, %u, %s)",
2459 "\tFLOAT_DYNAMIC_ARRAY_PROPERTY(%s, %s)",
2467 "\tENUM_PROPERTY(%s_enum, %s, %s)",
2483 "\tPOINTER_PROPERTY(%s, %s, %s)",
2484 (
const char *)pprop->
type,
2490 "\tPOINTER_PROPERTY(%s, %s, %s)",
2503 "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
2504 (
const char *)cprop->type,
2507 (cprop->
length ?
"true" :
"false"),
2513 "\tCOLLECTION_PROPERTY(%s, %s, %s, %s, %s, %s)",
2517 (cprop->
length ?
"true" :
"false"),
2534 char funcname[2048];
2541 fprintf(f,
"%s(", funcname);
2552 fprintf(f,
"(::%s *) this->ptr.data", dsrna->
dnafromname);
2555 fprintf(f,
"(::%s *) this->ptr.data", dsrna->
dnaname);
2558 fprintf(f,
"(::%s *) this->ptr.data", srna->
identifier);
2563 fprintf(f,
"this->ptr.type");
2579 for (; dp; dp = dp->
next) {
2603 "(::%s **) &%s->ptr.data",
2616 "(::%s *) %s.ptr.data",
2650 fprintf(f,
"\t\tPointerRNA result;\n");
2657 fprintf(f,
"\t\tRNA_id_pointer_create((::ID *) retdata, &result);\n");
2661 "\t\tRNA_pointer_create((::ID *) ptr.owner_id, &RNA_%s, retdata, &result);\n",
2662 (
const char *)pprop->
type);
2666 fprintf(f,
"\t\tresult = ");
2670 fprintf(f,
"\t\treturn %s(result);\n", (
const char *)pprop->
type);
2673 fprintf(f,
"\t\treturn ");
2682 fprintf(f,
"\t}\n\n");
2688 char funcname[2048];
2691 fprintf(f,
"int %s(PointerRNA *ptr, int *arraylen)\n", funcname);
2694 fprintf(f,
"}\n\n");
2705 char funcname[2048];
2716 fprintf(f,
"\n{\n");
2719 fprintf(f,
"\treturn %s(", dfunc->
call);
2722 fprintf(f,
"\t%s(", dfunc->
call);
2751 for (; dparm; dparm = dparm->
next) {
2767 fprintf(f,
"}\n\n");
2776 const char *funcname, *valstr;
2779 int flag, flag_parameter, pout, cptr, first;
2792 "void %s(bContext *C, ReportList *reports, PointerRNA *_ptr, ParameterList *_parms)",
2794 fprintf(f,
"\n{\n");
2799 fprintf(f,
"\tstruct ID *_selfid;\n");
2804 fprintf(f,
"\tstruct %s *_self;\n", dsrna->
dnafromname);
2807 fprintf(f,
"\tstruct %s *_self;\n", dsrna->
dnaname);
2810 fprintf(f,
"\tstruct %s *_self;\n", srna->
identifier);
2814 fprintf(f,
"\tstruct StructRNA *_type;\n");
2818 for (; dparm; dparm = dparm->
next) {
2830 ptrstr = pout ?
"**" :
"*";
2847 ptrstr = pout ?
"*" :
"";
2852 fprintf(f,
"\tint %s%s_len;\n", pout ?
"*" :
"", dparm->
prop->
identifier);
2864 fprintf(f,
"\tchar *_data");
2866 fprintf(f,
", *_retdata");
2874 fprintf(f,
"\t_selfid = (struct ID *)_ptr->owner_id;\n");
2879 fprintf(f,
"\t_self = (struct %s *)_ptr->data;\n", dsrna->
dnafromname);
2882 fprintf(f,
"\t_self = (struct %s *)_ptr->data;\n", dsrna->
dnaname);
2885 fprintf(f,
"\t_self = (struct %s *)_ptr->data;\n", srna->
identifier);
2889 fprintf(f,
"\t_type = _ptr->type;\n");
2893 fprintf(f,
"\t_data = (char *)_parms->data;\n");
2897 for (; dparm; dparm = dparm->
next) {
2905 fprintf(f,
"\t_retdata = _data;\n");
2908 const char *data_str;
2934 "\t%s_len = %s((ParameterDynAlloc *)_data)->array_tot;\n",
2936 pout ?
"(int *)&" :
"(int)");
2937 data_str =
"(&(((ParameterDynAlloc *)_data)->array))";
2945 fprintf(f,
"%s", valstr);
2967 fprintf(f,
"%s(", dfunc->
call);
2972 fprintf(f,
"_selfid");
2980 fprintf(f,
"_self");
2987 fprintf(f,
"_type");
2996 fprintf(f,
"CTX_data_main(C)");
3012 fprintf(f,
"reports");
3016 for (; dparm; dparm = dparm->
next) {
3044 "\t*((%s%s %s*)_retdata) = %s;\n",
3052 fprintf(f,
"}\n\n");
3072 ds->
dnaname =
"CollectionObject";
3138 return "BoolPropertyRNA";
3140 return "IntPropertyRNA";
3142 return "FloatPropertyRNA";
3144 return "StringPropertyRNA";
3146 return "EnumPropertyRNA";
3148 return "PointerPropertyRNA";
3150 return "CollectionPropertyRNA";
3152 return "UnknownPropertyRNA";
3162 return "PROP_FILEPATH";
3164 return "PROP_FILENAME";
3166 return "PROP_DIRPATH";
3168 return "PROP_PIXEL";
3170 return "PROP_BYTESTRING";
3172 return "PROP_UNSIGNED";
3174 return "PROP_PERCENTAGE";
3176 return "PROP_FACTOR";
3178 return "PROP_ANGLE";
3182 return "PROP_DISTANCE";
3184 return "PROP_DISTANCE_CAMERA";
3186 return "PROP_COLOR";
3188 return "PROP_TRANSLATION";
3190 return "PROP_DIRECTION";
3192 return "PROP_MATRIX";
3194 return "PROP_EULER";
3196 return "PROP_QUATERNION";
3198 return "PROP_AXISANGLE";
3200 return "PROP_VELOCITY";
3202 return "PROP_ACCELERATION";
3206 return "PROP_COLOR_GAMMA";
3208 return "PROP_COORDS";
3210 return "PROP_LAYER";
3212 return "PROP_LAYER_MEMBER";
3214 return "PROP_PASSWORD";
3216 return "PROP_POWER";
3218 return "PROP_TEMPERATURE";
3224 return "PROP_SUBTYPE_UNKNOWN";
3233 return "PROP_UNIT_NONE";
3235 return "PROP_UNIT_LENGTH";
3237 return "PROP_UNIT_AREA";
3239 return "PROP_UNIT_VOLUME";
3241 return "PROP_UNIT_MASS";
3243 return "PROP_UNIT_ROTATION";
3245 return "PROP_UNIT_TIME";
3247 return "PROP_UNIT_VELOCITY";
3249 return "PROP_UNIT_ACCELERATION";
3251 return "PROP_UNIT_CAMERA";
3253 return "PROP_UNIT_POWER";
3255 return "PROP_UNIT_TEMPERATURE";
3257 return "PROP_UNIT_UNKNOWN";
3266 fprintf(f,
"extern StructRNA RNA_%s;\n", srna->
identifier);
3276 "BlenderRNA BLENDER_RNA = {\n"
3283 fprintf(f,
"NULL, ");
3291 fprintf(f,
"NULL},\n");
3295 "\t.structs_map = NULL,\n"
3296 "\t.structs_len = 0,\n"
3310 "%s%s rna_%s_%s;\n",
3342 "%s%s rna_%s_%s_%s;\n",
3364 "%s%s rna_%s_%s_func;\n",
3393 const char *name_override,
3394 int close_prototype)
3400 int flag, flag_parameter, pout, cptr, first;
3410 fprintf(f,
"XXX no array return types yet");
3425 fprintf(f,
"void ");
3429 if (name_override ==
NULL || name_override[0] ==
'\0') {
3430 fprintf(f,
"%s(", dfunc->
call);
3433 fprintf(f,
"%s(", name_override);
3440 fprintf(f,
"struct ID *_selfid");
3449 fprintf(f,
"struct %s *_self", dsrna->
dnafromname);
3452 fprintf(f,
"struct %s *_self", dsrna->
dnaname);
3455 fprintf(f,
"struct %s *_self", srna->
identifier);
3463 fprintf(f,
"struct StructRNA *_type");
3472 fprintf(f,
"Main *bmain");
3480 fprintf(f,
"bContext *C");
3488 fprintf(f,
"ReportList *reports");
3504 ptrstr = pout ?
"**" :
"*";
3513 ptrstr = pout ?
"*" :
"";
3522 fprintf(f,
"int %s%s_len, ", pout ?
"*" :
"", dparm->
prop->
identifier);
3550 if (close_prototype) {
3568 fprintf(f,
"/* Repeated prototypes to detect errors */\n\n");
3584 const char *structures[2048];
3585 int all_structures = 0;
3595 if (struct_name ==
NULL) {
3596 printf(
"No struct found for property '%s'\n", dp->
prop->
identifier);
3600 for (
a = 0;
a < all_structures;
a++) {
3601 if (
STREQ(struct_name, structures[
a])) {
3608 fprintf(f,
"struct %s;\n", struct_name);
3610 if (all_structures >=
ARRAY_SIZE(structures)) {
3611 printf(
"Array size to store all structures names is too small\n");
3615 structures[all_structures++] = struct_name;
3628 char *strnest = (
char *)
"", *errnest = (
char *)
"";
3629 int len, freenest = 0;
3634 strnest =
MEM_mallocN(
sizeof(
char) * (
len + 2),
"rna_generate_property -> strnest");
3635 errnest =
MEM_mallocN(
sizeof(
char) * (
len + 2),
"rna_generate_property -> errnest");
3637 strcpy(strnest,
"_");
3638 strcat(strnest, nest);
3639 strcpy(errnest,
".");
3640 strcat(errnest, nest);
3645 switch (prop->
type) {
3648 int i, defaultfound = 0, totflag = 0;
3652 "static const EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t",
3658 for (i = 0; i < eprop->
totitem; i++) {
3659 fprintf(f,
"{%d, ", eprop->
item[i].
value);
3662 fprintf(f,
"%d, ", eprop->
item[i].
icon);
3666 fprintf(f,
"},\n\t");
3680 fprintf(f,
"{0, NULL, 0, NULL, NULL}\n};\n\n");
3685 "%s%s.%s, enum default includes unused bits (%d).",
3696 "%s%s.%s, enum default is not in items.",
3706 "%s%s.%s, enum must have items defined.",
3720 "static bool rna_%s%s_%s_default[%u] = {\n\t",
3734 fprintf(f,
",\n\t");
3738 fprintf(f,
"\n};\n\n");
3748 "static int rna_%s%s_%s_default[%u] = {\n\t",
3762 fprintf(f,
",\n\t");
3766 fprintf(f,
"\n};\n\n");
3776 "static float rna_%s%s_%s_default[%u] = {\n\t",
3790 fprintf(f,
",\n\t");
3794 fprintf(f,
"\n};\n\n");
3827 "%s rna_%s%s_%s = {\n",
3838 fprintf(f,
"\t{NULL, ");
3845 fprintf(f,
"NULL,\n");
3847 fprintf(f,
"\t%d, ", prop->
magic);
3850 ", %d, %d, %d, %d, %d, ",
3857 fprintf(f,
",\n\t");
3859 fprintf(f,
",\n\t");
3860 fprintf(f,
"%d, ", prop->
icon);
3864 "\t%s, %s | %s, %s, %u, {%u, %u, %u}, %u,\n",
3875 "\t%s%s, %d, %s, %s, %s, %s, %s,\n",
3889 fprintf(f,
"\t0, -1");
3894 fprintf(f,
", &RNA_%s", (
const char *)prop->
srna);
3897 fprintf(f,
", NULL");
3902 switch (prop->
type) {
3906 "\t%s, %s, %s, %s, %s, %s, %s, %s, %d, ",
3920 fprintf(f,
"NULL\n");
3927 "\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s,\n\t",
3954 fprintf(f,
"NULL\n");
3961 "\t%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, ",
3990 fprintf(f,
"NULL\n");
3997 "\t%s, %s, %s, %s, %s, %s, %d, ",
4012 "\t%s, %s, %s, %s, %s, ",
4022 fprintf(f,
"NULL, ");
4030 "\t%s, %s, %s, %s,",
4036 fprintf(f,
"&RNA_%s\n", (
const char *)pprop->
type);
4039 fprintf(f,
"NULL\n");
4046 "\t%s, %s, %s, %s, %s, %s, %s, %s, ",
4056 fprintf(f,
"&RNA_%s\n", (
const char *)cprop->
item_type);
4059 fprintf(f,
"NULL\n");
4065 fprintf(f,
"};\n\n");
4080 fprintf(f,
"/* %s */\n", srna->
name);
4091 fprintf(f,
"%s%s rna_%s_%s_func = {\n",
"",
"FunctionRNA", srna->
identifier, func->
identifier);
4095 "\t{(FunctionRNA *)&rna_%s_%s_func, ",
4100 fprintf(f,
"\t{NULL, ");
4104 "(FunctionRNA *)&rna_%s_%s_func,\n",
4109 fprintf(f,
"NULL,\n");
4112 fprintf(f,
"\tNULL,\n");
4117 "\t{(PropertyRNA *)&rna_%s_%s_%s, ",
4123 fprintf(f,
"\t{NULL, ");
4129 "(PropertyRNA *)&rna_%s_%s_%s}},\n",
4135 fprintf(f,
"NULL}},\n");
4140 fprintf(f,
", %d, ", func->
flag);
4146 fprintf(f,
"\t%s,\n", dfunc->
gencall);
4149 fprintf(f,
"\tNULL,\n");
4154 "\t(PropertyRNA *)&rna_%s_%s_%s\n",
4160 fprintf(f,
"\tNULL\n");
4167 fprintf(f,
"StructRNA RNA_%s = {\n", srna->
identifier);
4170 fprintf(f,
"\t{(ContainerRNA *)&RNA_%s, ", ((
StructRNA *)srna->
cont.
next)->identifier);
4173 fprintf(f,
"\t{NULL, ");
4176 fprintf(f,
"(ContainerRNA *)&RNA_%s,\n", ((
StructRNA *)srna->
cont.
prev)->identifier);
4179 fprintf(f,
"NULL,\n");
4182 fprintf(f,
"\tNULL,\n");
4189 fprintf(f,
"\t{NULL, ");
4197 fprintf(f,
"NULL}},\n");
4201 fprintf(f,
", NULL, NULL");
4202 fprintf(f,
", %d, NULL, ", srna->
flag);
4204 fprintf(f,
",\n\t");
4206 fprintf(f,
",\n\t");
4208 fprintf(f,
", %d,\n", srna->
icon);
4220 fprintf(f,
"\tNULL, ");
4228 fprintf(f,
"(PropertyRNA *)&rna_%s_rna_properties,\n", base->
identifier);
4234 fprintf(f,
"\tNULL,\n");
4241 fprintf(f,
"\tNULL,\n");
4253 &
LOG,
"%s has a register function, must also have refine function.", srna->
identifier);
4262 fprintf(f,
"\t{NULL, ");
4270 fprintf(f,
"NULL}\n");
4307 #ifdef WITH_HAIR_NODES
4332 #ifdef WITH_POINT_CLOUD
4344 #ifdef WITH_GEOMETRY_NODES
4376 "/* Automatically generated struct definitions for the Data API.\n"
4377 " * Do not edit manually, changes will be overwritten. */\n\n"
4378 "#define RNA_RUNTIME\n\n");
4380 fprintf(f,
"#include <float.h>\n");
4381 fprintf(f,
"#include <stdio.h>\n");
4382 fprintf(f,
"#include <limits.h>\n");
4383 fprintf(f,
"#include <string.h>\n\n");
4384 fprintf(f,
"#include <stddef.h>\n\n");
4386 fprintf(f,
"#include \"MEM_guardedalloc.h\"\n\n");
4388 fprintf(f,
"#include \"DNA_ID.h\"\n");
4389 fprintf(f,
"#include \"DNA_scene_types.h\"\n");
4390 fprintf(f,
"#include \"DNA_node_types.h\"\n");
4392 fprintf(f,
"#include \"BLI_blenlib.h\"\n\n");
4393 fprintf(f,
"#include \"BLI_utildefines.h\"\n\n");
4395 fprintf(f,
"#include \"BKE_context.h\"\n");
4396 fprintf(f,
"#include \"BKE_lib_id.h\"\n");
4397 fprintf(f,
"#include \"BKE_main.h\"\n");
4398 fprintf(f,
"#include \"BKE_report.h\"\n");
4400 fprintf(f,
"#include \"RNA_define.h\"\n");
4401 fprintf(f,
"#include \"RNA_types.h\"\n");
4402 fprintf(f,
"#include \"rna_internal.h\"\n\n");
4405 fprintf(f,
"#include \"rna_prototypes_gen.h\"\n\n");
4408 fprintf(f,
"#include \"%s\"\n", filename);
4411 fprintf(f,
"#include \"%s\"\n", api_filename);
4417 #if defined(__GNUC__) || defined(__clang__)
4418 fprintf(f,
"#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n");
4421 fprintf(f,
"/* Autogenerated Functions */\n\n");
4424 if (!filename || ds->
filename == filename) {
4431 if (!filename || ds->
filename == filename) {
4439 if (!filename || ds->
filename == filename) {
4454 if (!filename || ds->
filename == filename) {
4459 if (filename &&
STREQ(filename,
"rna_ID.c")) {
4462 fprintf(f,
"#include \"rna_define.c\"\n\n");
4475 fprintf(f,
"\n#ifndef __RNA_BLENDER_H__\n");
4476 fprintf(f,
"#define __RNA_BLENDER_H__\n\n");
4479 "/* Automatically generated function declarations for the Data API.\n"
4480 " * Do not edit manually, changes will be overwritten. */\n\n");
4482 fprintf(f,
"#include \"RNA_types.h\"\n\n");
4483 fprintf(f,
"#include \"DNA_node_types.h\"\n\n");
4485 fprintf(f,
"#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n");
4487 fprintf(f,
"#define FOREACH_BEGIN(property, sptr, itemptr) \\\n");
4488 fprintf(f,
" { \\\n");
4489 fprintf(f,
" CollectionPropertyIterator rna_macro_iter; \\\n");
4491 " for (property##_begin(&rna_macro_iter, sptr); rna_macro_iter.valid; "
4492 "property##_next(&rna_macro_iter)) { \\\n");
4493 fprintf(f,
" itemptr = rna_macro_iter.ptr;\n\n");
4495 fprintf(f,
"#define FOREACH_END(property) \\\n");
4496 fprintf(f,
" } \\\n");
4497 fprintf(f,
" property##_end(&rna_macro_iter); \\\n");
4498 fprintf(f,
" }\n\n");
4503 fprintf(f,
"/**************** %s ****************/\n\n", srna->
name);
4506 fprintf(f,
"extern StructRNA RNA_%s;\n", srna->
identifier);
4520 fprintf(f,
"#ifdef __cplusplus\n}\n#endif\n\n");
4522 fprintf(f,
"#endif /* __RNA_BLENDER_H__ */\n\n");
4528 "#include <stdlib.h> /* for malloc */\n"
4529 "#include <string>\n"
4530 "#include <string.h> /* for memcpy */\n"
4534 "#define BOOLEAN_PROPERTY(sname, identifier) \\\n"
4535 " inline bool sname::identifier(void) { return sname##_##identifier##_get(&ptr) ? true: "
4537 " inline void sname::identifier(bool value) { sname##_##identifier##_set(&ptr, value); }\n"
4539 "#define BOOLEAN_ARRAY_PROPERTY(sname, size, identifier) \\\n"
4540 " inline Array<bool, size> sname::identifier(void) \\\n"
4541 " { Array<bool, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
4542 " inline void sname::identifier(bool values[size]) \\\n"
4543 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4545 "#define BOOLEAN_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
4546 " inline DynamicArray<bool> sname::identifier(void) { \\\n"
4547 " int arraylen[3]; \\\n"
4548 " int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
4549 " DynamicArray<bool> ar(len); \\\n"
4550 " sname##_##identifier##_get(&ptr, ar.data); \\\n"
4551 " return ar; } \\\n"
4552 " inline void sname::identifier(bool values[]) \\\n"
4553 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4555 "#define INT_PROPERTY(sname, identifier) \\\n"
4556 " inline int sname::identifier(void) { return sname##_##identifier##_get(&ptr); } \\\n"
4557 " inline void sname::identifier(int value) { sname##_##identifier##_set(&ptr, value); }\n"
4559 "#define INT_ARRAY_PROPERTY(sname, size, identifier) \\\n"
4560 " inline Array<int, size> sname::identifier(void) \\\n"
4561 " { Array<int, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
4562 " inline void sname::identifier(int values[size]) \\\n"
4563 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4565 "#define INT_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
4566 " inline DynamicArray<int> sname::identifier(void) { \\\n"
4567 " int arraylen[3]; \\\n"
4568 " int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
4569 " DynamicArray<int> ar(len); \\\n"
4570 " sname##_##identifier##_get(&ptr, ar.data); \\\n"
4571 " return ar; } \\\n"
4572 " inline void sname::identifier(int values[]) \\\n"
4573 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4575 "#define FLOAT_PROPERTY(sname, identifier) \\\n"
4576 " inline float sname::identifier(void) { return sname##_##identifier##_get(&ptr); } \\\n"
4577 " inline void sname::identifier(float value) { sname##_##identifier##_set(&ptr, value); }\n"
4579 "#define FLOAT_ARRAY_PROPERTY(sname, size, identifier) \\\n"
4580 " inline Array<float, size> sname::identifier(void) \\\n"
4581 " { Array<float, size> ar; sname##_##identifier##_get(&ptr, ar.data); return ar; } \\\n"
4582 " inline void sname::identifier(float values[size]) \\\n"
4583 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4585 "#define FLOAT_DYNAMIC_ARRAY_PROPERTY(sname, identifier) \\\n"
4586 " inline DynamicArray<float> sname::identifier(void) { \\\n"
4587 " int arraylen[3]; \\\n"
4588 " int len = sname##_##identifier##_get_length(&ptr, arraylen); \\\n"
4589 " DynamicArray<float> ar(len); \\\n"
4590 " sname##_##identifier##_get(&ptr, ar.data); \\\n"
4591 " return ar; } \\\n"
4592 " inline void sname::identifier(float values[]) \\\n"
4593 " { sname##_##identifier##_set(&ptr, values); } \\\n"
4595 "#define ENUM_PROPERTY(type, sname, identifier) \\\n"
4596 " inline sname::type sname::identifier(void) { return "
4597 "(type)sname##_##identifier##_get(&ptr); } \\\n"
4598 " inline void sname::identifier(sname::type value) { sname##_##identifier##_set(&ptr, "
4601 "#define STRING_PROPERTY(sname, identifier) \\\n"
4602 " inline std::string sname::identifier(void) { \\\n"
4603 " int len = sname##_##identifier##_length(&ptr); \\\n"
4604 " std::string str; str.resize(len); \\\n"
4605 " sname##_##identifier##_get(&ptr, &str[0]); return str; } \\\n"
4606 " inline void sname::identifier(const std::string& value) { \\\n"
4607 " sname##_##identifier##_set(&ptr, value.c_str()); } \\\n"
4609 "#define POINTER_PROPERTY(type, sname, identifier) \\\n"
4610 " inline type sname::identifier(void) { return type(sname##_##identifier##_get(&ptr)); }\n"
4612 "#define COLLECTION_PROPERTY_LENGTH_false(sname, identifier) \\\n"
4613 " inline static int sname##_##identifier##_length_wrap(PointerRNA *ptr) \\\n"
4615 " CollectionPropertyIterator iter; \\\n"
4616 " int length = 0; \\\n"
4617 " sname##_##identifier##_begin(&iter, ptr); \\\n"
4618 " while (iter.valid) { \\\n"
4619 " sname##_##identifier##_next(&iter); \\\n"
4622 " sname##_##identifier##_end(&iter); \\\n"
4623 " return length; \\\n"
4625 "#define COLLECTION_PROPERTY_LENGTH_true(sname, identifier) \\\n"
4626 " inline static int sname##_##identifier##_length_wrap(PointerRNA *ptr) \\\n"
4627 " { return sname##_##identifier##_length(ptr); } \n"
4629 "#define COLLECTION_PROPERTY_LOOKUP_INT_false(sname, identifier) \\\n"
4630 " inline static int sname##_##identifier##_lookup_int_wrap(PointerRNA *ptr, int key, "
4631 "PointerRNA *r_ptr) \\\n"
4633 " CollectionPropertyIterator iter; \\\n"
4634 " int i = 0, found = 0; \\\n"
4635 " sname##_##identifier##_begin(&iter, ptr); \\\n"
4636 " while (iter.valid) { \\\n"
4637 " if (i == key) { \\\n"
4638 " *r_ptr = iter.ptr; \\\n"
4642 " sname##_##identifier##_next(&iter); \\\n"
4645 " sname##_##identifier##_end(&iter); \\\n"
4646 " if (!found) { \\\n"
4647 " memset(r_ptr, 0, sizeof(*r_ptr)); \\\n"
4649 " return found; \\\n"
4651 "#define COLLECTION_PROPERTY_LOOKUP_INT_true(sname, identifier) \\\n"
4652 " inline static int sname##_##identifier##_lookup_int_wrap(PointerRNA *ptr, int key, "
4653 "PointerRNA *r_ptr) \\\n"
4655 " int found = sname##_##identifier##_lookup_int(ptr, key, r_ptr); \\\n"
4656 " if (!found) { \\\n"
4657 " memset(r_ptr, 0, sizeof(*r_ptr)); \\\n"
4659 " return found; \\\n"
4661 "#define COLLECTION_PROPERTY_LOOKUP_STRING_false(sname, identifier) \\\n"
4662 " inline static int sname##_##identifier##_lookup_string_wrap(PointerRNA *ptr, const char "
4663 "*key, PointerRNA *r_ptr) \\\n"
4665 " CollectionPropertyIterator iter; \\\n"
4666 " int found = 0; \\\n"
4667 " PropertyRNA *item_name_prop = RNA_struct_name_property(ptr->type); \\\n"
4668 " sname##_##identifier##_begin(&iter, ptr); \\\n"
4669 " while (iter.valid && !found) { \\\n"
4670 " char name_fixed[32]; \\\n"
4671 " const char *name; \\\n"
4672 " int name_length; \\\n"
4673 " name = RNA_property_string_get_alloc(&iter.ptr, item_name_prop, name_fixed, "
4674 "sizeof(name_fixed), &name_length); \\\n"
4675 " if (!strncmp(name, key, name_length)) { \\\n"
4676 " *r_ptr = iter.ptr; \\\n"
4679 " if (name_fixed != name) { \\\n"
4680 " MEM_freeN((void *) name); \\\n"
4682 " sname##_##identifier##_next(&iter); \\\n"
4684 " sname##_##identifier##_end(&iter); \\\n"
4685 " if (!found) { \\\n"
4686 " memset(r_ptr, 0, sizeof(*r_ptr)); \\\n"
4688 " return found; \\\n"
4690 "#define COLLECTION_PROPERTY_LOOKUP_STRING_true(sname, identifier) \\\n"
4691 " inline static int sname##_##identifier##_lookup_string_wrap(PointerRNA *ptr, const char "
4692 "*key, PointerRNA *r_ptr) \\\n"
4694 " int found = sname##_##identifier##_lookup_string(ptr, key, r_ptr); \\\n"
4695 " if (!found) { \\\n"
4696 " memset(r_ptr, 0, sizeof(*r_ptr)); \\\n"
4698 " return found; \\\n"
4700 "#define COLLECTION_PROPERTY(collection_funcs, type, sname, identifier, has_length, "
4701 "has_lookup_int, has_lookup_string) \\\n"
4702 " typedef CollectionIterator<type, sname##_##identifier##_begin, \\\n"
4703 " sname##_##identifier##_next, sname##_##identifier##_end> identifier##_iterator; \\\n"
4704 " COLLECTION_PROPERTY_LENGTH_##has_length(sname, identifier) \\\n"
4705 " COLLECTION_PROPERTY_LOOKUP_INT_##has_lookup_int(sname, identifier) \\\n"
4706 " COLLECTION_PROPERTY_LOOKUP_STRING_##has_lookup_string(sname, identifier) \\\n"
4707 " CollectionRef<sname, type, sname##_##identifier##_begin, \\\n"
4708 " sname##_##identifier##_next, sname##_##identifier##_end, \\\n"
4709 " sname##_##identifier##_length_wrap, \\\n"
4710 " sname##_##identifier##_lookup_int_wrap, sname##_##identifier##_lookup_string_wrap, "
4711 "collection_funcs> identifier;\n"
4715 " Pointer(const PointerRNA &p) : ptr(p) { }\n"
4716 " operator const PointerRNA&() { return ptr; }\n"
4717 " bool is_a(StructRNA *type) { return RNA_struct_is_a(ptr.type, type) ? true: false; }\n"
4718 " operator void*() { return ptr.data; }\n"
4719 " operator bool() { return ptr.data != NULL; }\n"
4721 " bool operator==(const Pointer &other) const { return ptr.data == other.ptr.data; }\n"
4722 " bool operator!=(const Pointer &other) const { return ptr.data != other.ptr.data; }\n"
4724 " PointerRNA ptr;\n"
4728 "template<typename T, int Tsize>\n"
4734 " Array(const Array<T, Tsize>& other) { memcpy(data, other.data, sizeof(T) * Tsize); }\n"
4735 " const Array<T, Tsize>& operator = (const Array<T, Tsize>& other) { memcpy(data, "
4736 "other.data, sizeof(T) * Tsize); "
4739 " operator T*() { return data; }\n"
4740 " operator const T*() const { return data; }\n"
4743 "template<typename T>\n"
4744 "class DynamicArray {\n"
4749 " DynamicArray() : data(NULL), length(0) {}\n"
4750 " DynamicArray(int new_length) : data(NULL), length(new_length) { data = (T "
4751 "*)malloc(sizeof(T) * new_length); }\n"
4752 " DynamicArray(const DynamicArray<T>& other) : data(NULL), length(0) { copy_from(other); "
4754 " const DynamicArray<T>& operator = (const DynamicArray<T>& other) { copy_from(other); "
4757 " ~DynamicArray() { if (data) free(data); }\n"
4759 " operator T*() { return data; }\n"
4762 " void copy_from(const DynamicArray<T>& other) {\n"
4763 " if (data) free(data);\n"
4764 " data = (T *)malloc(sizeof(T) * other.length);\n"
4765 " memcpy(data, other.data, sizeof(T) * other.length);\n"
4766 " length = other.length;\n"
4770 "typedef void (*TBeginFunc)(CollectionPropertyIterator *iter, PointerRNA *ptr);\n"
4771 "typedef void (*TNextFunc)(CollectionPropertyIterator *iter);\n"
4772 "typedef void (*TEndFunc)(CollectionPropertyIterator *iter);\n"
4773 "typedef int (*TLengthFunc)(PointerRNA *ptr);\n"
4774 "typedef int (*TLookupIntFunc)(PointerRNA *ptr, int key, PointerRNA *r_ptr);\n"
4775 "typedef int (*TLookupStringFunc)(PointerRNA *ptr, const char *key, PointerRNA *r_ptr);\n"
4777 "template<typename T, TBeginFunc Tbegin, TNextFunc Tnext, TEndFunc Tend>\n"
4778 "class CollectionIterator {\n"
4780 " CollectionIterator() : iter(), t(iter.ptr), init(false) { iter.valid = false; }\n"
4781 " CollectionIterator(const PointerRNA &ptr) : CollectionIterator() { this->begin(ptr); }\n"
4782 " ~CollectionIterator(void) { if (init) Tend(&iter); };\n"
4784 " CollectionIterator(const CollectionIterator &other) = delete;\n"
4785 " CollectionIterator(CollectionIterator &&other) = delete;\n"
4786 " CollectionIterator &operator=(const CollectionIterator &other) = delete;\n"
4787 " CollectionIterator &operator=(CollectionIterator &&other) = delete;\n"
4789 " operator bool(void)\n"
4790 " { return iter.valid != 0; }\n"
4791 " const CollectionIterator<T, Tbegin, Tnext, Tend>& operator++() { Tnext(&iter); t = "
4792 "T(iter.ptr); return *this; }\n"
4794 " T& operator*(void) { return t; }\n"
4795 " T* operator->(void) { return &t; }\n"
4796 " bool operator == (const CollectionIterator<T, Tbegin, Tnext, Tend>& other) "
4797 "{ return iter.valid == other.iter.valid; }\n"
4798 " bool operator!=(const CollectionIterator<T, Tbegin, Tnext, Tend>& other) "
4799 "{ return iter.valid != other.iter.valid; }\n"
4801 " void begin(const Pointer &ptr)\n"
4802 " { if (init) Tend(&iter); Tbegin(&iter, (PointerRNA *)&ptr.ptr); t = T(iter.ptr); init = "
4806 " CollectionPropertyIterator iter;\n"
4811 "template<typename Tp, typename T, TBeginFunc Tbegin, TNextFunc Tnext, TEndFunc Tend,\n"
4812 " TLengthFunc Tlength, TLookupIntFunc Tlookup_int, TLookupStringFunc Tlookup_string,\n"
4813 " typename Tcollection_funcs>\n"
4814 "class CollectionRef : public Tcollection_funcs {\n"
4816 " CollectionRef(const PointerRNA &p) : Tcollection_funcs(p), ptr(p) {}\n"
4818 " void begin(CollectionIterator<T, Tbegin, Tnext, Tend>& iter)\n"
4819 " { iter.begin(ptr); }\n"
4820 " CollectionIterator<T, Tbegin, Tnext, Tend> begin()\n"
4821 " { return CollectionIterator<T, Tbegin, Tnext, Tend>(ptr); }\n"
4822 " CollectionIterator<T, Tbegin, Tnext, Tend> end()\n"
4823 " { return CollectionIterator<T, Tbegin, Tnext, Tend>(); } /* test */ \n"
4826 " { return Tlength(&ptr); }\n"
4827 " T operator[](int key)\n"
4828 " { PointerRNA r_ptr; Tlookup_int(&ptr, key, &r_ptr); return T(r_ptr); }\n"
4829 " T operator[](const std::string &key)\n"
4830 " { PointerRNA r_ptr; Tlookup_string(&ptr, key.c_str(), &r_ptr); return T(r_ptr); }\n"
4833 " PointerRNA ptr;\n"
4836 "class DefaultCollectionFunctions {\n"
4838 " DefaultCollectionFunctions(const PointerRNA & /*p*/) {}\n"
4855 const char *struct_name)
4857 int a = 0, found = 0;
4859 while (collection_structs[
a]) {
4860 if (
STREQ(collection_structs[
a], struct_name)) {
4876 fprintf(f,
"/**************** %s ****************/\n\n", srna->
name);
4879 "class %s : public %s {\n",
4882 fprintf(f,
"public:\n");
4884 "\t%s(const PointerRNA &ptr_arg) :\n\t\t%s(ptr_arg)",
4892 fprintf(f,
"\n\t\t{}\n\n");
4903 fprintf(f,
"};\n\n");
4912 const char *first_collection_func_struct =
NULL;
4913 const char *collection_func_structs[256] = {
NULL};
4914 int all_collection_func_structs = 0;
4915 int max_collection_func_structs =
sizeof(collection_func_structs) /
4916 sizeof(collection_func_structs[0]) -
4919 fprintf(f,
"\n#ifndef __RNA_BLENDER_CPP_H__\n");
4920 fprintf(f,
"#define __RNA_BLENDER_CPP_H__\n\n");
4923 "/* Automatically generated classes for the Data API.\n"
4924 " * Do not edit manually, changes will be overwritten. */\n\n");
4926 fprintf(f,
"#include \"RNA_blender.h\"\n");
4927 fprintf(f,
"#include \"RNA_types.h\"\n");
4928 fprintf(f,
"#include \"RNA_access.h\"\n");
4929 fprintf(f,
"#include \"DNA_node_types.h\"\n");
4933 fprintf(f,
"/**************** Declarations ****************/\n\n");
4948 if (first_collection_func_struct ==
NULL) {
4953 if (all_collection_func_structs >= max_collection_func_structs) {
4954 printf(
"Array size to store all collection structures names is too small\n");
4958 collection_func_structs[all_collection_func_structs++] = (
char *)prop->
srna;
4992 fprintf(f,
"} /* namespace BL */\n");
4995 fprintf(f,
"/**************** Implementation ****************/\n");
4998 fprintf(f,
"/* Structure prototypes */\n\n");
4999 fprintf(f,
"extern \"C\" {\n");
5001 fprintf(f,
"}\n\n");
5003 fprintf(f,
"namespace BL {\n");
5021 fprintf(f,
"}\n\n#endif /* __RNA_BLENDER_CPP_H__ */\n\n");
5026 FILE *fp = fopen(
file,
"w");
5028 "#error \"Error! can't make correct RNA file from %s:%d, "
5029 "check DNA properties.\"\n",
5042 const char *deps[3];
5053 fprintf(stderr,
"Error: DefRNA.animate left disabled in %s\n",
PROCESS_ITEMS[i].filename);
5069 strcpy(deffile, outfile);
5070 strcat(deffile,
"rna_prototypes_gen.h");
5074 file = fopen(deffile,
"w");
5076 fprintf(stderr,
"Unable to open file: %s\n", deffile);
5081 "/* Automatically generated function declarations for the Data API.\n"
5082 " * Do not edit manually, changes will be overwritten. */\n\n");
5090 strcpy(deffile, outfile);
5092 deffile[strlen(deffile) - 2] =
'\0';
5093 strcat(deffile,
"_gen.c" TMP_EXT);
5099 file = fopen(deffile,
"w");
5102 fprintf(stderr,
"Unable to open file: %s\n", deffile);
5121 strcpy(deffile, outfile);
5122 strcat(deffile,
"RNA_blender_cpp.h" TMP_EXT);
5128 file = fopen(deffile,
"w");
5131 fprintf(stderr,
"Unable to open file: %s\n", deffile);
5146 strcpy(deffile, outfile);
5147 strcat(deffile,
"RNA_blender.h" TMP_EXT);
5153 file = fopen(deffile,
"w");
5156 fprintf(stderr,
"Unable to open file: %s\n", deffile);
5177 fprintf(stderr,
"%s", errorStr);
5183 int return_status = 0;
5195 fprintf(stderr,
"Usage: %s outdirectory/\n", argv[0]);
5200 fprintf(stderr,
"Running makesrna\n");
5208 return return_status;
#define CLOG_ERROR(clg_ref,...)
void CLG_output_use_basename_set(int value)
void CLG_level_set(int level)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define IS_DNATYPE_BOOLEAN_COMPAT(_str)
#define IS_DNATYPE_FLOAT_COMPAT(_str)
#define IS_DNATYPE_INT_COMPAT(_str)
#define RNA_SUBTYPE_UNIT(subtype)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void MEM_init_memleak_detection(void)
static void rna_def_struct_function_header_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
static void rna_print_data_get(FILE *f, PropertyDefRNA *dp)
static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
static char * rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array)
static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
static void rna_generate_static_function_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
static char * rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc, const char *nextfunc)
static void rna_generate_property_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
static int rna_preprocess(const char *outfile)
static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f)
static const char * rna_parameter_type_cpp_name(PropertyRNA *prop)
static void rna_print_id_get(FILE *f, PropertyDefRNA *UNUSED(dp))
static void rna_print_c_string(FILE *f, const char *str)
void * rna_calloc(int buffer_len)
static void rna_set_raw_offset(FILE *f, StructRNA *srna, PropertyRNA *prop)
static const char * rna_type_type_name(PropertyRNA *prop)
static int replace_if_different(const char *tmpfile, const char *dep_files[])
static char * rna_alloc_function_name(const char *structname, const char *propname, const char *type)
static void rna_float_print(FILE *f, float num)
int main(int argc, char **argv)
static const char * rna_find_dna_type(const char *type)
static RNAProcessItem PROCESS_ITEMS[]
static const char * cpp_classes
static void mem_error_cb(const char *errorStr)
static int rna_enum_bitmask(PropertyRNA *prop)
static void rna_generate_header_class_cpp(StructDefRNA *ds, FILE *f)
static void rna_auto_types(void)
static const char * rna_type_type(PropertyRNA *prop)
static char * rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *UNUSED(dp), const char *manualfunc)
static void rna_generate_blender(BlenderRNA *brna, FILE *f)
static const char * rna_safe_id(const char *id)
static void rna_def_struct_function_impl_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
static int cmp_def_struct(const void *a, const void *b)
static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
static int file_older(const char *file1, const char *file2)
static void rna_def_function_wrapper_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA *dfunc)
static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, PropertyRNA *prop)
static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
static char * rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static void rna_sort(BlenderRNA *brna)
void BLI_system_backtrace(FILE *fp)
static void rna_def_function_funcs_header(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc)
static void rna_clamp_value_range(FILE *f, PropertyRNA *prop)
#define WRITE_PARAM(param)
static void rna_def_struct_function_prototype_cpp(FILE *f, StructRNA *UNUSED(srna), FunctionDefRNA *dfunc, const char *namespace, int close_prototype)
struct RNAProcessItem RNAProcessItem
static int rna_is_collection_functions_struct(const char **collection_structs, const char *struct_name)
static void rna_generate_static_parameter_prototypes(FILE *f, StructRNA *srna, FunctionDefRNA *dfunc, const char *name_override, int close_prototype)
static int cmp_def_property(const void *a, const void *b)
static const char * rna_function_string(const void *func)
static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
static const char * rna_property_structname(PropertyType type)
static const char * rna_property_subtype_unit(PropertySubType type)
static const char * rna_type_struct(PropertyRNA *prop)
static const char * makesrna_path
static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f)
static void rna_generate_parameter_prototypes(BlenderRNA *UNUSED(brna), StructRNA *srna, FunctionRNA *func, FILE *f)
static int cmp_property(const void *a, const void *b)
static StructRNA * rna_find_struct(const char *identifier)
static void rna_generate_function_prototypes(BlenderRNA *brna, StructRNA *srna, FILE *f)
static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
void * rna_alloc_from_buffer(const char *buffer, int buffer_len)
static void rna_generate_struct(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE *f)
static void rna_construct_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
static void rna_int_print(FILE *f, int64_t num)
static void rna_sortlist(ListBase *listbase, int(*cmp)(const void *, const void *))
static void rna_generate_struct_prototypes(FILE *f)
static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const char *api_filename)
static const char * rna_parameter_type_name(PropertyRNA *parm)
static void rna_def_property_wrapper_funcs(FILE *f, StructDefRNA *dsrna, PropertyDefRNA *dp)
static int rna_is_collection_prop(PropertyRNA *prop)
static const char * rna_find_type(const char *type)
static char * rna_def_property_lookup_string_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc, const char *item_type)
static char * rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *UNUSED(dp), const char *manualfunc)
static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDefRNA *dp)
static int cmp_struct(const void *a, const void *b)
static const char * rna_property_subtypename(PropertySubType type)
static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop)
static char * rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static void rna_construct_wrapper_function_name(char *buffer, int size, const char *structname, const char *propname, const char *type)
static char * rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc)
static void rna_generate_prototypes(BlenderRNA *brna, FILE *f)
static void make_bad_file(const char *file, int line)
void(* MEM_freeN)(void *vmemh)
void(* MEM_set_error_callback)(void(*func)(const char *))
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
void RNA_def_ID(BlenderRNA *brna)
void RNA_def_action(BlenderRNA *brna)
void RNA_def_animation(BlenderRNA *brna)
void RNA_def_animviz(BlenderRNA *brna)
void RNA_def_armature(BlenderRNA *brna)
void RNA_def_asset(BlenderRNA *brna)
void RNA_def_attribute(BlenderRNA *brna)
void RNA_def_boid(BlenderRNA *brna)
void RNA_def_brush(BlenderRNA *brna)
void RNA_def_cachefile(BlenderRNA *brna)
void RNA_def_camera(BlenderRNA *brna)
void RNA_def_cloth(BlenderRNA *brna)
void RNA_def_collections(BlenderRNA *brna)
void RNA_def_color(BlenderRNA *brna)
void RNA_def_constraint(BlenderRNA *brna)
void RNA_def_context(BlenderRNA *brna)
void RNA_def_curve(BlenderRNA *brna)
void RNA_def_profile(BlenderRNA *brna)
StructDefRNA * rna_find_struct_def(StructRNA *srna)
PropertyDefRNA * rna_find_struct_property_def(StructRNA *srna, PropertyRNA *prop)
void RNA_free(BlenderRNA *brna)
int rna_parameter_size(PropertyRNA *parm)
void RNA_define_free(BlenderRNA *UNUSED(brna))
FunctionDefRNA * rna_find_function_def(FunctionRNA *func)
PropertyDefRNA * rna_find_parameter_def(PropertyRNA *parm)
BlenderRNA * RNA_create(void)
const char * RNA_property_typename(PropertyType type)
void rna_addtail(ListBase *listbase, void *vlink)
void RNA_def_depsgraph(BlenderRNA *brna)
void RNA_def_dynamic_paint(BlenderRNA *brna)
void RNA_def_fcurve(BlenderRNA *brna)
void RNA_def_fluid(BlenderRNA *brna)
void RNA_def_gpencil(BlenderRNA *brna)
void RNA_def_greasepencil_modifier(BlenderRNA *brna)
void RNA_def_hair(BlenderRNA *brna)
void RNA_def_image(BlenderRNA *brna)
void RNA_def_lattice(struct BlenderRNA *brna)
void RNA_def_linestyle(struct BlenderRNA *brna)
void RNA_def_texture(struct BlenderRNA *brna)
void RNA_def_meta(struct BlenderRNA *brna)
void RNA_def_sequencer(struct BlenderRNA *brna)
void RNA_def_rna(struct BlenderRNA *brna)
void RNA_def_movieclip(struct BlenderRNA *brna)
void RNA_def_text(struct BlenderRNA *brna)
void RNA_def_particle(struct BlenderRNA *brna)
void RNA_def_render(struct BlenderRNA *brna)
void RNA_def_wm(struct BlenderRNA *brna)
void RNA_def_palette(struct BlenderRNA *brna)
void RNA_def_volume(struct BlenderRNA *brna)
void RNA_def_test(struct BlenderRNA *brna)
void RNA_def_shader_fx(struct BlenderRNA *brna)
void RNA_def_tracking(struct BlenderRNA *brna)
void RNA_def_nla(struct BlenderRNA *brna)
void RNA_def_rigidbody(struct BlenderRNA *brna)
void RNA_def_xr(struct BlenderRNA *brna)
void RNA_def_sound(struct BlenderRNA *brna)
void RNA_def_ui(struct BlenderRNA *brna)
void RNA_def_material(struct BlenderRNA *brna)
void RNA_def_key(struct BlenderRNA *brna)
void RNA_def_space(struct BlenderRNA *brna)
void RNA_def_view_layer(struct BlenderRNA *brna)
void RNA_def_mask(struct BlenderRNA *brna)
void RNA_def_mesh(struct BlenderRNA *brna)
void RNA_def_light(struct BlenderRNA *brna)
void RNA_def_pose(struct BlenderRNA *brna)
void RNA_def_world(struct BlenderRNA *brna)
void RNA_def_sculpt_paint(struct BlenderRNA *brna)
void RNA_def_timeline_marker(struct BlenderRNA *brna)
void RNA_def_object(struct BlenderRNA *brna)
void RNA_def_nodetree(struct BlenderRNA *brna)
void RNA_def_lightprobe(struct BlenderRNA *brna)
void RNA_def_userdef(struct BlenderRNA *brna)
void RNA_def_object_force(struct BlenderRNA *brna)
void RNA_def_simulation(struct BlenderRNA *brna)
void RNA_def_scene(struct BlenderRNA *brna)
void RNA_def_vfont(struct BlenderRNA *brna)
void RNA_def_wm_gizmo(struct BlenderRNA *brna)
void RNA_def_screen(struct BlenderRNA *brna)
void RNA_def_modifier(struct BlenderRNA *brna)
void RNA_def_pointcloud(struct BlenderRNA *brna)
void RNA_def_packedfile(struct BlenderRNA *brna)
void RNA_def_speaker(struct BlenderRNA *brna)
void RNA_def_workspace(struct BlenderRNA *brna)
void RNA_def_main(struct BlenderRNA *brna)
@ PROP_INTERN_PTR_OWNERSHIP_FORCED
const EnumPropertyItem DummyRNA_NULL_items[]
PropBooleanArraySetFuncEx setarray_ex
PropBooleanArrayGetFuncEx getarray_ex
PropBooleanArraySetFunc setarray
const bool * defaultarray
PropBooleanSetFuncEx set_ex
PropBooleanGetFuncEx get_ex
PropBooleanArrayGetFunc getarray
PropCollectionNextFunc next
PropCollectionLookupStringFunc lookupstring
PropCollectionLengthFunc length
struct StructRNA * item_type
PropCollectionLookupIntFunc lookupint
PropCollectionBeginFunc begin
PropCollectionAssignIntFunc assignint
PropCollectionEndFunc end
PropCollectionGetFunc get
const EnumPropertyItem * item
const char * native_enum_type
PropFloatSetFuncEx set_ex
PropFloatRangeFuncEx range_ex
PropFloatArrayGetFuncEx getarray_ex
PropFloatArraySetFuncEx setarray_ex
PropFloatArrayGetFunc getarray
const float * defaultarray
PropFloatArraySetFunc setarray
PropFloatGetFuncEx get_ex
PropIntRangeFuncEx range_ex
PropIntArrayGetFunc getarray
PropIntArrayGetFuncEx getarray_ex
PropIntArraySetFunc setarray
PropIntArraySetFuncEx setarray_ex
PropPointerTypeFunc type_fn
const char * dnastructfromprop
const char * dnastructname
struct PropertyDefRNA * next
const char * dnalengthname
struct PropertyRNA * prop
const char * dnastructfromname
ItemEditableFunc itemeditable
PropArrayLengthGetFunc getlength
const char * translation_context
RNAPropOverrideApply override_apply
unsigned int arraydimension
struct PropertyRNA * next
RNAPropOverrideStore override_store
RNAPropOverrideDiff override_diff
struct PropertyRNA * prev
unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]
unsigned int totarraylength
void(* define)(BlenderRNA *brna)
const char * api_filename
const char * defaultvalue
PropStringLengthFuncEx length_ex
PropStringLengthFunc length
PropStringGetFuncEx get_ex
PropStringSetFuncEx set_ex
StructUnregisterFunc unreg
StructInstanceFunc instance
struct StructRNA * nested
const char * translation_context
PropertyRNA * nameproperty
IDPropertiesFunc idproperties
PropertyRNA * iteratorproperty
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)