diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-05 22:03:28 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-05 22:31:01 +0300 |
commit | 051f98baf3e4bb747385d04645f4ab75633b511e (patch) | |
tree | 0d37266847e93d2e9627346624db608f7eba6c81 /source/blender | |
parent | 5f4caa8c4fc393e6519b810fc095b4c339266251 (diff) |
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...
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/library_override.c | 14 |
1 files changed, 14 insertions, 0 deletions
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) { |