LibOverride: Fix diffing code not always cleaning unused operations.
In RNA collections cases, the cleaning code was buggy and could end up never cleaning actually unused liboverride operations, resulting in sometimes tens of garbage operations on e.g. Collection's objects list. This was a fairly severe bug, since it could lead to very broken overrides of collections in some cases when things start to get broken in the production file, amplifying greatly initially small issues.
This commit is contained in:
@@ -823,7 +823,9 @@ bool RNA_struct_override_matches(Main *bmain,
|
||||
op ? op->operations.first : nullptr);
|
||||
|
||||
if (op != nullptr) {
|
||||
BKE_lib_override_library_operations_tag(op, LIBOVERRIDE_PROP_OP_TAG_UNUSED, false);
|
||||
/* Do not use #BKE_lib_override_library_operations_tag here, in collection case some of the
|
||||
* operations may still be unused. */
|
||||
op->tag &= ~LIBOVERRIDE_PROP_OP_TAG_UNUSED;
|
||||
}
|
||||
|
||||
if ((do_restore || do_tag_for_restore) &&
|
||||
|
||||
@@ -1455,6 +1455,7 @@ static int rna_property_override_diff_propptr(Main *bmain,
|
||||
rna_itemindex_a,
|
||||
true,
|
||||
NULL);
|
||||
opop->tag &= ~LIBOVERRIDE_PROP_OP_TAG_UNUSED;
|
||||
BLI_assert(opop != NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user