[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31787] trunk/blender/source/blender: bugfix [#23674] Fix for texture path corruptions (bug 23337)

Campbell Barton ideasman42 at gmail.com
Mon Sep 6 14:54:55 CEST 2010


Revision: 31787
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31787
Author:   campbellbarton
Date:     2010-09-06 14:54:54 +0200 (Mon, 06 Sep 2010)

Log Message:
-----------
bugfix [#23674] Fix for texture path corruptions (bug 23337)
from Mathew Burrack (mburrack) 
...also applied a fix so this flag wont be written but including this patch for older startup.blend's.

--- from the tracker
I've created a patch for the texture path corruption bug, 23337. Basically, G_FILE_RELATIVE_REMAP was improperly getting
saved out to the startup.blend file, causing issues when the autosave timer went off. The proper fix is to mask out
that flag so it doesn't get written out to .blend files itself, but since that doesn't fix any pre-existing startup.blend
files, I just mask it out when startup.blend is read in instead.

I've tested it locally and so far, it seems to fix all the issues I've had with texture image paths getting corrupted.
I haven't figured out how to properly test the remap-on-save option in the save as dialog, though, so I don't know if
I accidentally broke that or not (although I don't see how I could have).

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/writefile.c
    trunk/blender/source/blender/windowmanager/intern/wm_files.c

Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/writefile.c	2010-09-06 11:29:23 UTC (rev 31786)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c	2010-09-06 12:54:54 UTC (rev 31787)
@@ -273,7 +273,7 @@
  * @param write_flags Write parameters
  * @warning Talks to other functions with global parameters
  */
-static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current, int write_flags)
+static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current)
 {
 	WriteData *wd= writedata_new(file);
 
@@ -2349,7 +2349,7 @@
 	fg.curscene= screen->scene;
 	fg.displaymode= G.displaymode;
 	fg.winpos= G.winpos;
-	fg.fileflags= (fileflags & ~G_FILE_NO_UI);	// prevent to save this, is not good convention, and feature with concerns...
+	fg.fileflags= (fileflags & ~(G_FILE_NO_UI|G_FILE_RELATIVE_REMAP));	// prevent to save this, is not good convention, and feature with concerns...
 	fg.globalf= G.f;
 	BLI_strncpy(fg.filename, mainvar->name, sizeof(fg.filename));
 
@@ -2384,7 +2384,7 @@
 
 	blo_split_main(&mainlist, mainvar);
 
-	wd= bgnwrite(handle, compare, current, write_flags);
+	wd= bgnwrite(handle, compare, current);
 	
 	sprintf(buf, "BLENDER%c%c%.3d", (sizeof(void*)==8)?'-':'_', (ENDIAN_ORDER==B_ENDIAN)?'V':'v', BLENDER_VERSION);
 	mywrite(wd, buf, 12);

Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c	2010-09-06 11:29:23 UTC (rev 31786)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2010-09-06 12:54:54 UTC (rev 31787)
@@ -374,6 +374,10 @@
 		if (wmbase.first == NULL) wm_clear_default_size(C);
 	}
 	
+	/* prevent buggy files that had G_FILE_RELATIVE_REMAP written out by mistake. Screws up autosaves otherwise
+	 * can remove this eventually, only in a 2.53 and older, now its not written */
+	G.fileflags &= ~G_FILE_RELATIVE_REMAP;
+
 	/* match the read WM with current WM */
 	wm_window_match_do(C, &wmbase); 
 	WM_check(C); /* opens window(s), checks keymaps */





More information about the Bf-blender-cvs mailing list