From b1f865f9d39a5010cc46b32c2ba64941fc6b5c2d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 16 Dec 2021 10:43:50 +0100 Subject: LibOverride: Cleanup log about unfound subitems. Not finding subitem when its name and index are invalid/unset is expected behavior, and does happen when e.g. inserting a new constraint or modifier at the begining of the stack. --- source/blender/makesrna/intern/rna_access_compare_override.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 8cc6a095c1d..35af92592e9 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -1059,7 +1059,12 @@ static void rna_porperty_override_collection_subitem_lookup( *r_ptr_item_storage = private_ptr_item_storage; } - if ((*r_ptr_item_dst)->type == NULL) { + /* Note that there is no reason to report in case no item is expected, i.e. in case subitem name + * and index are invalid. This can often happen when inserting new items (constraint, + * modifier...) in a collection that supports it. */ + if ((*r_ptr_item_dst)->type == NULL && + ((opop->subitem_reference_name != NULL && opop->subitem_reference_name[0] != '\0') || + opop->subitem_reference_index != -1)) { CLOG_INFO(&LOG, 2, "Failed to find destination sub-item '%s' (%d) of '%s' in new override data '%s'", @@ -1068,7 +1073,9 @@ static void rna_porperty_override_collection_subitem_lookup( op->rna_path, ptr_dst->owner_id->name); } - if ((*r_ptr_item_src)->type == NULL) { + if ((*r_ptr_item_src)->type == NULL && + ((opop->subitem_local_name != NULL && opop->subitem_local_name[0] != '\0') || + opop->subitem_local_index != -1)) { CLOG_INFO(&LOG, 2, "Failed to find source sub-item '%s' (%d) of '%s' in old override data '%s'", -- cgit v1.2.3