Fix T79633: ovrride apply code broken with RNA-defined runtime IDProps in some cases.

When copying between a set RNA runtime property and an unset one, code
would not behave properly.

We have to also consider NULL 'override apply' callback pointer as a
valid 'use default override apply function' case.
This commit is contained in:
Bastien Montagne
2020-08-17 16:42:28 +02:00
parent 8010cbe620
commit c7a7a38b65

View File

@@ -484,13 +484,13 @@ static bool rna_property_override_operation_apply(Main *bmain,
/* Special case for IDProps, we use default callback then. */
if (prop_dst->magic != RNA_MAGIC) {
override_apply = rna_property_override_apply_default;
if (prop_src->magic == RNA_MAGIC && prop_src->override_apply != override_apply) {
if (prop_src->magic == RNA_MAGIC && !ELEM(prop_src->override_apply, NULL, override_apply)) {
override_apply = NULL;
}
}
else if (prop_src->magic != RNA_MAGIC) {
override_apply = rna_property_override_apply_default;
if (prop_dst->override_apply != override_apply) {
if (!ELEM(prop_dst->override_apply, NULL, override_apply)) {
override_apply = NULL;
}
}