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
This commit is contained in:
Richard Antalik 2020-03-02 09:23:55 +01:00
parent bd25df3d68
commit 6fa4581d92
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #74475, Adding images as movies no longer works as expected
Referenced by issue #74433, Sequencer Add->Movie only imports one Movie from multiple selected in FileWindow
Referenced by issue #74334, VSE can't import multi movie files since 2.82
1 changed files with 6 additions and 14 deletions

View File

@ -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);