Files
test2/source/blender/sequencer/SEQ_connect.hh
John Kiril Swenson 715129bf5b VSE: ability to connect and disconnect strips in the VSE.
Adds the ability to connect and disconnect strips in the VSE.

- Connected strips have an icon indicating their status, and attempting
  to select one connected strip selects all other connected strips in
  that chain.
- If the user attempts to connect a strip that is already connected to
  other strips, that strip will disconnect itself from others before
  connecting to new strips.
- Preview selection also works in bulk if multiple video strips are
  connected together in the timeline.
- When adding new strips from the Add menu or the File Browser, strips
  from the same file are connected by default. There's an option to
  turn this off in Editing > Video Sequencer user preferences.
- It is possible to individually tweak strips/handles and ignore
  connections with Alt+Click.
  - This shortcut overrides the old keymap item for "Linked Handle"
    selection. The property still exists if people want to use that
    shortcut for its old purpose.
- To make sure that connections remain valid even after duplication,
  I've added a condition to `seq_new_fix_links_recursive` that also
  updates connections using the `seq->tmp` var. (A note -- I've updated
  the comment for this field in `DNA_sequence_types.h` because the var
  is only used for duplication now. It was once present in
  `select_more_less_seq__internal` to be used for linked selection but
  is gone now).
  - There are also functions to cut one-way links and make sure that
    all strips are bidirectionally connected after duplicating.

Pull Request: https://projects.blender.org/blender/blender/pulls/124333
2024-08-22 14:54:42 +02:00

55 lines
1.6 KiB
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup sequencer
*/
#include "BLI_vector_set.hh"
struct Sequence;
struct ListBase;
void SEQ_connections_duplicate(ListBase *connections_dst, ListBase *connections_src);
/**
* Disconnect the strip(s) from any connections with other strips. This function also
* frees the allocated memory as necessary. Returns false if any of the strips were not already
* connected.
*/
bool SEQ_disconnect(Sequence *seq);
bool SEQ_disconnect(blender::VectorSet<Sequence *> &seq_list);
/**
* Ensure that the strip has only bidirectional connections (expected behavior).
*/
void SEQ_cut_one_way_connections(Sequence *seq);
/**
* Connect strips so that they may be selected together. Any connections the
* strips already have will be severed before reconnection.
*/
void SEQ_connect(Sequence *seq1, Sequence *seq2);
void SEQ_connect(blender::VectorSet<Sequence *> &seq_list);
/**
* Returns a list of strips that the `seq` is connected to.
* NOTE: This does not include `seq` itself.
* This list is empty if `seq` is not connected.
*/
blender::VectorSet<Sequence *> SEQ_get_connected_strips(const Sequence *seq);
/**
* Check whether a strip has any connections.
*/
bool SEQ_is_strip_connected(const Sequence *seq);
/**
* Check whether the list of strips are a single connection "group", that is, they are all
* connected to each other and there are no outside connections.
*/
bool SEQ_are_strips_connected_together(blender::VectorSet<Sequence *> &seq_list);