diff options
author | Ton Roosendaal <ton@blender.org> | 2008-11-27 19:00:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-11-27 19:00:59 +0300 |
commit | d6aff38426a29af19230ee5badbda47ff4c0a306 (patch) | |
tree | 0decc8fd324088883835f5a06afb58af876d7be1 /source/blender/blenloader | |
parent | 6b5c948457b3627ffd69c0a2f6aaa8105642eb75 (diff) |
Patch to allow pre-2.50 Blenders to read newer files.
Since we'll reshuffle a lot in UI code, making new Screens totally
incompatible, this patch saves the Screen chunk in Blender files
with a new identifier (ID_SCRN), causing it to be not read in old
Blender binaries. Pre-2.50 blender already has a facility to recover
from this (it keeps old UI), including for .B.blends (it opens
default simple screen)
For the latter reason, it might be advisable to have the .B.blend
for 2.50+ saved as another name? Then you can use both for while.
(Note: commit is just 3 lines of code, other files are comments I
added for documentation of other stuff)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 53fd1bfa373..3fd0812338c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8207,6 +8207,10 @@ BlendFileData *blo_read_file_internal(FileData *fd, BlendReadError *error_r) bhead = read_libblock(fd, fd->mainlist.last, bhead, LIB_READ+LIB_EXTERN, NULL); break; + /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */ + case ID_SCRN: + bhead->code= ID_SCR; + /* deliberate pass on to default */ default: bhead = read_libblock(fd, bfd->main, bhead, LIB_LOCAL, NULL); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d84211411fa..96611b6fa9d 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1620,7 +1620,8 @@ static void write_screens(WriteData *wd, ListBase *scrbase) while(sc) { /* write LibData */ - writestruct(wd, ID_SCR, "Screen", 1, sc); + /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */ + writestruct(wd, ID_SCRN, "Screen", 1, sc); if (sc->id.properties) IDP_WriteProperty(sc->id.properties, wd); |