diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-28 02:20:32 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-28 02:20:32 +0300 |
commit | bf16ed0c800762c61177ba2f16f6eecf89535d21 (patch) | |
tree | 2036c7684b066871f14260ece06ae468a8182f34 /source/blender/blenloader | |
parent | cc08cc3e8f2be6a805a829e14efad6d5dd366e72 (diff) |
Fixed some crashes with undo, when going back to the initial state of the file.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 84b27ad44eb..b0e68c81c73 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4876,24 +4876,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) else if(sl->spacetype==SPACE_IPO) { SpaceIpo *sipo= (SpaceIpo *)sl; bDopeSheet *ads= sipo->ads; - - /* XXX animato */ -#if 0 - sipo->ipo= restore_pointer_by_name(newmain, (ID *)sipo->ipo, 0); - if(sipo->blocktype==ID_SEQ) - sipo->from= (ID *)find_sequence_from_ipo_helper(newmain, sipo->ipo); - else - sipo->from= restore_pointer_by_name(newmain, (ID *)sipo->from, 0); - // not free sipo->ipokey, creates dependency with src/ - if(sipo->editipo) MEM_freeN(sipo->editipo); - sipo->editipo= NULL; - -#endif - if(ads) { - if(ads->filter_grp) { + if (ads) { + ads->source= restore_pointer_by_name(newmain, (ID *)ads->source, 1); + + if (ads->filter_grp) ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); - } } } else if(sl->spacetype==SPACE_BUTS) { @@ -4918,12 +4906,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) } else if(sl->spacetype==SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)sl; + saction->action = restore_pointer_by_name(newmain, (ID *)saction->action, 1); saction->ads.source= restore_pointer_by_name(newmain, (ID *)saction->ads.source, 1); - if(saction->ads.filter_grp) { + if (saction->ads.filter_grp) saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0); - } } else if(sl->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sl; @@ -4933,9 +4921,12 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) else if(sl->spacetype==SPACE_NLA){ SpaceNla *snla= (SpaceNla *)sl; bDopeSheet *ads= snla->ads; - - if (ads->filter_grp) { - ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); + + if (ads) { + ads->source= restore_pointer_by_name(newmain, (ID *)ads->source, 1); + + if (ads->filter_grp) + ads->filter_grp= restore_pointer_by_name(newmain, (ID *)ads->filter_grp, 0); } } else if(sl->spacetype==SPACE_TEXT) { |