[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26356] trunk/blender/source/blender: Fixed some crashes with undo, when going back to the initial state of the file.

Joshua Leung aligorith at gmail.com
Thu Jan 28 00:20:32 CET 2010


Revision: 26356
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26356
Author:   aligorith
Date:     2010-01-28 00:20:32 +0100 (Thu, 28 Jan 2010)

Log Message:
-----------
Fixed some crashes with undo, when going back to the initial state of the file.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/ipo.c
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c	2010-01-27 22:24:25 UTC (rev 26355)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c	2010-01-27 23:20:32 UTC (rev 26356)
@@ -1275,8 +1275,10 @@
 				/* '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)) )
 				{

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-27 22:24:25 UTC (rev 26355)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-27 23:20:32 UTC (rev 26356)
@@ -4876,24 +4876,12 @@
 				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 @@
 				}
 				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 @@
 				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) {





More information about the Bf-blender-cvs mailing list