Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-01-13 16:25:56 +0400
committerTon Roosendaal <ton@blender.org>2013-01-13 16:25:56 +0400
commitef5a41a89d121ae4048cc4010487e77b969f66b1 (patch)
treea4d9af893fa6a151f9e1e0898551c96285b67d05 /source/blender/blenloader
parent6e990de9b0ef813c96524d996b383f56da2b548c (diff)
Three fixes;
- Previous commit had a line of code of WIP project in it... tss - Packed Library data was not freed - Removed recent (post 2.65a) code to exclude packed data from Undo system. It's internal data thats part of file spec, errors happen for example on restoring quit.blend or temp saves.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c8
-rw-r--r--source/blender/blenloader/intern/readfile.c4
-rw-r--r--source/blender/blenloader/intern/writefile.c14
3 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index b2d37e36004..5111baa06c1 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -311,8 +311,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
/* makes lookup of existing video clips in old main */
blo_make_movieclip_pointer_map(fd, oldmain);
- /* makes lookup of existing video clips in old main */
- blo_make_packed_pointer_map(fd, oldmain);
+ /* removed packed data from this trick - it's internal data that needs saves */
bfd = blo_read_file_internal(fd, filename);
@@ -321,10 +320,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
/* ensures relinked movie clips are not freed */
blo_end_movieclip_pointer_map(fd, oldmain);
-
- /* ensures relinked packed data is not freed */
- blo_end_packed_pointer_map(fd, oldmain);
-
+
/* move libraries from old main to new main */
if (bfd && mainlist.first != mainlist.last) {
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 0727b1585d5..f003b029ae9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1439,6 +1439,8 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
}
}
+/* XXX disabled this feature - packed files also belong in temp saves and quit.blend, to make restore work */
+
static void insert_packedmap(FileData *fd, PackedFile *pf)
{
oldnewmap_insert(fd->packedmap, pf, pf, 0);
@@ -1863,7 +1865,7 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
prv->rect[i] = newdataadr(fd, prv->rect[i]);
}
}
- prv->gputexture[0] = prv->gputexture[1] = NULL;
+// prv->gputexture[0] = prv->gputexture[1] = NULL;
}
return prv;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 6f5b0e967e9..ef0c5b0e6bd 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1512,7 +1512,7 @@ static void write_vfonts(WriteData *wd, ListBase *idbase)
/* direct data */
- if (vf->packedfile && !wd->current) {
+ if (vf->packedfile) {
pf = vf->packedfile;
writestruct(wd, DATA, "PackedFile", 1, pf);
writedata(wd, DATA, pf->size, pf->data);
@@ -1962,7 +1962,7 @@ static void write_images(WriteData *wd, ListBase *idbase)
writestruct(wd, ID_IM, "Image", 1, ima);
if (ima->id.properties) IDP_WriteProperty(ima->id.properties, wd);
- if (ima->packedfile && !wd->current) {
+ if (ima->packedfile) {
pf = ima->packedfile;
writestruct(wd, DATA, "PackedFile", 1, pf);
writedata(wd, DATA, pf->size, pf->data);
@@ -2554,14 +2554,18 @@ static void write_libraries(WriteData *wd, Main *main)
}
}
+ /* to be able to restore quit.blend and temp saves, the packed blend has to be in undo buffers... */
+ /* XXX needs rethink, just like save UI in undo files now - would be nice to append things only for the]
+ quit.blend and temp saves */
if (foundone) {
writestruct(wd, ID_LI, "Library", 1, main->curlib);
- if (main->curlib->packedfile && !wd->current) {
+ if (main->curlib->packedfile) {
PackedFile *pf = main->curlib->packedfile;
writestruct(wd, DATA, "PackedFile", 1, pf);
writedata(wd, DATA, pf->size, pf->data);
- printf("write packed .blend: %s\n", main->curlib->name);
+ if (wd->current == NULL)
+ printf("write packed .blend: %s\n", main->curlib->name);
}
while (a--) {
@@ -2692,7 +2696,7 @@ static void write_sounds(WriteData *wd, ListBase *idbase)
writestruct(wd, ID_SO, "bSound", 1, sound);
if (sound->id.properties) IDP_WriteProperty(sound->id.properties, wd);
- if (sound->packedfile && !wd->current) {
+ if (sound->packedfile) {
pf = sound->packedfile;
writestruct(wd, DATA, "PackedFile", 1, pf);
writedata(wd, DATA, pf->size, pf->data);