From a0e72a0996e86199e46988f3c225c16c4a8ebc92 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 5 Aug 2016 14:45:21 +0200 Subject: Fix T49014: Append does not work in some cases. There were actually two issues, one in recent changes and one existing... forever? I) id_make_local() would never proceed over indirectly linked data, which is required in specific 'append' context. II) BKE_image_copy() was not setting id->newid pointer of newly copied ID. About II: don't really know why image copy does its own cooking instead of using generaic ID copy helpers. Think this should be changed, but that would be after 2.78 now. --- source/blender/blenkernel/intern/image.c | 1 + source/blender/blenkernel/intern/library.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ea28dabb945..626d389ac2d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -436,6 +436,7 @@ static void copy_image_packedfiles(ListBase *lb_dst, const ListBase *lb_src) Image *BKE_image_copy(Main *bmain, Image *ima) { Image *nima = image_alloc(bmain, ima->id.name + 2, ima->source, ima->type); + ima->id.newid = &nima->id; BLI_strncpy(nima->name, ima->name, sizeof(ima->name)); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index a4bdc4b6ea3..03a2552ac31 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -332,8 +332,10 @@ void BKE_id_make_local_generic(Main *bmain, ID *id, const bool id_in_mainlist, c */ bool id_make_local(Main *bmain, ID *id, const bool test, const bool lib_local) { - if (id->tag & LIB_TAG_INDIRECT) + /* We don't care whether ID is directly or indirectly linked in case we are making a whole lib local... */ + if (!lib_local && (id->tag & LIB_TAG_INDIRECT)) { return false; + } switch ((ID_Type)GS(id->name)) { case ID_SCE: -- cgit v1.2.3