[Bf-blender-cvs] [051f98baf3e] master: LibOverride: Initial attempt to ignore missing place-holders IDs.

Bastien Montagne noreply at git.blender.org
Thu Sep 5 21:31:34 CEST 2019


Commit: 051f98baf3e4bb747385d04645f4ab75633b511e
Author: Bastien Montagne
Date:   Thu Sep 5 21:03:28 2019 +0200
Branches: master
https://developer.blender.org/rB051f98baf3e4bb747385d04645f4ab75633b511e

LibOverride: Initial attempt to ignore missing place-holders IDs.

Ideally, when a reference linked ID is missing (and replaced by linking
code with an empty place-holder), we should just keep the local
overriding datablocks as-is, until broken links are fixed.

Not really working yet though, needs more work here...

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

M	source/blender/blenkernel/intern/library_override.c

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

diff --git a/source/blender/blenkernel/intern/library_override.c b/source/blender/blenkernel/intern/library_override.c
index b3c628f6cb8..6453ad5e7e4 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -641,6 +641,13 @@ bool BKE_override_library_operations_create(Main *bmain, ID *local, const bool f
   bool ret = false;
 
   if (!is_template && (force_auto || local->override_library->flag & OVERRIDE_LIBRARY_AUTO)) {
+    /* Do not attempt to generate overriding rules from an empty place-holder generated by link
+     * code when it cannot find to actual library/ID. Much better to keep the local datablock as
+     * is in the file in that case, until broken lib is fixed. */
+    if (ID_MISSING(local->override_library->reference)) {
+      return ret;
+    }
+
     PointerRNA rnaptr_local, rnaptr_reference;
     RNA_id_pointer_create(local, &rnaptr_local);
     RNA_id_pointer_create(local->override_library->reference, &rnaptr_reference);
@@ -693,6 +700,13 @@ void BKE_override_library_update(Main *bmain, ID *local)
     return;
   }
 
+  /* Do not attempt to apply overriding rules over an empty place-holder generated by link code
+   * when it cannot find to actual library/ID. Much better to keep the local datablock as loaded
+   * from the file in that case, until broken lib is fixed. */
+  if (ID_MISSING(local->override_library->reference)) {
+    return;
+  }
+
   /* Recursively do 'ancestors' overrides first, if any. */
   if (local->override_library->reference->override_library &&
       (local->override_library->reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) {



More information about the Bf-blender-cvs mailing list