Fix #118696: Nested override libraries can cause persistent resync warning.

The root of the issue was checking against the wrong RNA type to decide
whether a collection's item resolution could use the stored ID pointers
or not, leading to always only relying on names in CollectionObjects
case, leading to a lot of false 'need resync' detections in case names
would get out of sync between liboverrides and linked reference data.

Note that this probably had no other effect than resyncing when not
needed, since actual liboverride apply and resync code would already
do the right thing here.
This commit is contained in:
Bastien Montagne 2024-03-28 15:29:50 +09:00
parent b4517ca148
commit e7abad23e0
1 changed files with 1 additions and 3 deletions

View File

@ -1103,9 +1103,7 @@ static void rna_property_override_collection_subitem_name_index_lookup(
RNA_POINTER_INVALIDATE(r_ptr_item_name);
RNA_POINTER_INVALIDATE(r_ptr_item_index);
PointerRNA collection_ptr_type;
RNA_property_collection_type_get(ptr, prop, &collection_ptr_type);
const bool do_id_pointer = item_id && RNA_struct_is_ID(collection_ptr_type.type);
const bool do_id_pointer = item_id && RNA_struct_is_ID(RNA_property_pointer_type(ptr, prop));
const int item_name_len = item_name ? int(strlen(item_name)) : 0;