diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-06-11 07:03:36 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-06-11 07:03:36 +0400 |
commit | a050d23133123abec1ee83c1e80289f6ac931098 (patch) | |
tree | 6b0bee13f9472a35fe5acdd160d6bdaf9964867c /source/blender/blenloader | |
parent | 379cf37b384c143313f0d1cc10dcb30ae1daa378 (diff) |
Bugfix: Crash in Sequencer when trying to undo after using Grease Pencil
Grease Pencil data was not getting correctly relinked after file reload (for
undo)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fdaa8f5e193..6cc81218a6b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5288,6 +5288,14 @@ static void lib_link_screen(FileData *fd, Main *main) */ sima->gpd = newlibadr_us(fd, sc->id.lib, sima->gpd); } + else if (sl->spacetype == SPACE_SEQ) { + SpaceSeq *sseq = (SpaceSeq *)sl; + + /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data + * so fingers crossed this works fine! + */ + sseq->gpd = newlibadr_us(fd, sc->id.lib, sseq->gpd); + } else if (sl->spacetype == SPACE_NLA) { SpaceNla *snla= (SpaceNla *)sl; bDopeSheet *ads= snla->ads; @@ -5358,15 +5366,20 @@ static void lib_link_screen(FileData *fd, Main *main) } else if (sl->spacetype == SPACE_CLIP) { SpaceClip *sclip = (SpaceClip *)sl; - + sclip->clip = newlibadr_us(fd, sc->id.lib, sclip->clip); sclip->mask = newlibadr_us(fd, sc->id.lib, sclip->mask); - + sclip->scopes.track_search = NULL; sclip->scopes.track_preview = NULL; sclip->draw_context = NULL; sclip->scopes.ok = 0; } + else if (sl->spacetype == SPACE_LOGIC) { + SpaceLogic *slogic = (SpaceLogic *)sl; + + slogic->gpd = newlibadr_us(fd, sc->id.lib, slogic->gpd); + } } } sc->id.flag -= LIB_NEEDLINK; @@ -5559,6 +5572,14 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) */ sima->gpd = restore_pointer_by_name(newmain, (ID *)sima->gpd, 1); } + else if (sl->spacetype == SPACE_SEQ) { + SpaceSeq *sseq = (SpaceSeq *)sl; + + /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data + * so assume that here we're doing for undo only... + */ + sseq->gpd = restore_pointer_by_name(newmain, (ID *)sseq->gpd, 1); + } else if (sl->spacetype == SPACE_NLA) { SpaceNla *snla = (SpaceNla *)sl; bDopeSheet *ads = snla->ads; @@ -5629,6 +5650,11 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) sclip->scopes.ok = 0; } + else if (sl->spacetype == SPACE_LOGIC) { + SpaceLogic *slogic = (SpaceLogic *)sl; + + slogic->gpd = restore_pointer_by_name(newmain, (ID *)slogic->gpd, 1); + } } } } @@ -5869,7 +5895,8 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } else if (sl->spacetype == SPACE_LOGIC) { SpaceLogic *slogic = (SpaceLogic *)sl; - + + /* XXX: this is new stuff, which shouldn't be directly linking to gpd... */ if (slogic->gpd) { slogic->gpd = newdataadr(fd, slogic->gpd); direct_link_gpencil(fd, slogic->gpd); |