From e8f6caa384e3d60d6a860c99fb35a0a083e1ef29 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 23 Feb 2013 20:24:02 +0000 Subject: Fix for image alpha version patch with library linked files where the image datablock is in a different library than the texture datablock. Adjusted the fix in 54790 to check for this case specifically so it keeps working on other files that have packed images. The problem is that blo_do_versions_newlibadr will not return a valid datablock in some cases with linked libraries. This function is used in various places in the version patching code and would likely cause problems there as well, needs to be investigated further. --- source/blender/blenloader/intern/readfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1aedfb329e4..426d15c82e3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8714,8 +8714,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (image == blo_do_versions_newlibadr(fd, otex->id.lib, otex->ima)) break; - /* no duplication for packed files */ - if (otex && image->packedfile == NULL) { + /* no duplication if the texture and image datablock are not + * from the same .blend file, the image datablock may not have + * been loaded from a library file otherwise */ + if (otex && (tex->id.lib == image->id.lib)) { /* copy image datablock */ nimage = BKE_image_copy(main, image); nimage->flag |= IMA_IGNORE_ALPHA|IMA_DONE_TAG; -- cgit v1.2.3