[Bf-blender-cvs] [7fa72b8] master: Fix 'change path' opening file browser with wrong filter for sound strips

Julian Eisel noreply at git.blender.org
Tue Dec 15 01:05:53 CET 2015


Commit: 7fa72b8970b921190ae4fbd56748c0c808f870d1
Author: Julian Eisel
Date:   Mon Dec 14 23:52:01 2015 +0100
Branches: master
https://developer.blender.org/rB7fa72b8970b921190ae4fbd56748c0c808f870d1

Fix 'change path' opening file browser with wrong filter for sound strips

Changing path of a sound strip (select strip->C->'Path/Files') opened a file browser without filter for sound files, so sound files weren't visible.
Also, for movie/image files, now only movie **or** image files are visible in the file browser by default (instead of both).

Reported by @venomgfx, thanks!

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

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/editors/space_sequencer/sequencer_edit.c

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

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index b08bff1..c0f5877 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -267,12 +267,23 @@ class SEQUENCER_MT_change(Menu):
 
     def draw(self, context):
         layout = self.layout
+        strip = act_strip(context)
 
         layout.operator_context = 'INVOKE_REGION_WIN'
 
         layout.operator_menu_enum("sequencer.change_effect_input", "swap")
         layout.operator_menu_enum("sequencer.change_effect_type", "type")
-        layout.operator("sequencer.change_path", text="Path/Files")
+        prop = layout.operator("sequencer.change_path", text="Path/Files")
+
+        if strip:
+            stype = strip.type
+
+            if stype == 'IMAGE':
+                prop.filter_image = True;
+            elif stype == 'MOVIE':
+                prop.filter_movie = True;
+            elif stype == 'SOUND':
+                prop.filter_sound = True;
 
 
 class SEQUENCER_MT_frame(Menu):
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index fd8b116..d65cce1 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -3832,7 +3832,7 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-	WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_IMAGE | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE,
+	WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER, FILE_SPECIAL, FILE_OPENFILE,
 	                               WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES,
 	                               FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
 	RNA_def_boolean(ot->srna, "use_placeholders", false, "Use Placeholders", "Use placeholders for missing frames of the strip");




More information about the Bf-blender-cvs mailing list