diff options
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 6 |
3 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index de52c72a136..13cc5d2e84f 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -308,7 +308,7 @@ void BKE_sequencer_offset_animdata(struct Scene *scene, struct Sequence *seq, in void BKE_sequencer_dupe_animdata(struct Scene *scene, const char *name_src, const char *name_dst); bool BKE_sequence_base_shuffle(struct ListBase *seqbasep, struct Sequence *test, struct Scene *evil_scene); bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, struct Scene *evil_scene); -bool BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase); +bool BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase, bool one_only); void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, bool for_render); struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag); int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index dedf5e8bd72..c9647b05ce7 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3513,16 +3513,28 @@ bool BKE_sequence_single_check(Sequence *seq) } /* check if the selected seq's reference unselected seq's */ -bool BKE_sequence_base_isolated_sel_check(ListBase *seqbase) +bool BKE_sequence_base_isolated_sel_check(ListBase *seqbase, bool one_only) { Sequence *seq; - /* is there more than 1 select */ + /* is there a valid selection select */ bool ok = false; + /* is there one selected already? */ + bool first = false; for (seq = seqbase->first; seq; seq = seq->next) { if (seq->flag & SELECT) { - ok = true; - break; + if (one_only) { + ok = true; + break; + } + else { + if (first) { + ok = true; + break; + } + else + first = true; + } } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index dcf13dbf43f..9c43d22ae2f 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2059,8 +2059,8 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) Sequence *seq, *seqm, *next, *last_seq = BKE_sequencer_active_get(scene); int channel_max = 1; - if (BKE_sequence_base_isolated_sel_check(ed->seqbasep) == false) { - BKE_report(op->reports, RPT_ERROR, "Please select all related strips"); + if (BKE_sequence_base_isolated_sel_check(ed->seqbasep, false) == false) { + BKE_report(op->reports, RPT_ERROR, "Please select more than one or all related strips"); return OPERATOR_CANCELLED; } @@ -2767,7 +2767,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op) BKE_sequencer_free_clipboard(); - if (BKE_sequence_base_isolated_sel_check(ed->seqbasep) == false) { + if (BKE_sequence_base_isolated_sel_check(ed->seqbasep, true) == false) { BKE_report(op->reports, RPT_ERROR, "Please select all related strips"); return OPERATOR_CANCELLED; } |