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 <montagne29@wanadoo.fr>2016-07-29 18:00:29 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-07-29 18:00:29 +0300
commitcdc7a24d7b56aed874aefe4d37c6acb1cfcae346 (patch)
treecf0d5d9b243a39f52179d2deb4855808329cb29c /source/blender/blenkernel/intern/library.c
parent821394937f3da8e3275551e4b1263bb2d84d9471 (diff)
Fix T48971: Append creates linked image textures if object has shape keys.
Hating all those not-so-real ID types... Here there were two causes for the issue: 1) Linked shapekey ID was made local twice (once from mesh's make local, once by itself). Solved by not explicitely making shapekeys (nor any other non-linkable datatype) local. 2) Key->from 'back pointer' to its owner was messing 'still in used' detection of linked data after localization. Fixed with a hack for now, thinking correct solution might actually be to not consider this pointer at all in libquery ID looper, since it's nothing like and actual usage of mesh/lattice/curve. Again, shapekeys as ID is a joke, those should be mere struct, they have absolutely nothing to do in Main, period. :( Point 2) still demonstrates the need for better handling of IDs dependencies though, so far we only hit corner cases, but think there could also be valid cases generating those 'dependency cycles' between IDs (ID a using ID b which uses ID a), this will have to be addressed some day...
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index eb0aec90cf9..5a6399145fa 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -320,7 +320,6 @@ void BKE_id_make_local_generic(Main *bmain, ID *id, const bool id_in_mainlist, c
}
}
}
-
}
/**
@@ -1634,7 +1633,15 @@ void BKE_library_make_local(Main *bmain, const Library *lib, const bool untagged
int a;
for (a = set_listbasepointers(bmain, lbarray); a--; ) {
- for (id = lbarray[a]->first; id; id = id_next) {
+ id = lbarray[a]->first;
+
+ if (!id || !BKE_idcode_is_linkable(GS(id->name))) {
+ /* Do not explicitely make local non-linkable IDs (shapekeys, in fact), they are assumed to be handled
+ * by real datablocks responsible of them. */
+ continue;
+ }
+
+ for (; id; id = id_next) {
id->newid = NULL;
id_next = id->next; /* id is possibly being inserted again */