Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-10 17:13:50 +0300
committerBastien Montagne <bastien@blender.org>2020-06-10 17:48:49 +0300
commit1d0017089c6ad4bd9b87af1bb30024a86e7b2771 (patch)
treeed3a40f7aeb8f1124640f62cf7e0669a8ce35d8a
parent3ea04d3e11e0b1b26ff55890f20314648b5e2f08 (diff)
Fix (unreported) disapearance of some overrides after save & reload.
The override operations generated from 'do not follow' RNA pointer properties (i.e. pointers to other IDs) were not properly clearing their 'no more used' flag, and hence were incorrectly deleted on second save.
-rw-r--r--source/blender/makesrna/intern/rna_rna.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 4ee144e9031..d7e93975d31 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1294,19 +1294,23 @@ static int rna_property_override_diff_propptr(Main *bmain,
override, rna_path, &created);
/* If not yet overridden, or if we are handling sub-items (inside a collection)... */
- if (op != NULL && (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);
- if (r_override_changed) {
- *r_override_changed = created;
+ if (op != NULL) {
+ BKE_lib_override_library_operations_tag(op, IDOVERRIDE_LIBRARY_TAG_UNUSED, false);
+
+ 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);
+ if (r_override_changed) {
+ *r_override_changed = created;
+ }
}
}
}