2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2004 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-12-19 06:44:57 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* \ingroup sequencer
|
|
|
|
*/
|
|
|
|
|
2023-11-06 01:36:44 +01:00
|
|
|
#include "BLI_vector_set.hh"
|
2021-05-07 10:25:13 +02:00
|
|
|
|
2021-07-16 03:48:54 +02:00
|
|
|
struct Sequence;
|
2020-12-19 06:44:57 +01:00
|
|
|
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Callback format for the for_each function below.
|
|
|
|
*/
|
2024-01-04 21:07:48 +01:00
|
|
|
using SeqForEachFunc = bool (*)(Sequence *seq, void *user_data);
|
2021-08-20 16:30:34 +02:00
|
|
|
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Utility function to recursively iterate through all sequence strips in a `seqbase` list.
|
|
|
|
* Uses callback to do operations on each sequence element.
|
|
|
|
* The callback can stop the iteration if needed.
|
|
|
|
*
|
|
|
|
* \param seqbase: #ListBase of sequences to be iterated over.
|
|
|
|
* \param callback: query function callback, returns false if iteration should stop.
|
|
|
|
* \param user_data: pointer to user data that can be used in the callback function.
|
|
|
|
*/
|
2023-11-14 09:51:41 +01:00
|
|
|
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data);
|
2021-08-20 16:30:34 +02:00
|
|
|
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
2023-11-06 01:36:44 +01:00
|
|
|
* Expand set by running `seq_query_func()` for each strip, which will be used as reference.
|
2021-12-08 11:02:29 +01:00
|
|
|
* Results of these queries will be merged into provided collection.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \param strips: set of strips to be expanded
|
2021-12-08 11:02:29 +01:00
|
|
|
* \param seq_query_func: query function callback
|
|
|
|
*/
|
2023-11-14 09:51:41 +01:00
|
|
|
void SEQ_iterator_set_expand(const Scene *scene,
|
|
|
|
ListBase *seqbase,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> &strips,
|
2023-11-14 09:51:41 +01:00
|
|
|
void seq_query_func(const Scene *scene,
|
|
|
|
Sequence *seq_reference,
|
|
|
|
ListBase *seqbase,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> &strips));
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query strips from seqbase. seq_reference is used by query function as filter condition.
|
|
|
|
*
|
|
|
|
* \param seq_reference: reference strip for query function
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
|
|
|
* \param seq_query_func: query function callback
|
2023-11-06 01:36:44 +01:00
|
|
|
* \return set of strips
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_by_reference(
|
2023-11-14 09:51:41 +01:00
|
|
|
Sequence *seq_reference,
|
|
|
|
const Scene *scene,
|
|
|
|
ListBase *seqbase,
|
|
|
|
void seq_query_func(const Scene *scene,
|
|
|
|
Sequence *seq_reference,
|
|
|
|
ListBase *seqbase,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> &strips));
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query all selected strips in seqbase.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \return set of strips
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2023-11-14 09:51:41 +01:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_selected_strips(ListBase *seqbase);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query all unselected strips in seqbase.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \return set of strips
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_unselected_strips(ListBase *seqbase);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query all strips in seqbase. This does not include strips nested in meta strips.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \return set of strips
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_all_strips(ListBase *seqbase);
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query all strips in seqbase and nested meta strips.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \return set of strips
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2024-04-03 01:22:05 +02:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_all_strips_recursive(const ListBase *seqbase);
|
VSE: speedup timeline drawing, and improve waveform display
Sequencer timeline UI repainting is 3x-4x faster now, for complex
timelines. On Sprite Fright Edit data set, with whole timeline visible
(2702 strips), repainting the timeline UI with all overlay options
(waveforms, offsets, thumbnails etc.):
- Windows (Ryzen 5950X, RTX 3080Ti, OpenGL): 62ms -> 18.6ms (16FPS -> 54FPS)
- Mac (M1 Max, Metal): 39.8ms -> 11.5ms (25FPS -> 86FPS)
This is achieved by:
- Avoiding tiny GPU draw calls (i.e. drawing one quad a time), instead
batch all the quads / lines needed by the timeline display into
series of about-1000 quads per draw.
- For retiming keys display, batch their keyframe point drawing too.
- For audio waveform overlay display, change it to draw batched quads
instead of alternating between line strips and triangle strips. This
actually changes how the waveform looks like (implements #115274)
and fixes some visual issues with waveforms too.
- For fcurve overlays, also draw them as batched quads.
While at it, this also fixes an issue where while dragging strips over
other strips, their text labels would look as if they are behind the
background strips.
Pull Request: https://projects.blender.org/blender/blender/pulls/115311
2023-11-29 20:25:21 +01:00
|
|
|
/**
|
|
|
|
* Query all meta strips in seqbase and nested meta strips.
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
|
|
|
* \return set of meta strips
|
|
|
|
*/
|
2024-04-03 01:22:05 +02:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_all_meta_strips_recursive(const ListBase *seqbase);
|
2023-11-06 01:36:44 +01:00
|
|
|
|
2021-12-08 11:02:29 +01:00
|
|
|
/**
|
|
|
|
* Query all effect strips that are directly or indirectly connected to seq_reference.
|
|
|
|
* This includes all effects of seq_reference, strips used by another inputs and their effects, so
|
|
|
|
* that whole chain is fully independent of other strips.
|
|
|
|
*
|
|
|
|
* \param seq_reference: reference strip
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
2023-11-06 01:36:44 +01:00
|
|
|
* \param strips: set of strips to be filled
|
2021-12-08 11:02:29 +01:00
|
|
|
*/
|
2023-11-14 09:51:41 +01:00
|
|
|
void SEQ_query_strip_effect_chain(const Scene *scene,
|
|
|
|
Sequence *seq_reference,
|
|
|
|
ListBase *seqbase,
|
2023-11-06 01:36:44 +01:00
|
|
|
blender::VectorSet<Sequence *> &strips);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Query strips that are rendered at \a timeline_frame when \a displayed channel is viewed
|
|
|
|
*
|
|
|
|
* \param seqbase: ListBase in which strips are queried
|
|
|
|
* \param timeline_frame: viewed frame
|
|
|
|
* \param displayed_channel: viewed channel. when set to 0, no channel filter is applied
|
|
|
|
* \return set of strips
|
|
|
|
*/
|
2023-11-14 09:51:41 +01:00
|
|
|
blender::VectorSet<Sequence *> SEQ_query_rendered_strips(const Scene *scene,
|
2023-11-06 01:36:44 +01:00
|
|
|
ListBase *channels,
|
|
|
|
ListBase *seqbase,
|
|
|
|
int timeline_frame,
|
|
|
|
int displayed_channel);
|