From 6fa4581d92ef8e2dd47069e47135fd1005072127 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Mon, 2 Mar 2020 09:23:55 +0100 Subject: Fix T74334: VSE can't import multiple movie files Add `directory` RNA property to add operators. Reviewed By: brecht Differential Revision: https://developer.blender.org/D6986 --- .../blender/editors/space_sequencer/sequencer_add.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'source/blender/editors/space_sequencer') diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 74620a97d01..d3179095e24 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -600,25 +600,17 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad ED_sequencer_deselect_all(scene); } - if (RNA_struct_property_is_set(op->ptr, "files") && - RNA_struct_property_is_set(op->ptr, "directory")) { - tot_files = RNA_property_collection_length(op->ptr, - RNA_struct_find_property(op->ptr, "files")); - } - else { - tot_files = 0; - } + tot_files = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); - if (tot_files) { + if (tot_files > 1) { /* multiple files */ char dir_only[FILE_MAX]; char file_only[FILE_MAX]; - RNA_string_get(op->ptr, "directory", dir_only); - RNA_BEGIN (op->ptr, itemptr, "files") { Sequence *seq; + RNA_string_get(op->ptr, "directory", dir_only); RNA_string_get(&itemptr, "name", file_only); BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only); @@ -783,7 +775,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot) FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES | - WM_FILESEL_SHOW_PROPS, + WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); @@ -843,7 +835,7 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot) FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES | - WM_FILESEL_SHOW_PROPS, + WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME); @@ -1047,7 +1039,7 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot) FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILES | - WM_FILESEL_SHOW_PROPS, + WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA); sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME); -- cgit v1.2.3