Fix (unreported) LibOverride diffing generating operations for non-editable properties.

Non-pointer-like properties that are not editable should never generate
override operations.

While harmless (those would never be applied back anyway), better not
clutter override operations list, and also enjoy the symbolic
performances improvement here.

NOTE: Pointer-like properties (pointers and collections) remain
processed as usual here since they usually imply recursivity. We could
make an exception to the exception for ID pointers, but for now I don't
think this is worth it.
This commit is contained in:
Bastien Montagne 2021-07-14 12:52:14 +02:00
parent c9e9a42215
commit 3de3c3c23a
1 changed files with 3 additions and 1 deletions

View File

@ -422,7 +422,9 @@ static int rna_property_override_diff(Main *bmain,
bool override_changed = false;
eRNAOverrideMatch diff_flags = flags;
if (!RNA_property_overridable_get(&prop_a->ptr, prop_a->rawprop)) {
if (!RNA_property_overridable_get(&prop_a->ptr, prop_a->rawprop) ||
(!ELEM(RNA_property_type(prop_a->rawprop), PROP_POINTER, PROP_COLLECTION) &&
!RNA_property_editable_flag(&prop_a->ptr, prop_a->rawprop))) {
diff_flags &= ~RNA_OVERRIDE_COMPARE_CREATE;
}
const int diff = override_diff(bmain,