diff options
author | Bastien Montagne <bastien@blender.org> | 2020-09-25 12:50:16 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-09-25 12:52:18 +0300 |
commit | f057e92ae29ba15895ff489ef1ec0de8dc3f4cbc (patch) | |
tree | 3425079355f3d4da40e0c623a0d1a029720e56e6 | |
parent | 4a224451d1e884cb0b75d80e4a06870eb3725821 (diff) |
LibOverride: Fix some cleanup of unused override operations.
Handling of pointer replacements in collection items lead to validating
all operations for a given property, when some might actually be no more
valid and would need to be cleaned up.
Related to T81059, found while investigating it.
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index cab596c10fb..8d87de23b3a 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1306,8 +1306,6 @@ static int rna_property_override_diff_propptr(Main *bmain, /* If not yet overridden, or if we are handling sub-items (inside a collection)... */ if (op != NULL) { - BKE_lib_override_library_operations_tag(op, IDOVERRIDE_LIBRARY_TAG_UNUSED, false); - if (created || op->rna_prop_type == 0) { op->rna_prop_type = property_type; } @@ -1317,19 +1315,27 @@ static int rna_property_override_diff_propptr(Main *bmain, if (created || rna_itemname_a != NULL || rna_itemname_b != NULL || rna_itemindex_a != -1 || rna_itemindex_b != -1) { - BKE_lib_override_library_property_operation_get(op, - IDOVERRIDE_LIBRARY_OP_REPLACE, - rna_itemname_b, - rna_itemname_a, - rna_itemindex_b, - rna_itemindex_a, - true, - NULL, - &created); + IDOverrideLibraryPropertyOperation *opop; + opop = BKE_lib_override_library_property_operation_get(op, + IDOVERRIDE_LIBRARY_OP_REPLACE, + rna_itemname_b, + rna_itemname_a, + rna_itemindex_b, + rna_itemindex_a, + true, + NULL, + &created); + /* Do not use BKE_lib_override_library_operations_tag here, we do not want to validate + * as used all of its operations. */ + op->tag &= ~IDOVERRIDE_LIBRARY_TAG_UNUSED; + opop->tag &= ~IDOVERRIDE_LIBRARY_TAG_UNUSED; if (r_override_changed) { *r_override_changed = created; } } + else { + BKE_lib_override_library_operations_tag(op, IDOVERRIDE_LIBRARY_TAG_UNUSED, false); + } } } |