diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-04-20 19:07:34 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-04-22 15:11:51 +0300 |
commit | d354eeab7460ba76f92f3dcce3eea069010635b3 (patch) | |
tree | bddd9d355b15f9918b8d8921d9a21b53010e85b1 /source/blender/editors/space_sequencer/sequencer_edit.c | |
parent | e7c2d244c39affb71821f9e81ace9df3c87d2130 (diff) |
Placeholder image strips feedback session changes no.2:
Change paths operator can also have the same placeholder logic now
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 138d9b943fc..39023f5c0a3 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -3694,12 +3694,21 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = BKE_sequencer_active_get(scene); const bool is_relative_path = RNA_boolean_get(op->ptr, "relative_path"); + const bool use_placeholders = RNA_boolean_get(op->ptr, "use_placeholders"); + int minframe; if (seq->type == SEQ_TYPE_IMAGE) { char directory[FILE_MAX]; - const int len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); + int len; StripElem *se; + /* need to find min/max frame for placeholders */ + if (use_placeholders) { + len = sequencer_image_seq_get_minmax_frame(op, seq->sfra, &minframe); + } + else { + len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files")); + } if (len == 0) return OPERATOR_CANCELLED; @@ -3717,14 +3726,19 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) } seq->strip->stripdata = se = MEM_callocN(len * sizeof(StripElem), "stripelem"); - RNA_BEGIN (op->ptr, itemptr, "files") - { - char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0); - BLI_strncpy(se->name, filename, sizeof(se->name)); - MEM_freeN(filename); - se++; + if (use_placeholders) { + sequencer_image_seq_reserve_frames(op, se, len, minframe); + } + else { + RNA_BEGIN (op->ptr, itemptr, "files") + { + char *filename = RNA_string_get_alloc(&itemptr, "name", NULL, 0); + BLI_strncpy(se->name, filename, sizeof(se->name)); + MEM_freeN(filename); + se++; + } + RNA_END; } - RNA_END; /* reset these else we wont see all the images */ seq->anim_startofs = seq->anim_endofs = 0; @@ -3799,4 +3813,5 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot) WM_operator_properties_filesel(ot, FILE_TYPE_FOLDER | FILE_TYPE_IMAGE | FILE_TYPE_MOVIE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY); + RNA_def_boolean(ot->srna, "use_placeholders", false, "Use Placeholders", "Use placeholders for missing frames of the strip"); } |