[Bf-blender-cvs] [b1f865f9d39] master: LibOverride: Cleanup log about unfound subitems.

Bastien Montagne noreply at git.blender.org
Thu Dec 16 17:27:47 CET 2021


Commit: b1f865f9d39a5010cc46b32c2ba64941fc6b5c2d
Author: Bastien Montagne
Date:   Thu Dec 16 10:43:50 2021 +0100
Branches: master
https://developer.blender.org/rBb1f865f9d39a5010cc46b32c2ba64941fc6b5c2d

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.

===================================================================

M	source/blender/makesrna/intern/rna_access_compare_override.c

===================================================================

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'",



More information about the Bf-blender-cvs mailing list