29 {0,
nullptr, 0,
nullptr,
nullptr},
35 {0,
"DEFAULT", 0,
"Default",
""},
36 {0,
nullptr, 0,
nullptr,
nullptr},
50 {
PROP_ENUM,
"ENUM", 0,
"Enumeration",
""},
53 {0,
nullptr, 0,
nullptr,
nullptr},
60#define RNA_ENUM_PROPERTY_SUBTYPE_STRING_ITEMS \
61 {PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""}, \
62 {PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""}, \
63 {PROP_FILENAME, "FILE_NAME", 0, "File Name", ""}, \
64 {PROP_BYTESTRING, "BYTE_STRING", 0, "Byte String", ""}, \
65 {PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"}
67#define RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ITEMS \
68 {PROP_PIXEL, "PIXEL", 0, "Pixel", "A distance on screen"}, \
69 {PROP_PIXEL_DIAMETER, "PIXEL_DIAMETER", 0, "Pixel", "A distance on screen, specifically representing a diameter value"}, \
70 {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, \
71 {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", "A percentage between 0 and 100"}, \
72 {PROP_FACTOR, "FACTOR", 0, "Factor", "A factor between 0.0 and 1.0"}, \
73 {PROP_MASS, "MASS", 0, "Mass", "A mass, based on scene unit settings"}, \
74 {PROP_ANGLE, "ANGLE", 0, "Angle", "A rotational value specified in radians"}, \
75 {PROP_TIME, "TIME", 0, "Time (Scene Relative)", \
76 "Time specified in frames, converted to seconds based on scene frame rate"}, \
77 {PROP_TIME_ABSOLUTE, "TIME_ABSOLUTE", 0, "Time (Absolute)", \
78 "Time specified in seconds, independent of the scene"}, \
79 {PROP_DISTANCE, "DISTANCE", 0, "Distance", "A distance between two points"}, \
80 {PROP_DISTANCE_DIAMETER, "DISTANCE_DIAMETER", 0, "Distance", "A distance between two points, specifically representing a diameter value"}, \
81 {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, \
82 {PROP_POWER, "POWER", 0, "Power", ""}, \
83 {PROP_TEMPERATURE, "TEMPERATURE", 0, "Temperature", ""}, \
84 {PROP_WAVELENGTH, "WAVELENGTH", 0, "Wavelength", ""}, \
85 {PROP_COLOR_TEMPERATURE, "COLOR_TEMPERATURE", 0, "Color Temperature", ""}, \
86 {PROP_FREQUENCY, "FREQUENCY", 0, "Frequency", ""}
88#define RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ARRAY_ITEMS \
89 {PROP_COLOR, "COLOR", 0, "Linear Color", "Color in the scene linear working color space"}, \
90 {PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, \
91 {PROP_DIRECTION, "DIRECTION", 0, "Direction", ""}, \
92 {PROP_VELOCITY, "VELOCITY", 0, "Velocity", ""}, \
93 {PROP_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, \
94 {PROP_MATRIX, "MATRIX", 0, "Matrix", ""}, \
95 {PROP_EULER, "EULER", 0, "Euler Angles", "Euler rotation angles in radians"}, \
96 {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", "Quaternion rotation (affects NLA blending)"}, \
97 {PROP_AXISANGLE, "AXISANGLE", 0, "Axis-Angle", "Angle and axis to rotate around"}, \
98 {PROP_XYZ, "XYZ", 0, "XYZ", ""}, \
99 {PROP_XYZ_LENGTH, "XYZ_LENGTH", 0, "XYZ Length", ""}, \
100 {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "sRGB Color", "Color in sRGB color space (mainly for user interface colors)"}, \
101 {PROP_COORDS, "COORDINATES", 0, "Coordinates", ""}, \
103 {PROP_LAYER, "LAYER", 0, "Layer", ""}, \
104 {PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""}
112 {0,
nullptr, 0,
nullptr,
nullptr},
119 {0,
nullptr, 0,
nullptr,
nullptr},
126 {0,
nullptr, 0,
nullptr,
nullptr},
141 {0,
nullptr, 0,
nullptr,
nullptr},
161 {0,
nullptr, 0,
nullptr,
nullptr},
167 "For operators: hide from places in the user interface where Blender would add the property "
168 "automatically, like Adjust Last Operation. Also this property is not written to presets.";
170 "For operators: the value of this property will not be remembered between invocations of the "
171 "operator; instead, each invocation will start by using the default value. Also this "
172 "property is not written to presets.";
176 "This property can be edited, even when it is used on linked data (which normally is "
177 "read-only). Note that edits to the property will not be saved to the blend file.";
182 "This path supports relative prefix \"//\" which is expanded the directory "
183 "where the current \".blend\" file is located.";
185 "This path supports the \"{variable_name}\" template syntax, which substitutes the "
186 "value of the referenced variable in place of the template expression";
211 "Adjust values proportionally to each other",
216 "Update on every keystroke in textedit 'mode'",
220 "PATH_SUPPORTS_BLEND_RELATIVE",
222 "Relative Path Support",
225 "SUPPORTS_TEMPLATES",
227 "Variable expression support",
229 {0,
nullptr, 0,
nullptr,
nullptr},
252 {0,
nullptr, 0,
nullptr,
nullptr},
257 "LIBRARY_OVERRIDABLE",
259 "Library Overridable",
260 "Make that property editable in library overrides of linked data-blocks.\n"
261 "NOTE: For a property to be overridable, its whole chain of parent properties must also be "
262 "defined as overridable"};
266 {0,
nullptr, 0,
nullptr,
nullptr},
275 "Do not use the names of the items, only their indices in the collection"},
280 "Allow users to add new items in that collection in library overrides"},
281 {0,
nullptr, 0,
nullptr,
nullptr},
290 "Search results are suggestions (other values may be entered)"},
292 {0,
nullptr, 0,
nullptr,
nullptr},
315# include <fmt/format.h>
319static CLG_LogRef LOG_COMPARE_OVERRIDE = {
"rna.rna_compare_override"};
327static void rna_Struct_identifier_get(
PointerRNA *ptr,
char *value)
329 strcpy(value, (
static_cast<StructRNA *
>(ptr->data))->identifier.c_str());
332static int rna_Struct_identifier_length(
PointerRNA *ptr)
334 return static_cast<StructRNA *
>(ptr->data)->identifier.size();
337static void rna_Struct_description_get(
PointerRNA *ptr,
char *value)
339 strcpy(value, (
static_cast<StructRNA *
>(ptr->data))->description);
342static int rna_Struct_description_length(
PointerRNA *ptr)
344 return strlen((
static_cast<StructRNA *
>(ptr->data))->description);
347static void rna_Struct_name_get(
PointerRNA *ptr,
char *value)
349 strcpy(value, (
static_cast<StructRNA *
>(ptr->data))->name);
352static int rna_Struct_name_length(
PointerRNA *ptr)
354 return strlen((
static_cast<StructRNA *
>(ptr->data))->name);
357static void rna_Struct_translation_context_get(
PointerRNA *ptr,
char *value)
359 strcpy(value, (
static_cast<StructRNA *
>(ptr->data))->translation_context);
362static int rna_Struct_translation_context_length(
PointerRNA *ptr)
364 return strlen((
static_cast<StructRNA *
>(ptr->data))->translation_context);
370 nullptr, RNA_Struct, (
static_cast<StructRNA *
>(ptr->data))->base);
376 nullptr, RNA_Struct, (
static_cast<StructRNA *
>(ptr->data))->nested);
382 nullptr, RNA_Property, (
static_cast<StructRNA *
>(ptr->data))->nameproperty);
393 StructRNA *ptype = iter->builtin_parent.type;
403 for (prop = ptype->cont.properties.first(); prop; prop = prop->next) {
405 (prop->flag &
PROP_IDPROPERTY) != 0 && prop->identifier == idprop_name)
410 }
while ((ptype = ptype->base));
429 while (!iter->valid && iter->level > 0) {
433 srna =
static_cast<StructRNA *
>(iter->parent.data);
435 for (i = iter->level; i > 0; i--) {
451 rna_inheritance_next_level_restart(iter, ptr, skip);
458 rna_inheritance_next_level_restart(iter, &iter->parent, skip);
472 rna_inheritance_properties_listbase_next(iter, rna_property_builtin);
485 internal = &iter->internal.listbase;
497 srna =
static_cast<StructRNA *
>(ptr->data);
504 rna_inheritance_properties_listbase_begin(
505 iter, ptr, &srna->cont.properties, rna_property_builtin);
520 for (
StructRNA *srna_iter = srna; srna_iter !=
nullptr; srna_iter = srna_iter->
base) {
521 types.append(srna_iter);
523 std::reverse(types.begin(), types.end());
532 for (std::unique_ptr<FunctionRNA> &func : srna->functions) {
536 functions.append(func.get());
561 iter, ptr, (
void *)tag_defines,
sizeof(
EnumPropertyItem), tag_count, 0,
nullptr);
573 newptr.
type = RNA_Struct;
574 newptr.data = ptr->type;
577 newptr.owner_id =
static_cast<ID *
>(ptr->data);
580 newptr.owner_id =
nullptr;
583 iter->parent = newptr;
584 iter->builtin_parent = *ptr;
586 rna_Struct_properties_begin(iter, &newptr);
591 rna_Struct_properties_next(iter);
596 return rna_Struct_properties_get(iter);
606 *r_ptr = {
nullptr, RNA_Property, prop};
623 return RNA_BoolProperty;
625 return RNA_IntProperty;
627 return RNA_FloatProperty;
629 return RNA_StringProperty;
631 return RNA_EnumProperty;
633 return RNA_PointerProperty;
635 return RNA_CollectionProperty;
641static void rna_Property_identifier_get(
PointerRNA *ptr,
char *value)
647static int rna_Property_identifier_length(
PointerRNA *ptr)
653static void rna_Property_name_get(
PointerRNA *ptr,
char *value)
657 strcpy(value, name ? name :
"");
660static int rna_Property_name_length(
PointerRNA *ptr)
664 return name ? strlen(name) : 0;
667static void rna_Property_description_get(
PointerRNA *ptr,
char *value)
671 strcpy(value, description ? description :
"");
673static int rna_Property_description_length(
PointerRNA *ptr)
677 return description ? strlen(description) : 0;
680static void rna_Property_translation_context_get(
PointerRNA *ptr,
char *value)
686static int rna_Property_translation_context_length(
PointerRNA *ptr)
692static int rna_Property_type_get(
PointerRNA *ptr)
698static int rna_Property_subtype_get(
PointerRNA *ptr)
711static int rna_Property_unit_get(
PointerRNA *ptr)
717static int rna_Property_icon_get(
PointerRNA *ptr)
723static bool rna_Property_readonly_get(
PointerRNA *ptr)
734static bool rna_Property_animatable_get(
PointerRNA *ptr)
741static bool rna_Property_overridable_get(
PointerRNA *ptr)
751static bool rna_Property_use_output_get(
PointerRNA *ptr)
757static bool rna_Property_is_required_get(
PointerRNA *ptr)
763static bool rna_Property_is_argument_optional_get(
PointerRNA *ptr)
769static bool rna_Property_is_never_none_get(
PointerRNA *ptr)
775static bool rna_Property_is_hidden_get(
PointerRNA *ptr)
781static bool rna_Property_is_skip_save_get(
PointerRNA *ptr)
787static bool rna_Property_is_skip_preset_get(
PointerRNA *ptr)
793static bool rna_Property_is_enum_flag_get(
PointerRNA *ptr)
799static bool rna_Property_is_library_editable_flag_get(
PointerRNA *ptr)
805static bool rna_Property_is_path_output_flag_get(
PointerRNA *ptr)
811static bool rna_Property_is_path_supports_blend_relative_flag_get(
PointerRNA *ptr)
817static bool rna_Property_is_path_supports_templates_flag_get(
PointerRNA *ptr)
823static int rna_Property_tags_get(
PointerRNA *ptr)
840 struct_tags !=
nullptr && struct_tags->
identifier !=
nullptr;
843 memcpy(&tmp, struct_tags,
sizeof(tmp));
852static int rna_Property_array_length_get(
PointerRNA *ptr)
856 return prop->totarraylength;
859static void rna_Property_array_dimensions_get(
PointerRNA *ptr,
865 if (prop->arraydimension > 1) {
867 dimensions[i] = (i >= prop->arraydimension) ? 0 : prop->arraylength[i];
872 dimensions[0] = prop->totarraylength;
876static bool rna_Property_is_registered_get(
PointerRNA *ptr)
882static bool rna_Property_is_registered_optional_get(
PointerRNA *ptr)
888static bool rna_Property_is_runtime_get(
PointerRNA *ptr)
894static bool rna_Property_is_deprecated_get(
PointerRNA *ptr)
900static int rna_Property_deprecated_note_length(
PointerRNA *ptr)
904 return strlen(deprecated->note);
909static void rna_Property_deprecated_note_get(
PointerRNA *ptr,
char *value)
913 strcpy(value, deprecated->note);
920static void rna_Property_deprecated_version_get(
PointerRNA *ptr,
int *value)
930static void rna_Property_deprecated_removal_version_get(
PointerRNA *ptr,
int *value)
935 version = deprecated->removal_version;
941static bool rna_BoolProperty_default_get(
PointerRNA *ptr)
948static int rna_IntProperty_default_get(
PointerRNA *ptr)
955static int rna_NumberProperty_default_array_get_length(
const PointerRNA *ptr,
961 length[0] = prop->totarraylength;
965static bool rna_NumberProperty_is_array_get(
PointerRNA *ptr)
972static void rna_IntProperty_default_array_get(
PointerRNA *ptr,
int *values)
976 if (prop->totarraylength > 0) {
982static void rna_BoolProperty_default_array_get(
PointerRNA *ptr,
bool *values)
986 if (prop->totarraylength > 0) {
992static void rna_FloatProperty_default_array_get(
PointerRNA *ptr,
float *values)
996 if (prop->totarraylength > 0) {
1002static int rna_IntProperty_hard_min_get(
PointerRNA *ptr)
1009static int rna_IntProperty_hard_max_get(
PointerRNA *ptr)
1016static int rna_IntProperty_soft_min_get(
PointerRNA *ptr)
1023static int rna_IntProperty_soft_max_get(
PointerRNA *ptr)
1030static int rna_IntProperty_step_get(
PointerRNA *ptr)
1037static float rna_FloatProperty_default_get(
PointerRNA *ptr)
1043static float rna_FloatProperty_hard_min_get(
PointerRNA *ptr)
1050static float rna_FloatProperty_hard_max_get(
PointerRNA *ptr)
1057static float rna_FloatProperty_soft_min_get(
PointerRNA *ptr)
1064static float rna_FloatProperty_soft_max_get(
PointerRNA *ptr)
1071static float rna_FloatProperty_step_get(
PointerRNA *ptr)
1078static int rna_FloatProperty_precision_get(
PointerRNA *ptr)
1085static void rna_StringProperty_default_get(
PointerRNA *ptr,
char *value)
1091static int rna_StringProperty_default_length(
PointerRNA *ptr)
1098static int rna_StringProperty_max_length_get(
PointerRNA *ptr)
1121 if ((eprop->item_fn ==
nullptr) || (eprop->item_fn == rna_EnumProperty_default_itemf) ||
1122 (ptr->type == RNA_EnumProperty) || (
C ==
nullptr))
1129 return eprop->
item_fn(
C, ptr, prop, r_free);
1133static int rna_EnumProperty_default_get(
PointerRNA *ptr)
1144 return (item->identifier[0] == 0);
1163 iter->prop->identifier ==
"enum_items_static"_ustr,
1173 rna_EnumProperty_items_begin_impl(iter, ptr, rna_enum_check_separator);
1179 rna_EnumProperty_items_begin_impl(iter, ptr,
nullptr);
1182static void rna_EnumPropertyItem_identifier_get(
PointerRNA *ptr,
char *value)
1187static int rna_EnumPropertyItem_identifier_length(
PointerRNA *ptr)
1192static void rna_EnumPropertyItem_name_get(
PointerRNA *ptr,
char *value)
1198 strcpy(value, eprop->name);
1205static int rna_EnumPropertyItem_name_length(
PointerRNA *ptr)
1209 return strlen(eprop->name);
1214static void rna_EnumPropertyItem_description_get(
PointerRNA *ptr,
char *value)
1218 if (eprop->description) {
1219 strcpy(value, eprop->description);
1226static int rna_EnumPropertyItem_description_length(
PointerRNA *ptr)
1230 if (eprop->description) {
1231 return strlen(eprop->description);
1236static int rna_EnumPropertyItem_value_get(
PointerRNA *ptr)
1241static int rna_EnumPropertyItem_icon_get(
PointerRNA *ptr)
1264static void rna_Function_identifier_get(
PointerRNA *ptr,
char *value)
1266 strcpy(value, (
static_cast<FunctionRNA *
>(ptr->data))->identifier.c_str());
1269static int rna_Function_identifier_length(
PointerRNA *ptr)
1271 return static_cast<FunctionRNA *
>(ptr->data)->identifier.size();
1274static void rna_Function_description_get(
PointerRNA *ptr,
char *value)
1276 strcpy(value, (
static_cast<FunctionRNA *
>(ptr->data))->description);
1279static int rna_Function_description_length(
PointerRNA *ptr)
1281 return strlen((
static_cast<FunctionRNA *
>(ptr->data))->description);
1287 iter, ptr, &(
static_cast<FunctionRNA *
>(ptr->data))->cont.properties, rna_property_builtin);
1290static bool rna_Function_registered_get(
PointerRNA *ptr)
1296static bool rna_Function_registered_optional_get(
PointerRNA *ptr)
1302static bool rna_Function_no_self_get(
PointerRNA *ptr)
1308static bool rna_Function_use_self_type_get(
PointerRNA *ptr)
1327 static_assert(
sizeof(
StructRNA *) ==
sizeof(std::unique_ptr<StructRNA>));
1330 brna->structs.data(),
1332 brna->structs.size(),
1334 rna_struct_is_publc);
1338static int rna_BlenderRNA_structs_length(
PointerRNA *ptr)
1347 if (srna !=
nullptr) {
1355static bool rna_BlenderRNA_structs_lookup_string(
PointerRNA *ptr,
1361 if (srna !=
nullptr) {
1375struct RNACompareOverrideDiffPropPtrContext {
1377 RNAPropertyOverrideDiffContext &rnadiff_ctx;
1380 ID *owner_id_a =
nullptr;
1381 ID *owner_id_b =
nullptr;
1382 PointerRNA propptr_a = {};
1383 PointerRNA propptr_b = {};
1390 bool no_ownership =
false;
1395 bool no_prop_name =
false;
1400 bool do_force_name =
false;
1402 bool use_id_pointer =
false;
1413 bool has_liboverride_apply_cb =
false;
1419 std::optional<std::string> rna_itemname_a;
1420 std::optional<std::string> rna_itemname_b;
1421 std::optional<ID *> rna_itemid_a;
1422 std::optional<ID *> rna_itemid_b;
1423 int rna_itemindex_a = -1;
1424 int rna_itemindex_b = -1;
1435 bool is_valid_for_diffing =
true;
1438 bool is_null =
false;
1439 bool is_type_diff =
false;
1441 RNACompareOverrideDiffPropPtrContext(RNAPropertyOverrideDiffContext &rnadiff_ctx_)
1442 : rnadiff_ctx(rnadiff_ctx_)
1446static void rna_property_override_diff_propptr_validate_diffing(
1447 RNACompareOverrideDiffPropPtrContext &ptrdiff_ctx)
1449 PointerRNA *propptr_a = &ptrdiff_ctx.propptr_a;
1450 PointerRNA *propptr_b = &ptrdiff_ctx.propptr_b;
1451 const bool no_ownership = ptrdiff_ctx.no_ownership;
1452 const bool no_prop_name = ptrdiff_ctx.no_prop_name;
1453 const bool do_force_name = ptrdiff_ctx.do_force_name;
1454 const bool is_same_type = propptr_b !=
nullptr && (ptrdiff_ctx.rnadiff_ctx.liboverride ?
1456 propptr_a->type, propptr_b->type) :
1457 propptr_a->type == propptr_b->type);
1459 ptrdiff_ctx.is_valid_for_diffing =
true;
1463 if (do_force_name || ptrdiff_ctx.use_id_pointer) {
1469 if (propptr_b ==
nullptr || !*propptr_b) {
1470 ptrdiff_ctx.is_null =
true;
1474 ptrdiff_ctx.is_null =
true;
1475 ptrdiff_ctx.is_type_diff = !is_same_type;
1477 ptrdiff_ctx.is_valid_for_diffing =
false;
1481 ptrdiff_ctx.is_null = (propptr_b ==
nullptr || !*propptr_b);
1482 ptrdiff_ctx.is_type_diff = !is_same_type;
1483 ptrdiff_ctx.is_valid_for_diffing = !((ptrdiff_ctx.is_id && no_ownership) ||
1484 ptrdiff_ctx.is_null || ptrdiff_ctx.is_type_diff);
1491 if (!no_prop_name && (ptrdiff_ctx.is_valid_for_diffing || do_force_name)) {
1494 PropertyRNA *nameprop_b = (propptr_b !=
nullptr && propptr_b->has_type()) ?
1497 const bool do_id_pointer = ptrdiff_ctx.use_id_pointer && ptrdiff_ctx.is_id;
1503 int rna_itemname_a_len = 0, rna_itemname_b_len = 0;
1504 char *rna_itemname_a =
nullptr;
1505 char *rna_itemname_b =
nullptr;
1508 if (nameprop_a !=
nullptr) {
1510 propptr_a, nameprop_a, buff_a,
sizeof(buff_a), &rna_itemname_a_len);
1512 ptrdiff_ctx.rna_itemname_a = rna_itemname_a;
1515 if (nameprop_b !=
nullptr) {
1517 propptr_b, nameprop_b, buff_b,
sizeof(buff_b), &rna_itemname_b_len);
1518 ptrdiff_ctx.rna_itemname_b = rna_itemname_b;
1524 ID *rna_itemid_a = (do_id_pointer && *propptr_a) ?
static_cast<ID *
>(propptr_a->data) :
1526 ID *rna_itemid_b = (do_id_pointer && *propptr_b) ?
static_cast<ID *
>(propptr_b->data) :
1528 if (do_id_pointer) {
1529 ptrdiff_ctx.rna_itemid_a = rna_itemid_a;
1530 ptrdiff_ctx.rna_itemid_b = rna_itemid_b;
1533 if (rna_itemname_a !=
nullptr && rna_itemname_b !=
nullptr) {
1534 if (rna_itemid_a != rna_itemid_b || rna_itemname_a_len != rna_itemname_b_len ||
1535 rna_itemname_a[0] != rna_itemname_b[0] || !
STREQ(rna_itemname_a, rna_itemname_b))
1537 ptrdiff_ctx.is_valid_for_diffing =
false;
1541 if (rna_itemname_a && rna_itemname_a != buff_a) [[unlikely]] {
1542 MEM_delete(rna_itemname_a);
1544 if (rna_itemname_b && rna_itemname_b != buff_b) [[unlikely]] {
1545 MEM_delete(rna_itemname_b);
1549 if (ptrdiff_ctx.is_id) {
1550 BLI_assert(propptr_a->data == propptr_a->owner_id && propptr_b->data == propptr_b->owner_id);
1555static void rna_property_override_diff_propptr(
Main *bmain,
1556 RNACompareOverrideDiffPropPtrContext &ptrdiff_ctx)
1558 ID *owner_id_a = ptrdiff_ctx.owner_id_a;
1559 ID *owner_id_b = ptrdiff_ctx.owner_id_b;
1560 PointerRNA *propptr_a = &ptrdiff_ctx.propptr_a;
1561 PointerRNA *propptr_b = &ptrdiff_ctx.propptr_b;
1564 const bool no_ownership = ptrdiff_ctx.no_ownership;
1567 const eRNAOverrideMatch liboverride_flags = ptrdiff_ctx.rnadiff_ctx.liboverride_flags;
1568 const char *
rna_path = ptrdiff_ctx.rnadiff_ctx.rna_path;
1569 size_t rna_path_len = ptrdiff_ctx.rnadiff_ctx.rna_path_len;
1570 const PropertyType property_type = ptrdiff_ctx.property_type;
1572 std::optional<std::string> &rna_itemname_a = ptrdiff_ctx.rna_itemname_a;
1573 std::optional<std::string> &rna_itemname_b = ptrdiff_ctx.rna_itemname_b;
1574 const int rna_itemindex_a = ptrdiff_ctx.rna_itemindex_a;
1575 const int rna_itemindex_b = ptrdiff_ctx.rna_itemindex_b;
1579 rna_property_override_diff_propptr_validate_diffing(ptrdiff_ctx);
1583 const bool is_valid_for_diffing = ptrdiff_ctx.is_valid_for_diffing;
1584 const bool is_id = ptrdiff_ctx.is_id;
1585 const bool is_null = ptrdiff_ctx.is_null;
1586 const bool is_type_diff = ptrdiff_ctx.is_type_diff;
1588 const bool has_liboverride_apply_cb = ptrdiff_ctx.has_liboverride_apply_cb;
1592 (is_id || has_liboverride_apply_cb) &&
1599 ID *
id = propptr_a->owner_id;
1601 id = propptr_b->owner_id;
1612 if (no_ownership || is_null || is_type_diff || !is_valid_for_diffing) {
1616 ptrdiff_ctx.rnadiff_ctx.comparison = (propptr_a->data != propptr_b->data);
1618 if (do_create && ptrdiff_ctx.rnadiff_ctx.comparison != 0) {
1619 bool created =
false;
1624 if (op !=
nullptr) {
1625 if (created || op->rna_prop_type == 0) {
1626 op->rna_prop_type = property_type;
1629 BLI_assert(op->rna_prop_type == property_type);
1633 if (created || (rna_itemname_a && !rna_itemname_a->empty()) ||
1634 (rna_itemname_b && !rna_itemname_b->empty()) || rna_itemindex_a != -1 ||
1635 rna_itemindex_b != -1)
1637 const char *subitem_refname = rna_itemname_b ? rna_itemname_b->c_str() :
nullptr;
1638 const char *subitem_locname = rna_itemname_a ? rna_itemname_a->c_str() :
nullptr;
1643 ptrdiff_ctx.rna_itemid_b,
1644 ptrdiff_ctx.rna_itemid_a,
1662 if (is_id && no_ownership) {
1663 if (opop ==
nullptr) {
1664 const char *subitem_refname = rna_itemname_b ? rna_itemname_b->c_str() :
nullptr;
1665 const char *subitem_locname = rna_itemname_a ? rna_itemname_a->c_str() :
nullptr;
1670 ptrdiff_ctx.rna_itemid_b,
1671 ptrdiff_ctx.rna_itemid_a,
1686 BLI_assert(propptr_a->data == propptr_a->owner_id);
1687 BLI_assert(propptr_b->data == propptr_b->owner_id);
1688 ID *id_a =
static_cast<ID *
>(propptr_a->data);
1689 ID *id_b =
static_cast<ID *
>(propptr_b->data);
1690 if (
ELEM(
nullptr, id_a, id_b)) {
1702 &LOG_COMPARE_OVERRIDE,
1703 "Not checking matching ID pointer properties, since owner %s is tagged as "
1704 "needing resync.\n",
1707 else if (id_a->override_library !=
nullptr &&
1708 id_a->override_library->reference == id_b)
1712 else if (id_b->override_library !=
nullptr &&
1713 id_b->override_library->reference == id_a)
1727# define RNA_PATH_BUFFSIZE 8192
1730 char *extended_rna_path = extended_rna_path_buffer;
1731 size_t extended_rna_path_len = 0;
1737 if ((rna_itemname_a && !rna_itemname_a->empty()) &&
1738 (rna_itemname_b && !rna_itemname_b->empty()))
1740 BLI_assert(*rna_itemname_a == *rna_itemname_b);
1744 esc_item_name, rna_itemname_a->c_str(),
sizeof(esc_item_name));
1745 extended_rna_path_len = rna_path_len + 2 + esc_item_name_len + 2;
1751 memcpy(extended_rna_path,
rna_path, rna_path_len);
1752 extended_rna_path[rna_path_len] =
'[';
1753 extended_rna_path[rna_path_len + 1] =
'"';
1754 memcpy(extended_rna_path + rna_path_len + 2, esc_item_name, esc_item_name_len);
1755 extended_rna_path[rna_path_len + 2 + esc_item_name_len] =
'"';
1756 extended_rna_path[rna_path_len + 2 + esc_item_name_len + 1] =
']';
1757 extended_rna_path[extended_rna_path_len] =
'\0';
1759 else if (rna_itemindex_a != -1) {
1760 BLI_assert(rna_itemindex_a == rna_itemindex_b);
1763 char item_index_buff[32];
1764 size_t item_index_buff_len = 0;
1765 if (rna_itemindex_a == 0) {
1766 item_index_buff[0] =
'0';
1767 item_index_buff_len = 1;
1771 for (
index = rna_itemindex_a;
1772 index > 0 && item_index_buff_len <
sizeof(item_index_buff);
1775 item_index_buff[item_index_buff_len++] =
'0' + char(
index % 10);
1780 extended_rna_path_len = rna_path_len + item_index_buff_len + 2;
1786 memcpy(extended_rna_path,
rna_path, rna_path_len);
1787 extended_rna_path[rna_path_len] =
'[';
1788 for (
size_t i = 1; i <= item_index_buff_len; i++) {
1791 extended_rna_path[rna_path_len + i] = item_index_buff[item_index_buff_len - i];
1793 extended_rna_path[rna_path_len + 1 + item_index_buff_len] =
']';
1794 extended_rna_path[extended_rna_path_len] =
'\0';
1797 extended_rna_path =
const_cast<char *
>(
rna_path);
1798 extended_rna_path_len = rna_path_len;
1806 extended_rna_path_len,
1809 &ptrdiff_ctx.rnadiff_ctx.report_flag);
1810 ptrdiff_ctx.rnadiff_ctx.comparison = !match;
1820 if (op !=
nullptr) {
1824 if (!
ELEM(extended_rna_path, extended_rna_path_buffer,
rna_path)) {
1825 MEM_delete(extended_rna_path);
1828# undef RNA_PATH_BUFFSIZE
1832 if (no_ownership || is_null || is_type_diff || !is_valid_for_diffing) {
1836 ptrdiff_ctx.rnadiff_ctx.comparison = (propptr_a->data != propptr_b->data);
1841 ptrdiff_ctx.rnadiff_ctx.comparison = !
RNA_struct_equals(bmain, propptr_a, propptr_b, mode);
1846# define RNA_PROPERTY_GET_SINGLE(_typename, _ptr, _prop, _index) \
1847 (is_array ? RNA_property_##_typename##_get_index((_ptr), (_prop), (_index)) : \
1848 RNA_property_##_typename##_get((_ptr), (_prop)))
1849# define RNA_PROPERTY_SET_SINGLE(_typename, _ptr, _prop, _index, _value) \
1850 (is_array ? RNA_property_##_typename##_set_index((_ptr), (_prop), (_index), (_value)) : \
1851 RNA_property_##_typename##_set((_ptr), (_prop), (_value)))
1866 const uint len_a = prop_a->array_len;
1867 const uint len_b = prop_b->array_len;
1870 const char *
rna_path = rnadiff_ctx.rna_path;
1871 const int liboverride_flags = rnadiff_ctx.liboverride_flags;
1885 bool created =
false;
1888 switch (rna_prop_type) {
1892 bool *array_a, *array_b;
1904 rnadiff_ctx.comparison = memcmp(array_a, array_b,
sizeof(
bool) * len_a);
1906 if (do_create && rnadiff_ctx.comparison != 0) {
1910 if (op !=
nullptr && created) {
1929 if (array_a != array_stack_a) {
1930 MEM_delete(array_a);
1932 if (array_b != array_stack_b) {
1933 MEM_delete(array_b);
1939 rnadiff_ctx.comparison = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
1941 if (do_create && rnadiff_ctx.comparison != 0) {
1942 op = BKE_lib_override_library_property_get(liboverride, rna_path, &created);
1944 if (op != nullptr && created) {
1945 BKE_lib_override_library_property_operation_get(op,
1946 LIBOVERRIDE_OP_REPLACE,
1956 rnadiff_ctx.report_flag |= RNA_OVERRIDE_MATCH_RESULT_CREATED;
1966 int *array_a, *array_b;
1978 rnadiff_ctx.comparison = memcmp(array_a, array_b,
sizeof(
int) * len_a);
1980 if (do_create && rnadiff_ctx.comparison != 0) {
1984 if (op !=
nullptr && created) {
2005 if (array_a != array_stack_a) {
2006 MEM_delete(array_a);
2008 if (array_b != array_stack_b) {
2009 MEM_delete(array_b);
2015 rnadiff_ctx.comparison = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
2017 if (do_create && rnadiff_ctx.comparison != 0) {
2018 op = BKE_lib_override_library_property_get(liboverride, rna_path, &created);
2020 if (op != nullptr && created) {
2021 BKE_lib_override_library_property_operation_get(op,
2022 LIBOVERRIDE_OP_REPLACE,
2032 rnadiff_ctx.report_flag |= RNA_OVERRIDE_MATCH_RESULT_CREATED;
2042 float *array_a, *array_b;
2054 rnadiff_ctx.comparison = memcmp(array_a, array_b,
sizeof(
float) * len_a);
2056 if (do_create && rnadiff_ctx.comparison != 0) {
2060 if (op !=
nullptr && created) {
2079 if (array_a != array_stack_a) {
2080 MEM_delete(array_a);
2082 if (array_b != array_stack_b) {
2083 MEM_delete(array_b);
2089 rnadiff_ctx.comparison = (value_a < value_b) ? -1 : (value_a > value_b) ? 1 : 0;
2091 if (do_create && rnadiff_ctx.comparison != 0) {
2092 op = BKE_lib_override_library_property_get(liboverride, rna_path, &created);
2094 if (op != nullptr && created) {
2095 BKE_lib_override_library_property_operation_get(op,
2096 LIBOVERRIDE_OP_REPLACE,
2106 rnadiff_ctx.report_flag |= RNA_OVERRIDE_MATCH_RESULT_CREATED;
2116 rnadiff_ctx.comparison = value_a != value_b;
2118 if (do_create && rnadiff_ctx.comparison != 0) {
2121 if (op !=
nullptr && created) {
2123 LIBOVERRIDE_OP_REPLACE,
2140 char fixed_a[4096], fixed_b[4096];
2141 int len_str_a, len_str_b;
2143 ptr_a, rawprop_a, fixed_a,
sizeof(fixed_a), &len_str_a);
2145 ptr_b, rawprop_b, fixed_b,
sizeof(fixed_b), &len_str_b);
2150 rnadiff_ctx.comparison = len_str_a < len_str_b ? -1 :
2151 len_str_a > len_str_b ? 1 :
2152 strcmp(value_a, value_b);
2154 rnadiff_ctx.comparison = strcmp(value_a, value_b);
2156 if (do_create && rnadiff_ctx.comparison != 0) {
2159 if (op !=
nullptr && created) {
2161 LIBOVERRIDE_OP_REPLACE,
2175 if (value_a != fixed_a) {
2176 MEM_delete(value_a);
2178 if (value_b != fixed_b) {
2179 MEM_delete(value_b);
2189 if (prop_a->identifier ==
"rna_type"_ustr) {
2194 RNACompareOverrideDiffPropPtrContext ptrdiff_ctx(rnadiff_ctx);
2195 ptrdiff_ctx.owner_id_a = ptr_a->owner_id;
2196 ptrdiff_ctx.owner_id_b = ptr_b->owner_id;
2202 ptrdiff_ctx.no_prop_name =
true;
2203 ptrdiff_ctx.no_ownership = no_ownership;
2207 if (prop_a->is_idprop || prop_a->is_rna_storage_idprop || prop_a->rnaprop->override_apply)
2209 BLI_assert(prop_a->is_idprop == prop_b->is_idprop);
2210 BLI_assert(prop_a->is_rna_storage_idprop == prop_b->is_rna_storage_idprop);
2211 BLI_assert(prop_a->rnaprop->override_apply == prop_b->rnaprop->override_apply);
2212 ptrdiff_ctx.has_liboverride_apply_cb =
true;
2214 rna_property_override_diff_propptr(bmain, ptrdiff_ctx);
2224 BLI_assert(prop_a->is_idprop == prop_b->is_idprop);
2225 BLI_assert(prop_a->is_rna_storage_idprop == prop_b->is_rna_storage_idprop);
2226 BLI_assert(prop_a->rnaprop->override_apply == prop_b->rnaprop->override_apply);
2227 const bool has_liboverride_apply_cb = (prop_a->is_idprop || prop_a->is_rna_storage_idprop ||
2228 prop_a->rnaprop->override_apply);
2229 if (!has_liboverride_apply_cb &&
2230 (prop_a->rnaprop->flag_override & PROPOVERRIDE_LIBRARY_INSERTION) != 0)
2233 "RNA collection '%s' defined as supporting liboverride insertion of items, but "
2234 "no liboverride apply callback defined for it. No insertion will happen.",
2240 const bool use_collection_insertion = has_liboverride_apply_cb && do_create &&
2241 (prop_a->rnaprop->flag_override &
2248 std::optional<std::string> prev_rna_itemname_a;
2249 std::optional<ID *> prev_rna_itemid_a;
2251 CollectionPropertyIterator iter_a, iter_b;
2255 if (use_collection_insertion) {
2259 if (op !=
nullptr) {
2260 for (IDOverrideLibraryPropertyOperation &opop : op->operations.items_mutable()) {
2261 if (
ELEM(opop.operation, LIBOVERRIDE_OP_INSERT_AFTER, LIBOVERRIDE_OP_INSERT_BEFORE)) {
2269 for (; iter_a.valid && !abort;) {
2271 bool is_valid_for_insertion = use_collection_insertion;
2273 RNACompareOverrideDiffPropPtrContext ptrdiff_ctx(rnadiff_ctx);
2274 ptrdiff_ctx.owner_id_a = ptr_a->owner_id;
2275 ptrdiff_ctx.owner_id_b = ptr_b->owner_id;
2276 ptrdiff_ctx.propptr_a = iter_a.ptr;
2278 ptrdiff_ctx.propptr_b = iter_b.ptr;
2280 ptrdiff_ctx.no_prop_name = no_prop_name;
2281 ptrdiff_ctx.do_force_name = !no_prop_name;
2282 ptrdiff_ctx.use_id_pointer = !no_prop_name;
2283 ptrdiff_ctx.no_ownership = no_ownership;
2285 ptrdiff_ctx.has_liboverride_apply_cb = has_liboverride_apply_cb;
2287 if (iter_b.valid || use_collection_insertion) {
2288 rna_property_override_diff_propptr_validate_diffing(ptrdiff_ctx);
2291 ptrdiff_ctx.no_prop_name =
true;
2292 ptrdiff_ctx.do_force_name =
false;
2293 ptrdiff_ctx.use_id_pointer =
false;
2296 const bool is_valid_for_diffing = ptrdiff_ctx.is_valid_for_diffing;
2297 const bool is_id = ptrdiff_ctx.is_id;
2300 if (is_id || is_valid_for_diffing) {
2301 is_valid_for_insertion =
false;
2307 "Checking %s, %s [%d] vs %s [%d]; is_id: %d, diffing: %d; "
2308 "insert: %d (could be used: %d, do_create: %d)\n",
2310 ptrdiff_ctx.rna_itemname_a ? ptrdiff_ctx.rna_itemname_a->c_str() :
"",
2312 ptrdiff_ctx.rna_itemname_b ? ptrdiff_ctx.rna_itemname_b->c_str() :
"",
2315 is_valid_for_diffing,
2316 is_valid_for_insertion,
2317 use_collection_insertion,
2322 if (!(is_id || is_valid_for_diffing || is_valid_for_insertion)) {
2337 if (is_valid_for_insertion && use_collection_insertion) {
2342 LIBOVERRIDE_OP_INSERT_AFTER,
2343 (no_prop_name || !prev_rna_itemname_a) ?
nullptr : prev_rna_itemname_a->c_str(),
2344 (no_prop_name || !ptrdiff_ctx.rna_itemname_a) ?
2346 ptrdiff_ctx.rna_itemname_a->c_str(),
2348 ptrdiff_ctx.rna_itemid_a,
2355 printf(
"%s: Adding insertion op override after '%s'/%d\n",
2357 prev_rna_itemname_a ? prev_rna_itemname_a->c_str() :
"",
2364 else if (is_id || is_valid_for_diffing) {
2365 if (equals || do_create) {
2366 ptrdiff_ctx.rna_itemindex_a = idx_a;
2367 ptrdiff_ctx.rna_itemindex_b = idx_b;
2368 rna_property_override_diff_propptr(bmain, ptrdiff_ctx);
2369 equals = equals && (rnadiff_ctx.comparison == 0);
2373 if (ptrdiff_ctx.rna_itemname_a) {
2374 prev_rna_itemname_a = std::move(*ptrdiff_ctx.rna_itemname_a);
2377 prev_rna_itemname_a.reset();
2379 prev_rna_itemid_a = ptrdiff_ctx.rna_itemid_a;
2381 if (!do_create && !equals) {
2386 if (!(use_collection_insertion && !(is_id || is_valid_for_diffing))) {
2394 }
while (iter_a.valid);
2407 equals = equals && !(iter_a.valid || iter_b.valid) && !abort;
2411 rnadiff_ctx.comparison = (equals ==
false);
2419 if (op !=
nullptr) {
2424 op->rna_prop_type = rna_prop_type;
2431 PointerRNA *ptr_local,
2432 PointerRNA *ptr_reference,
2433 PointerRNA *ptr_storage,
2434 PropertyRNA *prop_local,
2435 PropertyRNA *prop_reference,
2436 PropertyRNA *prop_storage,
2437 const int len_local,
2438 const int len_reference,
2439 const int len_storage,
2440 IDOverrideLibraryPropertyOperation *opop)
2442 BLI_assert(len_local == len_reference && (!ptr_storage || len_local == len_storage));
2445 bool changed =
false;
2446 const bool is_array = len_local > 0;
2447 const int index = is_array ? opop->subitem_reference_index : 0;
2449 if (!
ELEM(opop->operation, LIBOVERRIDE_OP_ADD, LIBOVERRIDE_OP_SUBTRACT, LIBOVERRIDE_OP_MULTIPLY))
2464 BLI_assert_msg(0,
"Boolean properties support no override diff operation");
2467 int prop_min, prop_max;
2470 if (is_array &&
index == -1) {
2472 int *array_a, *array_b;
2479 switch (opop->operation) {
2491 for (
int i = len_local; i--;) {
2492 array_b[i] = fac * (array_b[i] - array_a[i]);
2493 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2494 opop->operation = other_op;
2495 for (
int j = len_local; j--;) {
2496 array_b[j] = j >= i ? -array_b[j] : fac * (array_a[j] - array_b[j]);
2497 if (array_b[j] < prop_min || array_b[j] > prop_max) {
2512 if (array_b != array_stack_b) {
2513 MEM_delete(array_b);
2518 BLI_assert_msg(0,
"Unsupported RNA override diff operation on integer");
2522 if (array_a != array_stack_a) {
2523 MEM_delete(array_a);
2527 const int value = RNA_PROPERTY_GET_SINGLE(
int, ptr_reference, prop_reference,
index);
2529 switch (opop->operation) {
2536 int b = fac * (RNA_PROPERTY_GET_SINGLE(
int, ptr_local, prop_local,
index) - value);
2538 opop->operation = other_op;
2546 RNA_PROPERTY_SET_SINGLE(
int, ptr_storage, prop_storage,
index,
b);
2550 BLI_assert_msg(0,
"Unsupported RNA override diff operation on integer");
2557 float prop_min, prop_max;
2560 if (is_array &&
index == -1) {
2562 float *array_a, *array_b;
2569 switch (opop->operation) {
2581 for (
int i = len_local; i--;) {
2582 array_b[i] = fac * (array_b[i] - array_a[i]);
2583 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2584 opop->operation = other_op;
2585 for (
int j = len_local; j--;) {
2586 array_b[j] = j >= i ? -array_b[j] : fac * (array_a[j] - array_b[j]);
2587 if (array_b[j] < prop_min || array_b[j] > prop_max) {
2602 if (array_b != array_stack_b) {
2603 MEM_delete(array_b);
2613 for (
int i = len_local; i--;) {
2614 array_b[i] = array_a[i] == 0.0f ? array_b[i] : array_b[i] / array_a[i];
2615 if (array_b[i] < prop_min || array_b[i] > prop_max) {
2625 if (array_b != array_stack_b) {
2626 MEM_delete(array_b);
2631 BLI_assert_msg(0,
"Unsupported RNA override diff operation on float");
2635 if (array_a != array_stack_a) {
2636 MEM_delete(array_a);
2640 const float value = RNA_PROPERTY_GET_SINGLE(
float, ptr_reference, prop_reference,
index);
2642 switch (opop->operation) {
2649 float b = fac * (RNA_PROPERTY_GET_SINGLE(
float, ptr_local, prop_local,
index) - value);
2651 opop->operation = other_op;
2659 RNA_PROPERTY_SET_SINGLE(
float, ptr_storage, prop_storage,
index,
b);
2664 (value == 0.0f ? 1.0f : value);
2674 BLI_assert_msg(0,
"Unsupported RNA override diff operation on float");
2682 BLI_assert_msg(0,
"Enum properties support no override diff operation");
2685 BLI_assert_msg(0,
"Pointer properties support no override diff operation");
2688 BLI_assert_msg(0,
"String properties support no override diff operation");
2692 BLI_assert_msg(0,
"Collection properties support no override diff operation");
2702 RNAPropertyOverrideApplyContext &rnaapply_ctx)
2704 PointerRNA *ptr_dst = &rnaapply_ctx.ptr_dst;
2705 PointerRNA *ptr_src = &rnaapply_ctx.ptr_src;
2706 PointerRNA *ptr_storage = &rnaapply_ctx.ptr_storage;
2707 PropertyRNA *prop_dst = rnaapply_ctx.prop_dst;
2708 PropertyRNA *prop_src = rnaapply_ctx.prop_src;
2709 PropertyRNA *prop_storage = rnaapply_ctx.prop_storage;
2710 const int len_dst = rnaapply_ctx.len_src;
2711 const int len_src = rnaapply_ctx.len_src;
2712 const int len_storage = rnaapply_ctx.len_storage;
2713 IDOverrideLibraryPropertyOperation *opop = rnaapply_ctx.liboverride_operation;
2720 if (prop_src_type != prop_dst_type ||
2723 std::optional<std::string> prop_rna_path = rnaapply_ctx.liboverride_property ?
2724 rnaapply_ctx.liboverride_property->rna_path :
2727 "%s.%s: Inconsistency between stored property type (%d) and linked reference one "
2728 "(%d), skipping liboverride apply",
2729 ptr_dst->owner_id->name,
2730 prop_rna_path ? prop_rna_path->c_str() :
2731 fmt::format(
" ... .{}", prop_dst->name).c_str(),
2735 if (rnaapply_ctx.liboverride_property) {
2736 rnaapply_ctx.liboverride_property->rna_prop_type = prop_dst_type;
2741 BLI_assert(len_dst == len_src && (!prop_storage || len_dst == len_storage));
2744 const bool is_array = len_dst > 0;
2745 const int index = is_array ? opop->subitem_reference_index : 0;
2748 bool ret_success =
true;
2752 if (is_array &&
index == -1) {
2762 switch (override_op) {
2768 "Unsupported '%s' RNA override operation on boolean array",
2773 if (array_a != array_stack_a) {
2774 MEM_delete(array_a);
2778 const bool value = RNA_PROPERTY_GET_SINGLE(
boolean, ptr_src, prop_src,
index);
2780 switch (override_op) {
2782 RNA_PROPERTY_SET_SINGLE(
boolean, ptr_dst, prop_dst,
index, value);
2786 "Unsupported '%s' RNA override operation on boolean",
2793 if (is_array &&
index == -1) {
2795 int *array_a, *array_b;
2801 switch (override_op) {
2813 if (override_op == LIBOVERRIDE_OP_ADD) {
2814 for (
int i = len_dst; i--;) {
2815 array_a[i] += array_b[i];
2819 for (
int i = len_dst; i--;) {
2820 array_a[i] -= array_b[i];
2824 if (array_b != array_stack_b) {
2825 MEM_delete(array_b);
2830 "Unsupported '%s' RNA override operation on integer array",
2835 if (array_a != array_stack_a) {
2836 MEM_delete(array_a);
2840 const int storage_value = prop_storage ? RNA_PROPERTY_GET_SINGLE(
2841 int, ptr_storage, prop_storage,
index) :
2844 switch (override_op) {
2846 RNA_PROPERTY_SET_SINGLE(
int,
2850 RNA_PROPERTY_GET_SINGLE(
int, ptr_src, prop_src,
index));
2853 RNA_PROPERTY_SET_SINGLE(
int,
2857 RNA_PROPERTY_GET_SINGLE(
int, ptr_dst, prop_dst,
index) -
2861 RNA_PROPERTY_SET_SINGLE(
int,
2865 RNA_PROPERTY_GET_SINGLE(
int, ptr_dst, prop_dst,
index) -
2870 "Unsupported '%s' RNA override operation on integer",
2877 if (is_array &&
index == -1) {
2879 float *array_a, *array_b;
2885 switch (override_op) {
2898 if (override_op == LIBOVERRIDE_OP_ADD) {
2899 for (
int i = len_dst; i--;) {
2900 array_a[i] += array_b[i];
2903 else if (override_op == LIBOVERRIDE_OP_SUBTRACT) {
2904 for (
int i = len_dst; i--;) {
2905 array_a[i] -= array_b[i];
2909 for (
int i = len_dst; i--;) {
2910 array_a[i] *= array_b[i];
2914 if (array_b != array_stack_b) {
2915 MEM_delete(array_b);
2920 "Unsupported '%s' RNA override operation on float array",
2925 if (array_a != array_stack_a) {
2926 MEM_delete(array_a);
2930 const float storage_value = prop_storage ? RNA_PROPERTY_GET_SINGLE(
2931 float, ptr_storage, prop_storage,
index) :
2934 switch (override_op) {
2936 RNA_PROPERTY_SET_SINGLE(
float,
2940 RNA_PROPERTY_GET_SINGLE(
float, ptr_src, prop_src,
index));
2943 RNA_PROPERTY_SET_SINGLE(
float,
2947 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst,
index) +
2951 RNA_PROPERTY_SET_SINGLE(
float,
2955 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst,
index) -
2959 RNA_PROPERTY_SET_SINGLE(
float,
2963 RNA_PROPERTY_GET_SINGLE(
float, ptr_dst, prop_dst,
index) *
2968 "Unsupported '%s' RNA override operation on float",
2977 switch (override_op) {
2984 "Unsupported '%s' RNA override operation on enum",
2993 switch (override_op) {
2999 "Unsupported '%s' RNA override operation on pointer",
3009 switch (override_op) {
3015 "Unsupported '%s' RNA override operation on string",
3020 if (value != buff) {
3027 const bool is_src_idprop = (prop_src->magic !=
RNA_MAGIC) ||
3028 (prop_src->flag & PROP_IDPROPERTY) != 0;
3029 const bool is_dst_idprop = (prop_dst->magic !=
RNA_MAGIC) ||
3030 (prop_dst->flag & PROP_IDPROPERTY) != 0;
3031 if (!(is_src_idprop && is_dst_idprop)) {
3033 "'%s': Override operations on RNA collections require a specific override "
3034 "apply callback to be defined.",
3035 rnaapply_ctx.liboverride_property->rna_path);
3039 switch (override_op) {
3041 PointerRNA item_ptr_src, item_ptr_ref, item_ptr_dst;
3043 bool is_valid =
false;
3044 if (opop->subitem_local_name !=
nullptr && opop->subitem_local_name[0] !=
'\0') {
3046 int item_index_src, item_index_ref;
3048 ptr_src, prop_src, opop->subitem_local_name, &item_ptr_src, &item_index_src) &&
3051 opop->subitem_reference_name,
3056 item_index_dst = item_index_ref + 1;
3059 if (!is_valid && opop->subitem_local_index >= 0) {
3062 ptr_src, prop_src, opop->subitem_local_index, &item_ptr_src) &&
3064 ptr_dst, prop_dst, opop->subitem_reference_index, &item_ptr_ref))
3066 item_index_dst = opop->subitem_reference_index + 1;
3090 IDProperty *item_idprop_src =
static_cast<IDProperty *
>(item_ptr_src.data);
3091 IDProperty *item_idprop_dst =
static_cast<IDProperty *
>(item_ptr_dst.data);
3095 ptr_dst, prop_dst, item_index_added, item_index_dst) ==
3096 eRNAStatus::Success;
3101 "Unsupported '%s' RNA override operation on collection",
3120# undef RNA_PROPERTY_GET_SINGLE
3121# undef RNA_PROPERTY_SET_SINGLE
3131static void rna_PrimitiveString_value_get(PointerRNA *ptr,
char *result)
3133 const PrimitiveStringRNA *
data =
static_cast<const PrimitiveStringRNA *
>(ptr->data);
3134 strcpy(result,
data->value ?
data->value :
"");
3137static int rna_PrimitiveString_value_length(PointerRNA *ptr)
3139 const PrimitiveStringRNA *
data =
static_cast<const PrimitiveStringRNA *
>(ptr->data);
3140 return data->value ? strlen(
data->value) : 0;
3145static int rna_PrimitiveInt_value_get(PointerRNA *ptr)
3147 const PrimitiveIntRNA *
data =
static_cast<const PrimitiveIntRNA *
>(ptr->data);
3153static float rna_PrimitiveFloat_value_get(PointerRNA *ptr)
3155 const PrimitiveFloatRNA *
data =
static_cast<const PrimitiveFloatRNA *
>(ptr->data);
3161static bool rna_PrimitiveBoolean_value_get(PointerRNA *ptr)
3163 const PrimitiveBooleanRNA *
data =
static_cast<const PrimitiveBooleanRNA *
>(ptr->data);
3193 prop,
"rna_Struct_identifier_get",
"rna_Struct_identifier_length",
nullptr);
3200 prop,
"rna_Struct_description_get",
"rna_Struct_description_length",
nullptr);
3206 "rna_Struct_translation_context_get",
3207 "rna_Struct_translation_context_length",
3210 prop,
"Translation Context",
"Translation context of the struct's name");
3225 "Struct in which this struct is always nested, and to which it logically belongs");
3237 "rna_Struct_properties_begin",
3238 "rna_Struct_properties_next",
3239 "rna_iterator_listbase_end",
3240 "rna_Struct_properties_get",
3251 "rna_Struct_functions_begin",
3252 "rna_iterator_array_next",
3253 "rna_iterator_array_end",
3254 "rna_Struct_functions_get",
3265 "rna_Struct_property_tags_begin",
3266 "rna_iterator_array_next",
3267 "rna_iterator_array_end",
3268 "rna_iterator_array_get",
3274 prop,
"Property Tags",
"Tags that properties can use to influence behavior");
3282 {0,
nullptr, 0,
nullptr,
nullptr},
3294 prop,
"rna_Property_name_get",
"rna_Property_name_length",
nullptr);
3300 prop,
"rna_Property_identifier_get",
"rna_Property_identifier_length",
nullptr);
3307 prop,
"rna_Property_description_get",
"rna_Property_description_length",
nullptr);
3313 "rna_Property_translation_context_get",
3314 "rna_Property_translation_context_length",
3317 prop,
"Translation Context",
"Translation context of the property's name");
3337 prop,
"Base",
"Struct definition used for properties assigned to this item");
3371 prop,
"Required",
"False when this property is an optional argument in an RNA function");
3378 "Optional Argument",
3379 "True when the property is optional in a Python function implementing an RNA function");
3405 prop,
"Return",
"True when this property is an output value from an RNA function");
3411 prop,
"Registered",
"Property is registered as part of type registration");
3417 "Registered Optionally",
3418 "Property is optionally registered as part of type registration");
3434 prop,
"Library Editable",
"Property is editable from linked instances (changes not saved)");
3440 prop,
"Path Output",
"Property is a filename, filepath or directory output");
3445 prop,
"rna_Property_is_path_supports_blend_relative_flag_get",
nullptr);
3449 "Property is a path which supports the \"//\" prefix, "
3450 "signifying the location as relative to the \".blend\" file's directory");
3455 prop,
"rna_Property_is_path_supports_templates_flag_get",
nullptr);
3458 "Variable Expression Support",
3459 "Property is a path which supports the \"{variable_name}\" variable expression syntax, "
3460 "which substitutes the value of the referenced variable in place of the expression");
3470 prop,
"rna_Property_deprecated_note_get",
"rna_Property_deprecated_note_length",
nullptr);
3484 prop,
"Deprecated Removal Version",
"The Blender version this is expected to be removed");
3486 prop,
"rna_Property_deprecated_removal_version_get",
nullptr,
nullptr);
3494 prop,
"Tags",
"Subset of tags (defined in parent struct) that are set for this property");
3515 prop,
"rna_Function_identifier_get",
"rna_Function_identifier_length",
nullptr);
3522 prop,
"rna_Function_description_get",
"rna_Function_description_length",
nullptr);
3529 "rna_Function_parameters_begin",
3530 "rna_iterator_listbase_next",
3531 "rna_iterator_listbase_end",
3532 "rna_iterator_listbase_get",
3543 prop,
"Registered",
"Function is registered as callback as part of type registration");
3550 "Registered Optionally",
3551 "Function is optionally registered as callback part of type registration");
3559 "Function does not pass itself as an argument (becomes a static method in Python)");
3566 "Function passes itself type as an argument (becomes a class method "
3567 "in Python if use_self is false)");
3600 prop,
"rna_NumberProperty_default_array_get_length");
3648 "Hard minimum, trying to assign a value below will silently assign this minimum instead");
3661 "Hard maximum, trying to assign a value above will silently assign this maximum instead");
3674 "Soft minimum (>= hard_min), user cannot drag widgets below this value in the UI");
3687 "Soft maximum (<= hard_max), user cannot drag widgets above this value in the UI");
3698 prop,
"Step",
"Step size used by number buttons, for floats 1/100th of the step size");
3706 "Number of digits after the dot used by buttons. Fraction is "
3707 "automatically hidden for exact integer values of fields with unit "
3708 "'NONE' or 'TIME' (frame count) and step divisible by 100.");
3719 prop,
"rna_StringProperty_default_get",
"rna_StringProperty_default_length",
nullptr);
3726 prop,
"Maximum Length",
"Maximum length of the string, 0 means unlimited");
3737 prop,
"rna_EnumProperty_default_get",
nullptr,
"rna_EnumProperty_default_itemf");
3746 prop,
"rna_EnumProperty_default_get",
nullptr,
"rna_EnumProperty_default_itemf");
3753 "rna_EnumProperty_items_begin",
3754 "rna_iterator_array_next",
3755 "rna_iterator_array_end",
3756 "rna_iterator_array_get",
3767 "rna_EnumProperty_items_begin",
3768 "rna_iterator_array_next",
3769 "rna_iterator_array_end",
3770 "rna_iterator_array_get",
3778 "Possible values for the property (never calls optional dynamic generation of those)");
3786 "rna_EnumProperty_items_ui_begin",
3787 "rna_iterator_array_next",
3788 "rna_iterator_array_end",
3789 "rna_iterator_array_get",
3796 "Static Items with UI Elements",
3797 "Possible values for the property (never calls optional dynamic generation of those). "
3798 "Includes UI elements (separators and section headings).");
3803 srna,
"Enum Item Definition",
"Definition of a choice in an RNA enum property");
3809 prop,
"rna_EnumPropertyItem_name_get",
"rna_EnumPropertyItem_name_length",
nullptr);
3815 "rna_EnumPropertyItem_description_get",
3816 "rna_EnumPropertyItem_description_length",
3823 "rna_EnumPropertyItem_identifier_get",
3824 "rna_EnumPropertyItem_identifier_length",
3850 prop,
"rna_PointerProperty_fixed_type_get",
nullptr,
nullptr,
nullptr);
3854 prop,
"rna_CollectionProperty_fixed_type_get",
nullptr,
nullptr,
nullptr);
3872 prop,
"rna_PrimitiveString_value_get",
"rna_PrimitiveString_value_length",
nullptr);
3918 "RNA floating-point number (single precision) property definition");
3931 "RNA enumeration property definition, to choose from a number of predefined options");
3937 srna,
"Pointer Definition",
"RNA pointer property to point to another RNA struct");
3943 "Collection Definition",
3944 "RNA collection property to define lists, arrays and mappings");
3960 "rna_BlenderRNA_structs_begin",
3961 "rna_iterator_array_next",
3962 "rna_iterator_array_end",
3963 "rna_iterator_array_dereference_get",
3971 "rna_BlenderRNA_structs_length",
3972 "rna_BlenderRNA_structs_lookup_int",
3973 "rna_BlenderRNA_structs_lookup_string",
#define BLT_I18NCONTEXT_UNIT
#define CLOG_ERROR(clg_ref,...)
#define CLOG_DEBUG(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Read Blender memory allocation and freeing.
#define RNA_MAX_ARRAY_DIMENSION
#define BLI_assert_unreachable()
#define ARRAY_SET_ITEMS(...)
#define UNUSED_VARS_NDEBUG(...)
#define BLI_assert_msg(a, msg)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str)
void free(Subdiv *subdiv)
constexpr toml::spec version
IDProperty * rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
@ RNA_OVERRIDE_MATCH_RESULT_CREATED
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
const EnumPropertyItem rna_enum_property_flag_items[]
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
static void rna_def_string_property(StructRNA *srna)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
@ STRUCT_PUBLIC_NAMESPACE
static constexpr auto PROP_SKIP_SAVE_DESCR
void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
const char * RNA_property_ui_name_raw(const PropertyRNA *prop, const PointerRNA *ptr)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
const EnumPropertyItem rna_enum_property_string_search_flag_items[]
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
static constexpr auto PROP_PROPORTIONAL_DESCR
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
StringRefNull BKE_lib_override_operation_as_string(const eID_OverrideLib_Op operation)
void RNA_def_rna(BlenderRNA *brna)
std::optional< std::string > RNA_path_from_ID_to_property(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
eRNAStatus RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int src_index, int dst_index)
bool rna_struct_override_type_matches(const StructRNA *type_a, const StructRNA *type_b)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
static constexpr auto PROP_ENUM_FLAG_DESCR
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
const EnumPropertyItem rna_enum_property_unit_items[]
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
@ PROP_UNIT_TIME_ABSOLUTE
@ PROP_UNIT_COLOR_TEMPERATURE
const EnumPropertyItem rna_enum_property_subtype_items[]
bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode)
@ LIBOVERRIDE_PROP_OP_TAG_UNUSED
PointerRNA RNA_property_pointer_get_never_create(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
PropertyUnit RNA_property_unit(PropertyRNA *prop)
static void rna_def_property(BlenderRNA *brna)
static constexpr auto PROP_LIB_EXCEPTION_DESCR
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
const char * RNA_property_translation_context(const PropertyRNA *prop)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
@ RNA_OVERRIDE_COMPARE_CREATE
uint RNA_enum_items_count(const EnumPropertyItem *item)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void rna_builtin_properties_next(CollectionPropertyIterator *iter)
static const EnumPropertyItem rna_enum_property_item_library_overridable
@ LIBOVERRIDE_OP_INSERT_AFTER
@ LIBOVERRIDE_OP_SUBTRACT
@ LIBOVERRIDE_OP_MULTIPLY
const EnumPropertyItem rna_enum_property_subtype_string_items[]
void rna_iterator_listbase_end(CollectionPropertyIterator *)
static constexpr auto PROP_ANIMATABLE_DESCR
@ PROPOVERRIDE_NO_PROP_NAME
@ PROPOVERRIDE_LIBRARY_INSERTION
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
void rna_property_override_diff_default(Main *bmain, RNAPropertyOverrideDiffContext &rnadiff_ctx)
static constexpr auto PROP_PATH_SUPPORTS_TEMPLATES_DESCR
void IDP_CopyPropertyContent(IDProperty *dst, const IDProperty *src) ATTR_NONNULL()
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
PropertyType RNA_property_type(PropertyRNA *prop)
const EnumPropertyItem rna_enum_property_override_flag_collection_items[]
const EnumPropertyItem rna_enum_property_type_items[]
bool RNA_property_is_runtime(const PropertyRNA *prop)
static constexpr auto PROP_READ_ONLY_DESCR
static constexpr auto PROP_PATH_OUTPUT_DESCR
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
const EnumPropertyItem rna_enum_property_subtype_number_array_items[]
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
@ PROP_STRING_SEARCH_SORT
@ PROP_STRING_SEARCH_SUGGESTION
int RNA_property_tags(PropertyRNA *prop)
@ IDP_FLAG_OVERRIDABLE_LIBRARY
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_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
BMesh const char void * data
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)
IDProperty * RNA_struct_idprops(PointerRNA *ptr, bool create)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
static constexpr auto PROP_SKIP_PRESET_DESCR
void BKE_lib_override_library_operations_tag(IDOverrideLibraryProperty *liboverride_property, eID_OverrideLib_PropTag tag, bool do_set)
bool RNA_struct_override_matches(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, const char *root_path, const size_t root_path_len, IDOverrideLibrary *liboverride, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags)
PointerRNA rna_builtin_properties_get(CollectionPropertyIterator *iter)
const char * RNA_property_ui_description_raw(const PropertyRNA *prop, const PointerRNA *ptr)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void BKE_lib_override_library_property_operation_delete(IDOverrideLibraryProperty *liboverride_property, IDOverrideLibraryPropertyOperation *liboverride_property_operation)
bool rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_property_flag_enum_items[]
IDOverrideLibraryProperty * BKE_lib_override_library_property_find(IDOverrideLibrary *liboverride, const char *rna_path)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
PointerRNA rna_builtin_type_get(PointerRNA *ptr)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
static void rna_def_pointer_property(StructRNA *srna, PropertyType type)
static constexpr auto PROP_TEXTEDIT_UPDATE_DESCR
bool RNA_struct_is_ID(const StructRNA *type)
const EnumPropertyItem rna_enum_property_override_flag_items[]
const DeprecatedRNA * RNA_property_deprecated(const PropertyRNA *prop)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_property_collection_next(CollectionPropertyIterator *iter)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_struct_flag(StructRNA *srna, StructFlag flag)
const EnumPropertyItem rna_enum_property_subtype_number_items[]
static void rna_def_rna_primitive(BlenderRNA *brna)
IDOverrideLibraryProperty * BKE_lib_override_library_property_get(IDOverrideLibrary *liboverride, const char *rna_path, bool *r_created)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ PROP_PATH_SUPPORTS_TEMPLATES
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
@ ID_TAG_LIBOVERRIDE_NEED_RESYNC
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * rna_ensure_property(PropertyRNA *prop)
int RNA_property_ui_icon(const PropertyRNA *prop)
bool RNA_property_collection_lookup_string_index(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr, int *r_index)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
static FunctionRNA * rna_def_function(StructRNA *srna, const UString identifier)
static void rna_def_struct(BlenderRNA *brna)
@ PARM_PYFUNC_REGISTER_OPTIONAL
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
static constexpr auto PROP_PATH_RELATIVE_DESCR
const EnumPropertyItem rna_enum_icon_items[]
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
static void rna_def_number_property(StructRNA *srna, PropertyType type)
bool rna_property_override_store_default(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, PointerRNA *ptr_storage, PropertyRNA *prop_local, PropertyRNA *prop_reference, PropertyRNA *prop_storage, int len_local, int len_reference, int len_storage, IDOverrideLibraryPropertyOperation *opop)
void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
void RNA_def_property_array(PropertyRNA *prop, int length)
IDOverrideLibraryPropertyOperation * BKE_lib_override_library_property_operation_get(IDOverrideLibraryProperty *liboverride_property, eID_OverrideLib_Op operation, const char *subitem_refname, const char *subitem_locname, const std::optional< ID * > &subitem_refid, const std::optional< ID * > &subitem_locid, int subitem_refindex, int subitem_locindex, bool strict, bool *r_strict, bool *r_created)
@ LIBOVERRIDE_OP_FLAG_IDPOINTER_MATCH_REFERENCE
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
bool rna_property_override_apply_default(Main *bmain, RNAPropertyOverrideApplyContext &rnaapply_ctx)
bool(*)(CollectionPropertyIterator *iter, void *data) IteratorSkipFunc
void rna_iterator_listbase_next(CollectionPropertyIterator *iter)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
static constexpr auto PROP_HIDDEN_DESCR
#define RNA_PATH_BUFFSIZE
#define RNA_ENUM_PROPERTY_SUBTYPE_STRING_ITEMS
#define RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ARRAY_ITEMS
#define RNA_ENUM_PROPERTY_SUBTYPE_NUMBER_ITEMS
Vector< std::unique_ptr< StructRNA > > structs