Fixed some crashes with undo, when going back to the initial state of the file.
authorJoshua Leung <aligorith@gmail.com>
Wed, 27 Jan 2010 23:20:32 +0000 (23:20 +0000)
committerJoshua Leung <aligorith@gmail.com>
Wed, 27 Jan 2010 23:20:32 +0000 (23:20 +0000)
source/blender/blenkernel/intern/ipo.c
source/blender/blenloader/intern/readfile.c

index feb7fc3e382e4f3c5a58a9a56b773aed1c1470e5..c43b17910354d0640a23f78e52dc387ba9cd4f26 100644 (file)
@@ -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)) )
                                {
index 84b27ad44eb2a058a48c208c43b24ece32eda6b4..b0e68c81c73642a30091741f394484b48651f828 100644 (file)
@@ -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) {