[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33046] trunk/blender/source/blender: Fix for [#24654] Sound Actuator doesn' t find the file when Blender is reopened.

Joerg Mueller nexyon at gmail.com
Sat Nov 13 14:44:46 CET 2010


Revision: 33046
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33046
Author:   nexyon
Date:     2010-11-13 14:44:45 +0100 (Sat, 13 Nov 2010)

Log Message:
-----------
Fix for [#24654] Sound Actuator doesn't find the file when Blender is reopened.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_packedFile.h
    trunk/blender/source/blender/blenkernel/intern/packedFile.c
    trunk/blender/source/blender/blenkernel/intern/sound.c
    trunk/blender/source/blender/editors/sound/sound_ops.c

Modified: trunk/blender/source/blender/blenkernel/BKE_packedFile.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_packedFile.h	2010-11-13 04:25:16 UTC (rev 33045)
+++ trunk/blender/source/blender/blenkernel/BKE_packedFile.h	2010-11-13 13:44:45 UTC (rev 33046)
@@ -50,7 +50,7 @@
 /* unpack */
 char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how);
 int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
-int unpackSound(struct ReportList *reports, struct bSound *sound, int how);
+int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
 int unpackImage(struct ReportList *reports, struct Image *ima, int how);
 void unpackAll(struct Main *bmain, struct ReportList *reports, int how);
 

Modified: trunk/blender/source/blender/blenkernel/intern/packedFile.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/packedFile.c	2010-11-13 04:25:16 UTC (rev 33045)
+++ trunk/blender/source/blender/blenkernel/intern/packedFile.c	2010-11-13 13:44:45 UTC (rev 33046)
@@ -467,7 +467,7 @@
 	return (ret_value);
 }
 
-int unpackSound(ReportList *reports, bSound *sound, int how)
+int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
 {
 	char localname[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
 	char *newname;
@@ -536,6 +536,6 @@
 
 	for(sound=bmain->sound.first; sound; sound=sound->id.next)
 		if(sound->packedfile)
-			unpackSound(reports, sound, how);
+			unpackSound(bmain, reports, sound, how);
 }
 

Modified: trunk/blender/source/blender/blenkernel/intern/sound.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sound.c	2010-11-13 04:25:16 UTC (rev 33045)
+++ trunk/blender/source/blender/blenkernel/intern/sound.c	2010-11-13 13:44:45 UTC (rev 33046)
@@ -236,7 +236,7 @@
 	}
 }
 
-void sound_load(struct Main *UNUSED(bmain), struct bSound* sound)
+void sound_load(struct Main *bmain, struct bSound* sound)
 {
 	if(sound)
 	{
@@ -266,8 +266,7 @@
 			if(sound->id.lib)
 				path = sound->id.lib->filepath;
 			else
-				// XXX this should be fixed!
-				path = /*bmain ? bmain->name :*/ G.main->name;
+				path = bmain->name;
 
 			BLI_path_abs(fullpath, path);
 
@@ -277,7 +276,7 @@
 			/* or else load it from disk */
 			else
 				sound->handle = AUD_load(fullpath);
-		} // XXX
+		}
 // XXX unused currently
 #if 0
 			break;

Modified: trunk/blender/source/blender/editors/sound/sound_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sound/sound_ops.c	2010-11-13 04:25:16 UTC (rev 33045)
+++ trunk/blender/source/blender/editors/sound/sound_ops.c	2010-11-13 13:44:45 UTC (rev 33046)
@@ -275,7 +275,7 @@
 	if(G.fileflags & G_AUTOPACK)
 		BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
 
-	unpackSound(op->reports, sound, method);
+	unpackSound(CTX_data_main(C), op->reports, sound, method);
 
 	return OPERATOR_FINISHED;
 }





More information about the Bf-blender-cvs mailing list