[Bf-blender-cvs] [6fa4581d92e] master: Fix T74334: VSE can't import multiple movie files
Richard Antalik
noreply at git.blender.org
Mon Mar 2 13:17:37 CET 2020
Commit: 6fa4581d92ef8e2dd47069e47135fd1005072127
Author: Richard Antalik
Date: Mon Mar 2 09:23:55 2020 +0100
Branches: master
https://developer.blender.org/rB6fa4581d92ef8e2dd47069e47135fd1005072127
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
===================================================================
M source/blender/editors/space_sequencer/sequencer_add.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list