Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/makesrna/intern/rna_access_compare_override.c26
-rw-r--r--source/blender/makesrna/intern/rna_collection.c6
2 files changed, 28 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index c97f5c4c52e..40b04399ac9 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -908,9 +908,18 @@ static void rna_property_override_apply_ex(Main *bmain,
if (opop->subitem_local_name != NULL) {
RNA_property_collection_lookup_string(
ptr_src, prop_src, opop->subitem_local_name, &private_ptr_item_src);
- if (opop->subitem_reference_name != NULL) {
- RNA_property_collection_lookup_string(
- ptr_dst, prop_dst, opop->subitem_reference_name, &private_ptr_item_dst);
+ if (opop->subitem_reference_name != NULL &&
+ RNA_property_collection_lookup_string(
+ ptr_dst, prop_dst, opop->subitem_reference_name, &private_ptr_item_dst)) {
+ /* This is rather fragile, but the fact that local override IDs may have a different name
+ * than their linked reference makes it necessary.
+ * Basically, here we are considering that if we cannot find the original linked ID in
+ * the local override we are (re-)applying the operations, then it may be because soe of
+ * those operations have already been applied, and we may already have the local ID
+ * pointer we want to set.
+ * This happens e.g. during resync of an override, since we have already remapped all ID
+ * pointers to their expected values.
+ * In that case we simply try to get the property from the local expected name. */
}
else {
RNA_property_collection_lookup_string(
@@ -962,6 +971,17 @@ static void rna_property_override_apply_ex(Main *bmain,
ptr_item_dst = &private_ptr_item_dst;
ptr_item_src = &private_ptr_item_src;
ptr_item_storage = &private_ptr_item_storage;
+
+ if (ptr_item_dst->type == NULL) {
+ printf("Failed to find destination sub-item '%s' in new override data '%s'\n",
+ opop->subitem_reference_name,
+ ptr_dst->owner_id->name);
+ }
+ if (ptr_item_src->type == NULL) {
+ printf("Failed to find source sub-item '%s' in old override data '%s'\n",
+ opop->subitem_local_name,
+ ptr_src->owner_id->name);
+ }
}
if (!rna_property_override_operation_apply(bmain,
diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c
index b0250897d6d..69f8bd85975 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -167,13 +167,17 @@ static bool rna_Collection_objects_override_apply(Main *bmain,
Collection *coll_dst = (Collection *)ptr_dst->owner_id;
if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
- BLI_assert(0 && "invalid source or destination object.");
+ // BLI_assert(0 && "invalid source or destination object.");
return false;
}
Object *ob_dst = ptr_item_dst->data;
Object *ob_src = ptr_item_src->data;
+ if (ob_src == ob_dst) {
+ return true;
+ }
+
CollectionObject *cob_dst = BLI_findptr(
&coll_dst->gobject, ob_dst, offsetof(CollectionObject, ob));