This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/sequencer/SEQ_sequencer.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

162 lines
5.5 KiB
C++
Raw Normal View History

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2004 Blender Foundation. All rights reserved. */
#pragma once
/** \file
* \ingroup sequencer
*/
#ifdef __cplusplus
extern "C" {
#endif
2020-12-19 06:44:57 +01:00
#include "DNA_scene_types.h"
struct BlendDataReader;
struct BlendExpander;
2021-08-26 12:39:45 +10:00
struct BlendLibReader;
struct BlendWriter;
struct Depsgraph;
struct Editing;
2010-08-13 14:23:44 +00:00
struct Scene;
struct Sequence;
struct SequenceLookup;
2021-07-16 11:48:54 +10:00
struct SequencerToolSettings;
/* RNA enums, just to be more readable */
enum {
SEQ_SIDE_MOUSE = -1,
SEQ_SIDE_NONE = 0,
SEQ_SIDE_LEFT,
SEQ_SIDE_RIGHT,
SEQ_SIDE_BOTH,
SEQ_SIDE_NO_CHANGE,
};
2020-12-19 06:44:57 +01:00
/* seq_dupli' flags */
#define SEQ_DUPE_UNIQUE_NAME (1 << 0)
#define SEQ_DUPE_ALL (1 << 3) /* otherwise only selected are copied */
#define SEQ_DUPE_IS_RECURSIVE_CALL (1 << 4)
struct SequencerToolSettings *SEQ_tool_settings_init(void);
struct SequencerToolSettings *SEQ_tool_settings_ensure(struct Scene *scene);
void SEQ_tool_settings_free(struct SequencerToolSettings *tool_settings);
eSeqImageFitMethod SEQ_tool_settings_fit_method_get(struct Scene *scene);
void SEQ_tool_settings_fit_method_set(struct Scene *scene, eSeqImageFitMethod fit_method);
short SEQ_tool_settings_snap_flag_get(struct Scene *scene);
short SEQ_tool_settings_snap_mode_get(struct Scene *scene);
int SEQ_tool_settings_snap_distance_get(struct Scene *scene);
eSeqOverlapMode SEQ_tool_settings_overlap_mode_get(struct Scene *scene);
int SEQ_tool_settings_pivot_point_get(struct Scene *scene);
struct SequencerToolSettings *SEQ_tool_settings_copy(struct SequencerToolSettings *tool_settings);
struct Editing *SEQ_editing_get(const struct Scene *scene);
struct Editing *SEQ_editing_ensure(struct Scene *scene);
void SEQ_editing_free(struct Scene *scene, bool do_id_user);
/**
* Get seqbase that is being viewed currently. This can be main seqbase or meta strip seqbase
*
* \param ed: sequence editor data
* \return pointer to active seqbase. returns NULL if ed is NULL
*/
struct ListBase *SEQ_active_seqbase_get(const struct Editing *ed);
/**
* Set seqbase that is being viewed currently. This can be main seqbase or meta strip seqbase
*
* \param ed: sequence editor data
* \param seqbase: ListBase with strips
*/
void SEQ_seqbase_active_set(struct Editing *ed, struct ListBase *seqbase);
2020-12-19 06:44:57 +01:00
struct Sequence *SEQ_sequence_alloc(ListBase *lb, int timeline_frame, int machine, int type);
void SEQ_sequence_free(struct Scene *scene, struct Sequence *seq);
/**
* Get #MetaStack that corresponds to current level that is being viewed
*
* \return pointer to meta stack
*/
struct MetaStack *SEQ_meta_stack_active_get(const struct Editing *ed);
/**
* Open Meta strip content for editing.
*
* \param ed: sequence editor data
* \param seqm: meta sequence or NULL for top level view
*/
void SEQ_meta_stack_set(const struct Scene *scene, struct Sequence *dst_seq);
/**
* Close last Meta strip open for editing.
*
* \param ed: sequence editor data
*/
struct Sequence *SEQ_meta_stack_pop(struct Editing *ed);
struct Sequence *SEQ_sequence_dupli_recursive(const struct Scene *scene_src,
struct Scene *scene_dst,
struct ListBase *new_seq_list,
struct Sequence *seq,
int dupe_flag);
void SEQ_sequence_base_dupli_recursive(const struct Scene *scene_src,
struct Scene *scene_dst,
struct ListBase *nseqbase,
const struct ListBase *seqbase,
int dupe_flag,
int flag);
bool SEQ_valid_strip_channel(struct Sequence *seq);
/**
* Read and Write functions for `.blend` file data.
*/
void SEQ_blend_write(struct BlendWriter *writer, struct ListBase *seqbase);
void SEQ_blend_read(struct BlendDataReader *reader, struct ListBase *seqbase);
void SEQ_blend_read_lib(struct BlendLibReader *reader,
struct Scene *scene,
struct ListBase *seqbase);
void SEQ_blend_read_expand(struct BlendExpander *expander, struct ListBase *seqbase);
/* Depsgraph update function. */
/**
* Evaluate parts of sequences which needs to be done as a part of a dependency graph evaluation.
* This does NOT include actual rendering of the strips, but rather makes them up-to-date for
* animation playback and makes them ready for the sequencer's rendering pipeline to render them.
*/
void SEQ_eval_sequences(struct Depsgraph *depsgraph,
struct Scene *scene,
struct ListBase *seqbase);
/* Defined in sequence_lookup.c */
typedef enum eSequenceLookupTag {
SEQ_LOOKUP_TAG_INVALID = (1 << 0),
} eSequenceLookupTag;
/**
* Find a sequence with a given name.
* If lookup hash doesn't exist, it will be created. If hash is tagged as invalid, it will be
* rebuilt.
*
* \param scene: scene that owns lookup hash
* \param key: Sequence name without SQ prefix (seq->name + 2)
*
* \return pointer to Sequence
*/
VSE: Make time operations self-contained This patch makes it possible to manipulate strips without need to use update functions to recalculate effect and meta strips. Prior to this change function `SEQ_time_update_sequence` had to be used to update mainly effects and meta strips. This was implemented in a way that relied on sorted list of strips, which can't always be done and in rare cases this approach failed. In case of meta strips, `seqbase` had to be passed and compared with "active" one to determine whether meta strip should be updated or not. This is especially weak system that is prone to bugs when functions are used by python API functions. Finally, other strip types had startdisp` and `enddisp` fields updated by this function and a lot of code relied on these fields even if strip start, length and offsets are available. This is completely unnecessary. Implemented changes: All effects and meta strips are updated when strip handles are moved or strip is translated, without need to call any update function. Function `SEQ_time_update_sequence` has been split to `SEQ_time_update_meta_strip_range` and `seq_time_update_effects_strip_range`. These functions should be only used within sequencer module code. Meta update is used for versioning, which is only reason for it not being declared internally. Sequence fields `startdisp` and `enddisp` are now only used for effects to store strip start and end points. These fields should be used only internally within sequencer module code. Use function `SEQ_time_*_handle_frame_get` to get strip start and end points. To update effects and meta strips with reasonable performance, cache for "parent" meta strip and attached effects is added to `SequenceLookup` cache, so it shares invalidation mechanisms. All caches are populated during single iteration. There should be no functional changes. Differential Revision: https://developer.blender.org/D14990
2022-06-02 01:39:40 +02:00
struct Sequence *SEQ_sequence_lookup_seq_by_name(const struct Scene *scene, const char *key);
/**
* Free lookup hash data.
*
* \param scene: scene that owns lookup hash
*/
void SEQ_sequence_lookup_free(const struct Scene *scene);
/**
* Find a sequence with a given name.
*
* \param scene: scene that owns lookup hash
* \param tag: tag to set
*/
void SEQ_sequence_lookup_tag(const struct Scene *scene, eSequenceLookupTag tag);
#ifdef __cplusplus
}
#endif