[Bf-blender-cvs] [982904f] master: Fix T47109: Expose sound data-block selector

Campbell Barton noreply at git.blender.org
Mon Jan 4 11:15:46 CET 2016


Commit: 982904fcc927beb0122b1119448716958bcf12c1
Author: Campbell Barton
Date:   Mon Jan 4 21:08:14 2016 +1100
Branches: master
https://developer.blender.org/rB982904fcc927beb0122b1119448716958bcf12c1

Fix T47109: Expose sound data-block selector

===================================================================

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/makesrna/intern/rna_sequencer.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 34a0bac..ab993d1 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -783,13 +783,10 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel, Panel):
         strip = act_strip(context)
         sound = strip.sound
 
-        # TODO: add support to handle SOUND datablock in sequencer soundstrips... For now, hide this useless thing!
-        # layout.template_ID(strip, "sound", open="sound.open")
-
-        # layout.separator()
-        layout.prop(strip, "filepath", text="")
-
+        layout.template_ID(strip, "sound", open="sound.open")
         if sound is not None:
+            layout.prop(sound, "filepath", text="")
+
             row = layout.row()
             if sound.packed_file:
                 row.operator("sound.unpack", icon='PACKAGE', text="Unpack")
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index d9d56ad..221bf4b 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -596,19 +596,6 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator *
 static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
 {
 	Sequence *seq = (Sequence *)(ptr->data);
-
-	if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound) {
-		/* for sound strips we need to update the sound as well.
-		 * arguably, this could load in a new sound rather than 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);
-		BKE_sound_load(G.main, seq->sound);
-		BKE_sound_update_scene_sound(seq->scene_sound, seq->sound);
-	}
-
 	BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir),
 	                  sizeof(seq->strip->stripdata->name));
 }
@@ -2034,6 +2021,7 @@ static void rna_def_sound(BlenderRNA *brna)
 	RNA_def_struct_sdna(srna, "Sequence");
 
 	prop = RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE);
+	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_struct_type(prop, "Sound");
 	RNA_def_property_ui_text(prop, "Sound", "Sound data-block used by this sequence");
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
@@ -2061,12 +2049,6 @@ static void rna_def_sound(BlenderRNA *brna)
 	RNA_def_property_float_funcs(prop, NULL, "rna_Sequence_pan_set", NULL);
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
 
-	prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
-	RNA_def_property_ui_text(prop, "File", "");
-	RNA_def_property_string_funcs(prop, "rna_Sequence_filepath_get", "rna_Sequence_filepath_length",
-	                              "rna_Sequence_filepath_set");
-	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update");
-
 	prop = RNA_def_property(srna, "show_waveform", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM);
 	RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform");




More information about the Bf-blender-cvs mailing list