[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54794] trunk/blender/source/blender/ blenloader/intern/readfile.c: Fix for image alpha version patch with library linked files where the image

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Feb 23 21:24:02 CET 2013


Revision: 54794
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54794
Author:   blendix
Date:     2013-02-23 20:24:02 +0000 (Sat, 23 Feb 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2013-02-23 20:23:59 UTC (rev 54793)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2013-02-23 20:24:02 UTC (rev 54794)
@@ -8714,8 +8714,10 @@
 						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;




More information about the Bf-blender-cvs mailing list