[Bf-blender-cvs] [a8d6c69] master: Fix T44894: Broken packed image import from older .blend file.

Bastien Montagne noreply at git.blender.org
Sun May 31 18:31:54 CEST 2015


Commit: a8d6c69d7601e7df31c30887940ddcff41592bef
Author: Bastien Montagne
Date:   Sun May 31 18:28:28 2015 +0200
Branches: master
https://developer.blender.org/rBa8d6c69d7601e7df31c30887940ddcff41592bef

Fix T44894: Broken packed image import from older .blend file.

rBe5fbeba0b3a6e9eea not only restored forward compat, it also broke backward compat...
for no reason at all even, exising ima->packedfile is only used by read/versionning
code if .blend version is below 274.4 (i.e. no multi-image packing exists).

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a22e882..68326a0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1536,6 +1536,10 @@ void blo_make_packed_pointer_map(FileData *fd, Main *oldmain)
 	
 	for (ima = oldmain->image.first; ima; ima = ima->id.next) {
 		ImagePackedFile *imapf;
+
+		if (ima->packedfile)
+			insert_packedmap(fd, ima->packedfile);
+
 		for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next)
 			if (imapf->packedfile)
 				insert_packedmap(fd, imapf->packedfile);
@@ -1574,6 +1578,9 @@ void blo_end_packed_pointer_map(FileData *fd, Main *oldmain)
 	
 	for (ima = oldmain->image.first; ima; ima = ima->id.next) {
 		ImagePackedFile *imapf;
+
+		ima->packedfile = newpackedadr(fd, ima->packedfile);
+
 		for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next)
 			imapf->packedfile = newpackedadr(fd, imapf->packedfile);
 	}
@@ -3432,7 +3439,6 @@ static void direct_link_image(FileData *fd, Image *ima)
 	link_list(fd, &(ima->views));
 	link_list(fd, &(ima->packedfiles));
 
-	ima->packedfile = NULL;
 	for (imapf = ima->packedfiles.first; imapf; imapf = imapf->next) {
 		imapf->packedfile = direct_link_packedfile(fd, imapf->packedfile);
 	}




More information about the Bf-blender-cvs mailing list