Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-06-10 19:41:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-10 19:41:01 +0400
commit7e21cede8f9a392db31889b398233f7b4ed829f0 (patch)
treee464e1138d38af61d82a54d0c8325fadc55dac5e /source/blender/makesrna/intern/rna_sequencer.c
parent64fbe2ee215821ad99b2554dd49cb16b20f867e3 (diff)
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index f1f4a252c16..b4d7b5559a4 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -348,11 +348,22 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
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));