46 {0,
"DEFAULT", 0,
"Default",
""},
61 {
PROP_ENUM,
"ENUM", 0,
"Enumeration",
""},
76 {
PROP_PASSWORD,
"PASSWORD", 0,
"Password",
"A string that is displayed hidden ('********')"},
137 static CLG_LogRef LOG_COMPARE_OVERRIDE = {
"rna.rna_compare_override"};
141 static void rna_Struct_identifier_get(
PointerRNA *
ptr,
char *value)
151 static void rna_Struct_description_get(
PointerRNA *
ptr,
char *value)
161 static void rna_Struct_name_get(
PointerRNA *
ptr,
char *value)
171 static void rna_Struct_translation_context_get(
PointerRNA *
ptr,
char *value)
176 static int rna_Struct_translation_context_length(
PointerRNA *
ptr)
215 }
while ((ptype = ptype->
base));
249 for (i = iter->
level; i > 0; i--) {
269 rna_inheritance_next_level_restart(iter, skip, 0);
276 rna_inheritance_next_level_restart(iter, skip, 0);
284 rna_inheritance_next_level_restart(iter, skip, 1);
291 rna_inheritance_next_level_restart(iter, skip, 1);
299 if (internal->flag) {
305 rna_inheritance_properties_listbase_next(iter, rna_property_builtin);
333 rna_inheritance_properties_listbase_begin(iter, &srna->
cont.
properties, rna_property_builtin);
347 rna_inheritance_functions_listbase_next(iter, rna_function_builtin);
362 rna_inheritance_functions_listbase_begin(iter, &srna->
functions, rna_function_builtin);
407 rna_Struct_properties_begin(iter, &newptr);
412 rna_Struct_properties_next(iter);
417 return rna_Struct_properties_get(iter);
451 }
while ((srna = srna->
base));
509 static void rna_Property_identifier_get(
PointerRNA *
ptr,
char *value)
521 static void rna_Property_name_get(
PointerRNA *
ptr,
char *value)
525 strcpy(value, name ? name :
"");
532 return name ? strlen(name) : 0;
535 static void rna_Property_description_get(
PointerRNA *
ptr,
char *value)
539 strcpy(value, description ? description :
"");
545 return description ? strlen(description) : 0;
548 static void rna_Property_translation_context_get(
PointerRNA *
ptr,
char *value)
554 static int rna_Property_translation_context_length(
PointerRNA *
ptr)
631 static bool rna_Property_is_argument_optional_get(
PointerRNA *
ptr)
661 static bool rna_Property_is_library_editable_flag_get(
PointerRNA *
ptr)
684 struct_tags !=
NULL && struct_tags->identifier !=
NULL;
686 memcpy(&tmp, struct_tags,
sizeof(tmp));
702 static void rna_Property_array_dimensions_get(
PointerRNA *
ptr,
725 static bool rna_Property_is_registered_optional_get(
PointerRNA *
ptr)
751 static int rna_NumberProperty_default_array_get_length(
PointerRNA *
ptr,
768 static void rna_IntProperty_default_array_get(
PointerRNA *
ptr,
int *values)
778 static void rna_BoolProperty_default_array_get(
PointerRNA *
ptr,
bool *values)
788 static void rna_FloatProperty_default_array_get(
PointerRNA *
ptr,
float *values)
881 static void rna_StringProperty_default_get(
PointerRNA *
ptr,
char *value)
887 static int rna_StringProperty_default_length(
PointerRNA *
ptr)
894 static int rna_StringProperty_max_length_get(
PointerRNA *
ptr)
917 if ((eprop->item_fn ==
NULL) || (eprop->item_fn == rna_EnumProperty_default_itemf) ||
924 return eprop->item_fn(
C,
ptr, prop, r_free);
959 static void rna_EnumPropertyItem_identifier_get(
PointerRNA *
ptr,
char *value)
964 static int rna_EnumPropertyItem_identifier_length(
PointerRNA *
ptr)
969 static void rna_EnumPropertyItem_name_get(
PointerRNA *
ptr,
char *value)
979 static void rna_EnumPropertyItem_description_get(
PointerRNA *
ptr,
char *value)
991 static int rna_EnumPropertyItem_description_length(
PointerRNA *
ptr)
1029 static void rna_Function_identifier_get(
PointerRNA *
ptr,
char *value)
1039 static void rna_Function_description_get(
PointerRNA *
ptr,
char *value)
1061 static bool rna_Function_registered_optional_get(
PointerRNA *
ptr)
1113 static int rna_BlenderRNA_structs_lookup_string(
PointerRNA *
ptr,
1131 static bool rna_property_override_diff_propptr_validate_diffing(
PointerRNA *propptr_a,
1133 const bool no_ownership,
1134 const bool no_prop_name,
1137 bool *r_is_type_diff,
1138 char **r_propname_a,
1139 char *propname_a_buff,
1140 size_t propname_a_buff_size,
1141 char **r_propname_b,
1142 char *propname_b_buff,
1143 size_t propname_b_buff_size)
1147 bool is_valid_for_diffing =
true;
1148 const bool do_force_name = !no_prop_name && r_propname_a !=
NULL;
1150 if (do_force_name) {
1155 *r_is_id = *r_is_null = *r_is_type_diff =
false;
1165 *r_is_type_diff = propptr_a->
type != propptr_b->
type;
1167 is_valid_for_diffing =
false;
1172 *r_is_type_diff = (propptr_b ==
NULL || propptr_b->
type != propptr_a->
type);
1173 is_valid_for_diffing = !((*r_is_id && no_ownership) || *r_is_null);
1176 if (propptr_b ==
NULL || propptr_a->
type != propptr_b->
type) {
1177 *r_is_type_diff =
true;
1178 is_valid_for_diffing =
false;
1186 if (!no_prop_name && (is_valid_for_diffing || do_force_name)) {
1194 int propname_a_len = 0, propname_b_len = 0;
1195 char *propname_a =
NULL;
1196 char *propname_b =
NULL;
1199 if (nameprop_a !=
NULL) {
1200 if (r_propname_a ==
NULL && propname_a_buff ==
NULL) {
1201 propname_a_buff = buff_a;
1202 propname_a_buff_size =
sizeof(buff_a);
1206 propptr_a, nameprop_a, propname_a_buff, propname_a_buff_size, &propname_a_len);
1209 if (r_propname_a !=
NULL) {
1210 *r_propname_a = propname_a;
1214 if (nameprop_b !=
NULL) {
1215 if (r_propname_b ==
NULL && propname_b_buff ==
NULL) {
1216 propname_b_buff = buff_b;
1217 propname_b_buff_size =
sizeof(buff_b);
1221 propptr_b, nameprop_b, propname_b_buff, propname_b_buff_size, &propname_b_len);
1223 if (r_propname_b !=
NULL) {
1224 *r_propname_b = propname_b;
1227 if (propname_a !=
NULL && propname_b !=
NULL) {
1228 if (propname_a_len != propname_b_len || propname_a[0] != propname_b[0] ||
1229 !
STREQ(propname_a, propname_b)) {
1230 is_valid_for_diffing =
false;
1240 return is_valid_for_diffing;
1244 static int rna_property_override_diff_propptr(
Main *bmain,
1250 const bool no_ownership,
1251 const bool no_prop_name,
1253 const char *rna_path,
1254 size_t rna_path_len,
1255 const uint property_type,
1256 const char *rna_itemname_a,
1257 const char *rna_itemname_b,
1258 const int rna_itemindex_a,
1259 const int rna_itemindex_b,
1261 bool *r_override_changed)
1269 bool is_null =
false;
1270 bool is_type_diff =
false;
1273 bool is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing(propptr_a,
1303 if (no_ownership || is_null || is_type_diff || !is_valid_for_diffing) {
1307 const int comp = (propptr_a->
data != propptr_b->
data);
1309 if (do_create && comp != 0) {
1310 bool created =
false;
1312 override, rna_path, &created);
1324 if (created || rna_itemname_a !=
NULL || rna_itemname_b !=
NULL ||
1325 rna_itemindex_a != -1 || rna_itemindex_b != -1) {
1339 if (r_override_changed) {
1340 *r_override_changed = created;
1347 if (is_id && no_ownership) {
1361 ID *id_a = propptr_a->
data;
1362 ID *id_b = propptr_b->
data;
1375 "Not checking matching ID pointer properties, since owner %s is tagged as "
1376 "needing resync.\n",
1397 # define RNA_PATH_BUFFSIZE 8192
1400 char *extended_rna_path = extended_rna_path_buffer;
1401 size_t extended_rna_path_len = 0;
1407 if ((rna_itemname_a !=
NULL && rna_itemname_a[0] !=
'\0') &&
1408 (rna_itemname_b !=
NULL && rna_itemname_b[0] !=
'\0')) {
1414 extended_rna_path_len = rna_path_len + 2 + esc_item_name_len + 2;
1416 extended_rna_path =
MEM_mallocN(extended_rna_path_len + 1, __func__);
1419 memcpy(extended_rna_path, rna_path, rna_path_len);
1420 extended_rna_path[rna_path_len] =
'[';
1421 extended_rna_path[rna_path_len + 1] =
'"';
1422 memcpy(extended_rna_path + rna_path_len + 2, esc_item_name, esc_item_name_len);
1423 extended_rna_path[rna_path_len + 2 + esc_item_name_len] =
'"';
1424 extended_rna_path[rna_path_len + 2 + esc_item_name_len + 1] =
']';
1425 extended_rna_path[extended_rna_path_len] =
'\0';
1427 else if (rna_itemindex_a != -1) {
1428 BLI_assert(rna_itemindex_a == rna_itemindex_b);
1431 char item_index_buff[32];
1432 size_t item_index_buff_len = 0;
1433 if (rna_itemindex_a == 0) {
1434 item_index_buff[0] =
'0';
1435 item_index_buff_len = 1;
1439 for (index = rna_itemindex_a;
1440 index > 0 && item_index_buff_len <
sizeof(item_index_buff);
1442 item_index_buff[item_index_buff_len++] =
'0' + (char)(index % 10);
1447 extended_rna_path_len = rna_path_len + item_index_buff_len + 2;
1449 extended_rna_path =
MEM_mallocN(extended_rna_path_len + 1, __func__);
1452 memcpy(extended_rna_path, rna_path, rna_path_len);
1453 extended_rna_path[rna_path_len] =
'[';
1454 for (
size_t i = 1; i <= item_index_buff_len; i++) {
1457 extended_rna_path[rna_path_len + i] = item_index_buff[item_index_buff_len - i];
1459 extended_rna_path[rna_path_len + 1 + item_index_buff_len] =
']';
1460 extended_rna_path[extended_rna_path_len] =
'\0';
1463 extended_rna_path = (
char *)rna_path;
1464 extended_rna_path_len = rna_path_len;
1473 extended_rna_path_len,
1478 *r_override_changed =
true;
1481 if (extended_rna_path != extended_rna_path_buffer && extended_rna_path != rna_path) {
1485 # undef RNA_PATH_BUFFSIZE
1497 # define RNA_PROPERTY_GET_SINGLE(_typename, _ptr, _prop, _index) \
1498 (is_array ? RNA_property_##_typename##_get_index((_ptr), (_prop), (_index)) : \
1499 RNA_property_##_typename##_get((_ptr), (_prop)))
1500 # define RNA_PROPERTY_SET_SINGLE(_typename, _ptr, _prop, _index, _value) \
1501 (is_array ? RNA_property_##_typename##_set_index((_ptr), (_prop), (_index), (_value)) : \
1502 RNA_property_##_typename##_set((_ptr), (_prop), (_value)))
1509 const char *rna_path,
1510 const size_t rna_path_len,
1512 bool *r_override_changed)
1538 bool created =
false;
1541 switch (rna_prop_type) {
1545 bool *array_a, *array_b;
1555 const int comp = memcmp(array_a, array_b,
sizeof(
bool) * len_a);
1557 if (do_create && comp != 0) {
1561 if (op !=
NULL && created) {
1564 if (r_override_changed) {
1565 *r_override_changed = created;
1573 if (array_a != array_stack_a) {
1576 if (array_b != array_stack_b) {
1585 const int comp = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
1587 if (do_create && comp != 0) {
1590 if (op !=
NULL && created) {
1593 if (r_override_changed) {
1594 *r_override_changed = created;
1606 int *array_a, *array_b;
1616 const int comp = memcmp(array_a, array_b,
sizeof(
int) * len_a);
1618 if (do_create && comp != 0) {
1622 if (op !=
NULL && created) {
1625 if (r_override_changed) {
1626 *r_override_changed = created;
1634 if (array_a != array_stack_a) {
1637 if (array_b != array_stack_b) {
1646 const int comp = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
1648 if (do_create && comp != 0) {
1651 if (op !=
NULL && created) {
1654 if (r_override_changed) {
1655 *r_override_changed = created;
1667 float *array_a, *array_b;
1677 const int comp = memcmp(array_a, array_b,
sizeof(
float) * len_a);
1679 if (do_create && comp != 0) {
1683 if (op !=
NULL && created) {
1686 if (r_override_changed) {
1687 *r_override_changed = created;
1695 if (array_a != array_stack_a) {
1698 if (array_b != array_stack_b) {
1707 const int comp = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
1709 if (do_create && comp != 0) {
1712 if (op !=
NULL && created) {
1715 if (r_override_changed) {
1716 *r_override_changed = created;
1728 const int comp = value_a != value_b;
1730 if (do_create && comp != 0) {
1733 if (op !=
NULL && created) {
1736 if (r_override_changed) {
1737 *r_override_changed = created;
1746 char fixed_a[4096], fixed_b[4096];
1747 int len_str_a, len_str_b;
1749 ptr_a, rawprop_a, fixed_a,
sizeof(fixed_a), &len_str_a);
1751 ptr_b, rawprop_b, fixed_b,
sizeof(fixed_b), &len_str_b);
1756 const int comp = len_str_a < len_str_b ?
1758 len_str_a > len_str_b ? 1 : strcmp(value_a, value_b);
1760 const int comp = strcmp(value_a, value_b);
1762 if (do_create && comp != 0) {
1765 if (op !=
NULL && created) {
1768 if (r_override_changed) {
1769 *r_override_changed = created;
1774 if (value_a != fixed_a) {
1777 if (value_b != fixed_b) {
1789 const bool no_prop_name =
true;
1797 return rna_property_override_diff_propptr(bmain,
1814 r_override_changed);
1832 char buff_prev_a[4096] = {0};
1834 char *propname_a =
NULL;
1835 char *prev_propname_a = buff_prev_a;
1836 char *propname_b =
NULL;
1838 if (use_collection_insertion) {
1854 for (; iter_a.
valid && !abort;) {
1855 bool is_valid_for_diffing;
1856 bool is_valid_for_insertion;
1858 bool is_id =
false, is_null =
false, is_type_diff =
false;
1860 is_valid_for_insertion = use_collection_insertion;
1865 is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing(
1881 is_valid_for_diffing =
false;
1882 if (is_valid_for_insertion) {
1884 rna_property_override_diff_propptr_validate_diffing(&iter_a.
ptr,
1901 if (is_id || is_valid_for_diffing) {
1902 is_valid_for_insertion =
false;
1908 "Checking %s, %s [%d] vs %s [%d]; is_id: %d, diffing: %d; "
1909 "insert: %d (could be used: %d, do_create: %d)\n",
1911 propname_a ? propname_a :
"",
1913 propname_b ? propname_b :
"",
1916 is_valid_for_diffing,
1917 is_valid_for_insertion,
1918 use_collection_insertion,
1923 if (!(is_id || is_valid_for_diffing || is_valid_for_insertion)) {
1933 if (is_valid_for_insertion && use_collection_insertion) {
1939 no_prop_name ?
NULL : prev_propname_a,
1946 printf(
"%s: Adding insertion op override after '%s'/%d\n",
1955 else if (is_id || is_valid_for_diffing) {
1956 if (equals || do_create) {
1957 const int eq = rna_property_override_diff_propptr(bmain,
1974 r_override_changed);
1975 equals = equals && eq;
1979 if (prev_propname_a != buff_prev_a) {
1981 prev_propname_a = buff_prev_a;
1983 prev_propname_a[0] =
'\0';
1984 if (propname_a !=
NULL &&
1986 sizeof(buff_prev_a) - 1) {
1989 if (propname_a != buff_a) {
1991 propname_a = buff_a;
1993 propname_a[0] =
'\0';
1994 if (propname_b != buff_b) {
1996 propname_b = buff_b;
1998 propname_b[0] =
'\0';
2000 if (!do_create && !equals) {
2005 if (!(use_collection_insertion && !(is_id || is_valid_for_diffing))) {
2013 }
while (iter_a.
valid);
2026 equals = equals && !(iter_a.
valid || iter_b.
valid) && !abort;
2030 return (equals ==
false);
2056 const int len_local,
2057 const int len_reference,
2058 const int len_storage,
2061 BLI_assert(len_local == len_reference && (!ptr_storage || len_local == len_storage));
2064 bool changed =
false;
2065 const bool is_array = len_local > 0;
2085 BLI_assert(0 &&
"Boolean properties support no override diff operation");
2088 int prop_min, prop_max;
2091 if (is_array && index == -1) {
2093 int *array_a, *array_b;
2096 MEM_mallocN(
sizeof(*array_a) * len_local, __func__) :
2109 MEM_mallocN(
sizeof(*array_b) * len_local, __func__) :
2112 for (
int i = len_local; i--;) {
2113 array_b[i] = fac * (array_b[i] - array_a[i]);
2114 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2116 for (
int j = len_local; j--;) {
2117 array_b[j] = j >= i ? -array_b[j] : fac * (array_a[j] - array_b[j]);
2118 if (array_b[j] < prop_min || array_b[j] > prop_max) {
2133 if (array_b != array_stack_b) {
2139 BLI_assert(0 &&
"Unsupported RNA override diff operation on integer");
2143 if (array_a != array_stack_a) {
2148 const int value = RNA_PROPERTY_GET_SINGLE(
int, ptr_reference, prop_reference, index);
2157 int b = fac * (RNA_PROPERTY_GET_SINGLE(
int, ptr_local, prop_local, index) - value);
2158 if (b < prop_min || b > prop_max) {
2161 if (b < prop_min || b > prop_max) {
2167 RNA_PROPERTY_SET_SINGLE(
int, ptr_storage, prop_storage, index, b);
2171 BLI_assert(0 &&
"Unsupported RNA override diff operation on integer");
2178 float prop_min, prop_max;
2181 if (is_array && index == -1) {
2183 float *array_a, *array_b;
2186 MEM_mallocN(
sizeof(*array_a) * len_local, __func__) :
2199 MEM_mallocN(
sizeof(*array_b) * len_local, __func__) :
2202 for (
int i = len_local; i--;) {
2203 array_b[i] = fac * (array_b[i] - array_a[i]);
2204 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2206 for (
int j = len_local; j--;) {
2207 array_b[j] = j >= i ? -array_b[j] : fac * (array_a[j] - array_b[j]);
2208 if (array_b[j] < prop_min || array_b[j] > prop_max) {
2223 if (array_b != array_stack_b) {
2231 MEM_mallocN(
sizeof(*array_b) * len_local, __func__) :
2234 for (
int i = len_local; i--;) {
2235 array_b[i] = array_a[i] == 0.0f ? array_b[i] : array_b[i] / array_a[i];
2236 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2246 if (array_b != array_stack_b) {
2252 BLI_assert(0 &&
"Unsupported RNA override diff operation on float");
2256 if (array_a != array_stack_a) {
2261 const float value = RNA_PROPERTY_GET_SINGLE(
float, ptr_reference, prop_reference, index);
2270 float b = fac * (RNA_PROPERTY_GET_SINGLE(
float, ptr_local, prop_local, index) - value);
2271 if (b < prop_min || b > prop_max) {
2274 if (b < prop_min || b > prop_max) {
2280 RNA_PROPERTY_SET_SINGLE(
float, ptr_storage, prop_storage, index, b);
2285 (value == 0.0f ? 1.0f : value);
2286 if (b < prop_min || b > prop_max) {
2295 BLI_assert(0 &&
"Unsupported RNA override diff operation on float");
2303 BLI_assert(0 &&
"Enum properties support no override diff operation");
2306 BLI_assert(0 &&
"Pointer properties support no override diff operation");
2309 BLI_assert(0 &&
"String properties support no override diff operation");
2313 BLI_assert(0 &&
"Collection properties support no override diff operation");
2331 const int len_storage,
2337 BLI_assert(len_dst == len_src && (!ptr_storage || len_dst == len_storage));
2340 const bool is_array = len_dst > 0;
2342 const short override_op = opop->
operation;
2346 if (is_array && index == -1) {
2355 switch (override_op) {
2360 BLI_assert(0 &&
"Unsupported RNA override operation on boolean");
2364 if (array_a != array_stack_a) {
2369 const bool value = RNA_PROPERTY_GET_SINGLE(
boolean, ptr_src, prop_src, index);
2371 switch (override_op) {
2373 RNA_PROPERTY_SET_SINGLE(
boolean, ptr_dst, prop_dst, index, value);
2376 BLI_assert(0 &&
"Unsupported RNA override operation on boolean");
2382 if (is_array && index == -1) {
2384 int *array_a, *array_b;
2389 switch (override_op) {
2398 MEM_mallocN(
sizeof(*array_b) * len_dst, __func__) :
2402 for (
int i = len_dst; i--;) {
2403 array_a[i] += array_b[i];
2407 for (
int i = len_dst; i--;) {
2408 array_a[i] -= array_b[i];
2412 if (array_b != array_stack_b) {
2417 BLI_assert(0 &&
"Unsupported RNA override operation on integer");
2421 if (array_a != array_stack_a) {
2426 const int storage_value = ptr_storage ? RNA_PROPERTY_GET_SINGLE(
2427 int, ptr_storage, prop_storage, index) :
2430 switch (override_op) {
2432 RNA_PROPERTY_SET_SINGLE(
int,
2436 RNA_PROPERTY_GET_SINGLE(
int, ptr_src, prop_src, index));
2439 RNA_PROPERTY_SET_SINGLE(
int,
2443 RNA_PROPERTY_GET_SINGLE(
int, ptr_dst, prop_dst, index) -
2447 RNA_PROPERTY_SET_SINGLE(
int,
2451 RNA_PROPERTY_GET_SINGLE(
int, ptr_dst, prop_dst, index) -
2455 BLI_assert(0 &&
"Unsupported RNA override operation on integer");
2461 if (is_array && index == -1) {
2463 float *array_a, *array_b;
2468 switch (override_op) {
2478 MEM_mallocN(
sizeof(*array_b) * len_dst, __func__) :
2482 for (
int i = len_dst; i--;) {
2483 array_a[i] += array_b[i];
2487 for (
int i = len_dst; i--;) {
2488 array_a[i] -= array_b[i];
2492 for (
int i = len_dst; i--;) {
2493 array_a[i] *= array_b[i];
2497 if (array_b != array_stack_b) {
2502 BLI_assert(0 &&
"Unsupported RNA override operation on float");
2506 if (array_a != array_stack_a) {
2511 const float storage_value = ptr_storage ? RNA_PROPERTY_GET_SINGLE(
2512 float, ptr_storage, prop_storage, index) :
2515 switch (override_op) {
2517 RNA_PROPERTY_SET_SINGLE(
float,
2521 RNA_PROPERTY_GET_SINGLE(
float, ptr_src, prop_src, index));
2524 RNA_PROPERTY_SET_SINGLE(
float,
2528 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst, index) +
2532 RNA_PROPERTY_SET_SINGLE(
float,
2536 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst, index) -
2540 RNA_PROPERTY_SET_SINGLE(
float,
2544 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst, index) *
2548 BLI_assert(0 &&
"Unsupported RNA override operation on float");
2556 switch (override_op) {
2562 BLI_assert(0 &&
"Unsupported RNA override operation on enum");
2570 switch (override_op) {
2575 BLI_assert(0 &&
"Unsupported RNA override operation on pointer");
2584 switch (override_op) {
2589 BLI_assert(0 &&
"Unsupported RNA override operation on string");
2593 if (value != buff) {
2604 if (!(is_src_idprop && is_dst_idprop)) {
2605 BLI_assert(0 &&
"You need to define a specific override apply callback for collections");
2609 switch (override_op) {
2611 PointerRNA item_ptr_src, item_ptr_ref, item_ptr_dst;
2616 int item_index_src, item_index_ref;
2620 ptr_src, prop_src, item_index_src + 1, &item_ptr_src) &&
2624 item_index_dst = item_index_ref + 1;
2664 BLI_assert(0 &&
"Unsupported RNA override operation on collection");
2676 # undef RNA_PROPERTY_GET_SINGLE
2677 # undef RNA_PROPERTY_SET_SINGLE
2698 prop,
"rna_Struct_identifier_get",
"rna_Struct_identifier_length",
NULL);
2705 prop,
"rna_Struct_description_get",
"rna_Struct_description_length",
NULL);
2711 prop,
"rna_Struct_translation_context_get",
"rna_Struct_translation_context_length",
NULL);
2713 prop,
"Translation Context",
"Translation context of the struct's name");
2728 "Struct in which this struct is always nested, and to which it logically belongs");
2740 "rna_Struct_properties_begin",
2741 "rna_Struct_properties_next",
2742 "rna_iterator_listbase_end",
2743 "rna_Struct_properties_get",
2754 "rna_Struct_functions_begin",
2755 "rna_Struct_functions_next",
2756 "rna_iterator_listbase_end",
2757 "rna_Struct_functions_get",
2768 "rna_Struct_property_tags_begin",
2769 "rna_iterator_array_next",
2770 "rna_iterator_array_end",
2771 "rna_iterator_array_get",
2777 prop,
"Property Tags",
"Tags that properties can use to influence behavior");
2801 prop,
"rna_Property_identifier_get",
"rna_Property_identifier_length",
NULL);
2808 prop,
"rna_Property_description_get",
"rna_Property_description_length",
NULL);
2814 "rna_Property_translation_context_get",
2815 "rna_Property_translation_context_length",
2818 prop,
"Translation Context",
"Translation context of the property's name");
2837 prop,
"Base",
"Struct definition used for properties assigned to this item");
2870 prop,
"Required",
"False when this property is an optional argument in an RNA function");
2877 "Optional Argument",
2878 "True when the property is optional in a Python function implementing an RNA function");
2899 prop,
"Return",
"True when this property is an output value from an RNA function");
2905 prop,
"Registered",
"Property is registered as part of type registration");
2911 "Registered Optionally",
2912 "Property is optionally registered as part of type registration");
2928 prop,
"Library Editable",
"Property is editable from linked instances (changes not saved)");
2936 prop,
"Tags",
"Subset of tags (defined in parent struct) that are set for this property");
2951 prop,
"rna_Function_identifier_get",
"rna_Function_identifier_length",
NULL);
2958 prop,
"rna_Function_description_get",
"rna_Function_description_length",
NULL);
2965 "rna_Function_parameters_begin",
2966 "rna_iterator_listbase_next",
2967 "rna_iterator_listbase_end",
2968 "rna_iterator_listbase_get",
2979 prop,
"Registered",
"Function is registered as callback as part of type registration");
2986 "Registered Optionally",
2987 "Function is optionally registered as callback part of type registration");
2995 "Function does not pass its self as an argument (becomes a static method in python)");
3002 "Function passes its self type as an argument (becomes a class method "
3003 "in python if use_self is false)");
3036 prop,
"rna_NumberProperty_default_array_get_length");
3122 prop,
"Step",
"Step size used by number buttons, for floats 1/100th of the step size");
3139 prop,
"rna_StringProperty_default_get",
"rna_StringProperty_default_length",
NULL);
3146 prop,
"Maximum Length",
"Maximum length of the string, 0 means unlimited");
3163 prop,
"rna_EnumProperty_default_get",
NULL,
"rna_EnumProperty_default_itemf");
3172 prop,
"rna_EnumProperty_default_get",
NULL,
"rna_EnumProperty_default_itemf");
3179 "rna_EnumProperty_items_begin",
3180 "rna_iterator_array_next",
3181 "rna_iterator_array_end",
3182 "rna_iterator_array_get",
3193 "rna_EnumProperty_items_begin",
3194 "rna_iterator_array_next",
3195 "rna_iterator_array_end",
3196 "rna_iterator_array_get",
3204 "Possible values for the property (never calls optional dynamic generation of those)");
3208 srna,
"Enum Item Definition",
"Definition of a choice in an RNA enum property");
3214 prop,
"rna_EnumPropertyItem_name_get",
"rna_EnumPropertyItem_name_length",
NULL);
3220 "rna_EnumPropertyItem_description_get",
3221 "rna_EnumPropertyItem_description_length",
3228 prop,
"rna_EnumPropertyItem_identifier_get",
"rna_EnumPropertyItem_identifier_length",
NULL);
3256 prop,
"rna_CollectionProperty_fixed_type_get",
NULL,
NULL,
NULL);
3286 "RNA floating-point number (single precision) property definition");
3299 "RNA enumeration property definition, to choose from a number of predefined options");
3305 srna,
"Pointer Definition",
"RNA pointer property to point to another RNA struct");
3311 "Collection Definition",
3312 "RNA collection property to define lists, arrays and mappings");
3327 "rna_BlenderRNA_structs_begin",
3328 "rna_iterator_listbase_next",
3329 "rna_iterator_listbase_end",
3330 "rna_iterator_listbase_get",
3338 "rna_BlenderRNA_structs_length",
3339 "rna_BlenderRNA_structs_lookup_int",
3340 "rna_BlenderRNA_structs_lookup_string",
void IDP_CopyPropertyContent(struct IDProperty *dst, struct IDProperty *src) ATTR_NONNULL()
struct IDOverrideLibraryProperty * BKE_lib_override_library_property_get(struct IDOverrideLibrary *override, const char *rna_path, bool *r_created)
struct IDOverrideLibraryProperty * BKE_lib_override_library_property_find(struct IDOverrideLibrary *override, const char *rna_path)
struct IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_get(struct IDOverrideLibraryProperty *override_property, const short operation, const char *subitem_refname, const char *subitem_locname, const int subitem_refindex, const int subitem_locindex, const bool strict, bool *r_strict, bool *r_created)
struct IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_find(struct IDOverrideLibraryProperty *override_property, const char *subitem_refname, const char *subitem_locname, const int subitem_refindex, const int subitem_locindex, const bool strict, bool *r_strict)
void BKE_lib_override_library_operations_tag(struct IDOverrideLibraryProperty *override_property, const short tag, const bool do_set)
void BKE_lib_override_library_property_operation_delete(struct IDOverrideLibraryProperty *override_property, struct IDOverrideLibraryPropertyOperation *override_property_operation)
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_kdtree_nd_() free(KDTree *tree)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
#define UNUSED_VARS_NDEBUG(...)
#define CLOG_INFO(clg_ref, level,...)
ID and Library types, which are fundamental for sdna.
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
@ LIB_TAG_LIB_OVERRIDE_NEED_RESYNC
@ IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE
@ IDOVERRIDE_LIBRARY_TAG_UNUSED
#define ID_IS_OVERRIDE_LIBRARY(_id)
@ IDP_FLAG_OVERRIDABLE_LIBRARY
@ IDOVERRIDE_LIBRARY_OP_MULTIPLY
@ IDOVERRIDE_LIBRARY_OP_INSERT_AFTER
@ IDOVERRIDE_LIBRARY_OP_SUBTRACT
@ IDOVERRIDE_LIBRARY_OP_ADD
@ IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE
@ IDOVERRIDE_LIBRARY_OP_REPLACE
_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.
StructRNA RNA_EnumProperty
StructRNA RNA_CollectionProperty
StructRNA RNA_BoolProperty
@ RNA_OVERRIDE_COMPARE_CREATE
StructRNA RNA_StringProperty
StructRNA RNA_IntProperty
@ RNA_OVERRIDE_MATCH_RESULT_CREATED
StructRNA RNA_FloatProperty
StructRNA RNA_PointerProperty
#define RNA_MAX_ARRAY_DIMENSION
@ STRUCT_PUBLIC_NAMESPACE
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_LIBRARY_INSERTION
@ PROPOVERRIDE_NO_PROP_NAME
int(* IteratorSkipFunc)(struct CollectionPropertyIterator *iter, void *data)
return(oflags[bm->toolflag_index].f &oflag) !=0
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_array_check(PropertyRNA *prop)
int RNA_property_collection_lookup_string_index(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr, int *r_index)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * rna_ensure_property(PropertyRNA *prop)
IDProperty * rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
bool RNA_struct_is_ID(const StructRNA *type)
const char * RNA_property_identifier(const PropertyRNA *prop)
const char * RNA_property_ui_description_raw(const PropertyRNA *prop)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
PropertyUnit RNA_property_unit(PropertyRNA *prop)
int RNA_property_ui_icon(const PropertyRNA *prop)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
void rna_iterator_listbase_end(CollectionPropertyIterator *UNUSED(iter))
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
PropertyType RNA_property_type(PropertyRNA *prop)
const PointerRNA PointerRNA_NULL
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
unsigned int RNA_enum_items_count(const EnumPropertyItem *item)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
IDProperty * RNA_struct_idprops(PointerRNA *ptr, bool create)
void RNA_property_collection_next(CollectionPropertyIterator *iter)
const char * RNA_property_translation_context(const PropertyRNA *prop)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
bool RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, int pos)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
int RNA_property_tags(PropertyRNA *prop)
void RNA_property_collection_end(CollectionPropertyIterator *iter)
void RNA_property_enum_items_ex(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const bool use_static, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_property_ui_name_raw(const PropertyRNA *prop)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode)
#define RNA_PATH_BUFFSIZE
bool RNA_struct_override_matches(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, const char *root_path, const size_t root_path_len, IDOverrideLibrary *override, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
PointerRNA rna_builtin_properties_get(struct CollectionPropertyIterator *iter)
void rna_builtin_properties_next(struct CollectionPropertyIterator *iter)
int rna_property_override_diff_default(struct Main *bmain, struct PropertyRNAOrID *prop_a, struct PropertyRNAOrID *prop_b, const int mode, struct IDOverrideLibrary *override, const char *rna_path, const size_t rna_path_len, const int flags, bool *r_override_changed)
bool rna_property_override_apply_default(struct Main *bmain, struct PointerRNA *ptr_dst, struct PointerRNA *ptr_src, struct PointerRNA *ptr_storage, struct PropertyRNA *prop_dst, struct PropertyRNA *prop_src, struct PropertyRNA *prop_storage, const int len_dst, const int len_src, const int len_storage, struct PointerRNA *ptr_item_dst, struct PointerRNA *ptr_item_src, struct PointerRNA *ptr_item_storage, struct IDOverrideLibraryPropertyOperation *opop)
void rna_builtin_properties_begin(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr)
bool rna_property_override_store_default(struct Main *bmain, struct PointerRNA *ptr_local, struct PointerRNA *ptr_reference, struct PointerRNA *ptr_storage, struct PropertyRNA *prop_local, struct PropertyRNA *prop_reference, struct PropertyRNA *prop_storage, const int len_local, const int len_reference, const int len_storage, struct IDOverrideLibraryPropertyOperation *opop)
PointerRNA rna_builtin_type_get(struct PointerRNA *ptr)
void RNA_def_rna(BlenderRNA *brna)
const EnumPropertyItem rna_enum_property_type_items[]
static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
const EnumPropertyItem DummyRNA_DEFAULT_items[]
static void rna_def_number_property(StructRNA *srna, PropertyType type)
static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
static void rna_def_property(BlenderRNA *brna)
const EnumPropertyItem rna_enum_property_unit_items[]
static void rna_def_string_property(StructRNA *srna)
static void rna_def_struct(BlenderRNA *brna)
const EnumPropertyItem rna_enum_property_subtype_items[]
static void rna_def_function(BlenderRNA *brna)
const EnumPropertyItem DummyRNA_NULL_items[]
const EnumPropertyItem rna_enum_icon_items[]
struct GHash * structs_map
union CollectionPropertyIterator::@1099 internal
PointerRNA builtin_parent
ListBaseIterator listbase
struct PropertyRNA * prop
int subitem_reference_index
char * subitem_local_name
unsigned int rna_prop_type
IDOverrideLibrary * override_library
unsigned int arraydimension
struct PropertyRNA * next
unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]
unsigned int totarraylength
struct StructRNA * nested
PropertyRNA * nameproperty