[Bf-blender-cvs] [1d0017089c6] master: Fix (unreported) disapearance of some overrides after save & reload.

Bastien Montagne noreply at git.blender.org
Wed Jun 10 16:49:00 CEST 2020


Commit: 1d0017089c6ad4bd9b87af1bb30024a86e7b2771
Author: Bastien Montagne
Date:   Wed Jun 10 16:13:50 2020 +0200
Branches: master
https://developer.blender.org/rB1d0017089c6ad4bd9b87af1bb30024a86e7b2771

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.

===================================================================

M	source/blender/makesrna/intern/rna_rna.c

===================================================================

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;
+            }
           }
         }
       }



More information about the Bf-blender-cvs mailing list