[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29928] trunk/blender/source/blender: Fix for 15-day-old bug causing crashes when loading old 2.49 files, especially those with animation.

Joshua Leung aligorith at gmail.com
Sun Jul 4 14:16:01 CEST 2010


Revision: 29928
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29928
Author:   aligorith
Date:     2010-07-04 14:16:01 +0200 (Sun, 04 Jul 2010)

Log Message:
-----------
Fix for 15-day-old bug causing crashes when loading old 2.49 files, especially those with animation.

Reverting 29563 ("* Moved do_versions_ipos_to_animato from blender.c to readfile.c, where it should be.") part to the original version that (so far) is guaranteed to work fine. 

While this means that "nice software design" isn't obeyed once again, this works and the other approach doesn't. So far there really isn't anything really obviously different between the approaches, even after trying a few different placements of the version patches within the file-reading internals. 

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

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/blender.c	2010-07-04 11:56:31 UTC (rev 29927)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c	2010-07-04 12:16:01 UTC (rev 29928)
@@ -64,6 +64,7 @@
 #include "BKE_displist.h"
 #include "BKE_global.h"
 #include "BKE_idprop.h"
+#include "BKE_ipo.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
@@ -286,6 +287,11 @@
 		//setscreen(G.curscreen);
 	}
 	
+	// FIXME: this version patching should really be part of the file-reading code, 
+	// but we still get too many unrelated data-corruption crashes otherwise...
+	if (G.main->versionfile < 250)
+		do_versions_ipos_to_animato(G.main);
+	
 	if(recover && bfd->filename[0] && G.relbase_valid) {
 		/* in case of autosave or quit.blend, use original filename instead
 		 * use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2010-07-04 11:56:31 UTC (rev 29927)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-07-04 12:16:01 UTC (rev 29928)
@@ -10953,13 +10953,14 @@
 	/* don't forget to set version number in blender.c! */
 }
 
+#if 0 // XXX: disabled for now... we still don't have this in the right place in the loading code for it to work
 static void do_versions_after_linking(FileData *fd, Library *lib, Main *main)
 {
-	/* old Animation System (using IPO's) needs to be converted to the new Animato system
-	 */
+	/* old Animation System (using IPO's) needs to be converted to the new Animato system */
 	if(main->versionfile < 250)
 		do_versions_ipos_to_animato(main);
 }
+#endif
 
 static void lib_link_all(FileData *fd, Main *main)
 {
@@ -11107,7 +11108,7 @@
 	blo_join_main(&fd->mainlist);
 
 	lib_link_all(fd, bfd->main);
-	do_versions_after_linking(fd, NULL, bfd->main);
+	//do_versions_after_linking(fd, NULL, bfd->main); // XXX: not here (or even in this function at all)! this causes crashes on many files - Aligorith (July 04, 2010)
 	lib_verify_nodetree(bfd->main, 1);
 	fix_relpaths_library(fd->relabase, bfd->main); /* make all relative paths, relative to the open blend file */
 	





More information about the Bf-blender-cvs mailing list