diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-13 17:34:07 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-13 17:34:07 +0300 |
commit | 8ad2808fd74b4d74218deeb7e41e9d45e8fd5571 (patch) | |
tree | eb21ac6fabd933a11bef25b3377b8d428e320581 /source/blender/blenkernel | |
parent | 400e8c6449c88d11187fda6ea880d0126bc7c26b (diff) |
Tighten checks around unlinkable datablocks becoming LIB_EXTERN.
We have currently a gooseberry file (scenes/01_island/01_meet_franck/01_01_01_A/01_01_01_A.anim.blend)
that links against two -pre repo libs, which are hence not available for common mortals,
and generate warnings and placeholders during load step.
Issue is, among those missing (directly) linked datablocks, we have two shapekeys!
This should never happen nor be possible at all. I tried understanding how this could happen,
with no luck at all, best bet would be some wild/bad call to `id_us_plus()` over those skeys
at some point...
Anyway, this commit:
- Handles a bit better those 'cases that should never happen' at load time.
- Adds several checks in ID handling code (and save/load code) to try to detect where/when
a non-linkable datablock becomes LIB_EXTERN (i.e. directly linked).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index f7f4f1c1ab7..a315a1f68ce 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -89,6 +89,7 @@ #include "BKE_global.h" #include "BKE_group.h" #include "BKE_gpencil.h" +#include "BKE_idcode.h" #include "BKE_idprop.h" #include "BKE_image.h" #include "BKE_ipo.h" @@ -152,6 +153,7 @@ void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id) void id_lib_extern(ID *id) { if (id) { + BLI_assert(BKE_idcode_is_linkable(GS(id->name))); if (id->flag & LIB_INDIRECT) { id->flag -= LIB_INDIRECT; id->flag |= LIB_EXTERN; @@ -179,10 +181,7 @@ void id_us_plus(ID *id) if (id) { BLI_assert(id->us >= 0); id->us++; - if (id->flag & LIB_INDIRECT) { - id->flag -= LIB_INDIRECT; - id->flag |= LIB_EXTERN; - } + id_lib_extern(id); } } |