Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_edit.c
| Show First 20 Lines • Show All 2,486 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Paste Operator | /** \name Paste Operator | ||||
| * \{ */ | * \{ */ | ||||
| void ED_sequencer_deselect_all(Scene *scene) | bool ED_sequencer_deselect_all(Scene *scene) | ||||
| { | { | ||||
| Editing *ed = SEQ_editing_get(scene); | Editing *ed = SEQ_editing_get(scene); | ||||
| bool any_deselected = false; | |||||
| if (ed == NULL) { | if (ed == NULL) { | ||||
| return; | return any_deselected; | ||||
| } | } | ||||
| LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) { | LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) { | ||||
| seq->flag &= ~SEQ_ALLSEL; | seq->flag &= ~SEQ_ALLSEL; | ||||
| any_deselected = true; | |||||
ISS: I think, that you could actually check if any strip is deselected to prevent generating undo… | |||||
Done Inline ActionsHey @isshak (isshak), I don't totally understand your advice. How would I check if a strip is deselected? Would I have to iterate over all of the scene's strips again and check for the flag when inside sequencer_select_exec? If we do that then we have to go over the same list of strips twice. Something like: bool changed = false;
/* Deselect everything */
if (deselect_all || (seq && (extend == false && deselect == false && toggle == false))) {
// Marks changed as true when we find that there's something that will get selected
LISTBASE_FOREACH (Sequence *, strip, SEQ_active_seqbase_get(ed)) {
if (strip->flag & SELECT) {
changed = true;
break;
}
}
ED_sequencer_deselect_all(scene);
}Yup_Lucas: Hey @isshak, I don't totally understand your advice.
How would I check if a strip is… | |||||
Done Inline Actionsoops, bad auto-complete cc @Richard Antalik (ISS) Yup_Lucas: oops, bad auto-complete cc @ISS | |||||
| } | } | ||||
| return any_deselected; | |||||
| } | } | ||||
| static void sequencer_paste_animation(bContext *C) | static void sequencer_paste_animation(bContext *C) | ||||
| { | { | ||||
| if (BLI_listbase_is_empty(&fcurves_clipboard) && BLI_listbase_is_empty(&drivers_clipboard)) { | if (BLI_listbase_is_empty(&fcurves_clipboard) && BLI_listbase_is_empty(&drivers_clipboard)) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,102 Lines • Show Last 20 Lines | |||||
I think, that you could actually check if any strip is deselected to prevent generating undo steps by clicking in empty space when there are strips in timeline.