diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-08-05 15:45:21 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-08-05 15:48:22 +0300 |
commit | a0e72a0996e86199e46988f3c225c16c4a8ebc92 (patch) | |
tree | b718a68b92c5c8ecfabec50b037d94733fb372ae | |
parent | c5eb400b7c7a5cfc16dcf2d75d20bcdceff13ef8 (diff) |
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.
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 4 |
2 files changed, 4 insertions, 1 deletions
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: |