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 | |
parent | cc08cc3e8f2be6a805a829e14efad6d5dd366e72 (diff) |
Fixed some crashes with undo, when going back to the initial state of the file.
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 33 |
2 files changed, 16 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index feb7fc3e382..c43b1791035 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1275,8 +1275,10 @@ static void icu_to_fcurves (ListBase *groups, ListBase *list, IpoCurve *icu, cha /* 'hide' flag is now used for keytype - only 'keyframes' existed before */ dst->hide= BEZT_KEYTYPE_KEYFRAME; - /* correct values for euler rotation curves - they were degrees/10 */ - // XXX for now, just make them into radians as RNA sets/reads directly in that form + /* correct values for euler rotation curves + * - they were degrees/10 + * - we need radians for RNA to do the right thing + */ if ( ((icu->blocktype == ID_OB) && ELEM3(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) || ((icu->blocktype == ID_PO) && ELEM3(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z)) ) { 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) { |