[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29385] trunk/blender/source/blender: setting the sequencer strip filepath for sound strips would rename the strip path but not the sounds ,

Campbell Barton ideasman42 at gmail.com
Thu Jun 10 17:41:01 CEST 2010


Revision: 29385
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29385
Author:   campbellbarton
Date:     2010-06-10 17:41:01 +0200 (Thu, 10 Jun 2010)

Log Message:
-----------
setting the sequencer strip filepath for sound strips would rename the strip path but not the sounds,
resulting in sounds that didnt play in the sequencer unless you removed and replaced them with a strip that pointed to the new path.

The way these 2 datablocks work together is a bit odd, I think this is OK for now but should be better defined.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c
    trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
    trunk/blender/source/blender/makesrna/intern/rna_sound.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2010-06-10 14:42:24 UTC (rev 29384)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2010-06-10 15:41:01 UTC (rev 29385)
@@ -566,7 +566,7 @@
 	}
 }
 
-/* note: caller should run calc_sequence(scene, seq) */
+/* note: caller should run calc_sequence(scene, seq) after */
 void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
 {
 	char str[FILE_MAXDIR+FILE_MAXFILE];

Modified: trunk/blender/source/blender/makesrna/intern/rna_sequencer.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2010-06-10 14:42:24 UTC (rev 29384)
+++ trunk/blender/source/blender/makesrna/intern/rna_sequencer.c	2010-06-10 15:41:01 UTC (rev 29385)
@@ -348,11 +348,22 @@
 	return rna_pointer_inherit_refine(&iter->parent, &RNA_Sequence, ms->parseq);
 }
 
+/* TODO, expose seq path setting as a higher level sequencer BKE function */
 static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
 {
 	Sequence *seq= (Sequence*)(ptr->data);
 	char dir[FILE_MAX], name[FILE_MAX];
 
+	if(seq->type == SEQ_SOUND && seq->sound) {
+		/* for sound strips we need to update the sound as well.
+		 * arguably, this could load in a new sound rather then modify an existing one.
+		 * but while using the sequencer its most likely your not using the sound in the game engine too.
+		 */
+		PointerRNA id_ptr;
+		RNA_id_pointer_create((ID *)seq->sound, &id_ptr);
+		RNA_string_set(&id_ptr, "filepath", value);
+	}
+
 	BLI_split_dirfile(value, dir, name);
 	BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir));
 	BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name));

Modified: trunk/blender/source/blender/makesrna/intern/rna_sound.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sound.c	2010-06-10 14:42:24 UTC (rev 29384)
+++ trunk/blender/source/blender/makesrna/intern/rna_sound.c	2010-06-10 15:41:01 UTC (rev 29385)
@@ -72,7 +72,7 @@
 
 	prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
 	RNA_def_property_string_sdna(prop, NULL, "name");
-	RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock");
+	RNA_def_property_ui_text(prop, "File Path", "Sound sample file used by this Sound datablock");
 	RNA_def_property_update(prop, 0, "rna_Sound_filepath_update");
 
 	prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);





More information about the Bf-blender-cvs mailing list