2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2004 Blender Foundation. All rights reserved. */
|
2008-12-15 05:21:44 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2008-12-15 05:21:44 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
2020-10-26 00:47:06 +01:00
|
|
|
* \ingroup sequencer
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-11-29 11:42:18 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-12-19 06:44:57 +01:00
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
2021-08-20 16:30:34 +02:00
|
|
|
struct BlendDataReader;
|
|
|
|
|
struct BlendExpander;
|
2021-08-26 12:39:45 +10:00
|
|
|
struct BlendLibReader;
|
|
|
|
|
struct BlendWriter;
|
2021-08-20 16:30:34 +02:00
|
|
|
struct Depsgraph;
|
2008-12-15 05:21:44 +00:00
|
|
|
struct Editing;
|
2010-08-13 14:23:44 +00:00
|
|
|
struct Scene;
|
2008-12-15 05:21:44 +00:00
|
|
|
struct Sequence;
|
2021-06-16 00:29:17 +02:00
|
|
|
struct SequenceLookup;
|
2021-07-16 11:48:54 +10:00
|
|
|
struct SequencerToolSettings;
|
2012-02-29 12:08:26 +00:00
|
|
|
|
2020-10-26 00:47:06 +01:00
|
|
|
/* RNA enums, just to be more readable */
|
|
|
|
|
enum {
|
2020-11-19 12:59:29 +01:00
|
|
|
SEQ_SIDE_MOUSE = -1,
|
2020-10-26 00:47:06 +01:00
|
|
|
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)
|
2020-11-05 13:33:27 +01:00
|
|
|
|
2020-12-16 20:34:26 +01:00
|
|
|
struct SequencerToolSettings *SEQ_tool_settings_init(void);
|
2021-05-25 15:02:31 +02:00
|
|
|
struct SequencerToolSettings *SEQ_tool_settings_ensure(struct Scene *scene);
|
2020-12-16 20:34:26 +01:00
|
|
|
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);
|
2021-06-29 20:12:19 +02:00
|
|
|
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);
|
2021-08-27 12:59:46 +02:00
|
|
|
eSeqOverlapMode SEQ_tool_settings_overlap_mode_get(struct Scene *scene);
|
2021-09-21 09:38:30 +02:00
|
|
|
int SEQ_tool_settings_pivot_point_get(struct Scene *scene);
|
2020-12-16 20:34:26 +01:00
|
|
|
struct SequencerToolSettings *SEQ_tool_settings_copy(struct SequencerToolSettings *tool_settings);
|
2021-09-02 11:29:32 +10:00
|
|
|
struct Editing *SEQ_editing_get(const struct Scene *scene);
|
2020-12-19 05:57:27 +01:00
|
|
|
struct Editing *SEQ_editing_ensure(struct Scene *scene);
|
2022-01-07 11:38:08 +11:00
|
|
|
void SEQ_editing_free(struct Scene *scene, bool do_id_user);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
2020-12-17 02:11:22 +01:00
|
|
|
struct ListBase *SEQ_active_seqbase_get(const struct Editing *ed);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
2021-03-02 12:34:03 +01:00
|
|
|
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);
|
2022-01-19 14:12:23 +01:00
|
|
|
void SEQ_sequence_free(struct Scene *scene, struct Sequence *seq);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Create and initialize #MetaStack, append it to `ed->metastack` ListBase
|
|
|
|
|
*
|
|
|
|
|
* \param ed: sequence editor data
|
|
|
|
|
* \param seq_meta: meta strip
|
|
|
|
|
* \return pointer to created meta stack
|
|
|
|
|
*/
|
2021-03-02 12:34:03 +01:00
|
|
|
struct MetaStack *SEQ_meta_stack_alloc(struct Editing *ed, struct Sequence *seq_meta);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Get #MetaStack that corresponds to current level that is being viewed
|
|
|
|
|
*
|
|
|
|
|
* \param ed: sequence editor data
|
|
|
|
|
* \return pointer to meta stack
|
|
|
|
|
*/
|
2021-03-02 12:34:03 +01:00
|
|
|
struct MetaStack *SEQ_meta_stack_active_get(const struct Editing *ed);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Free #MetaStack and remove it from `ed->metastack` ListBase.
|
|
|
|
|
*
|
|
|
|
|
* \param ed: sequence editor data
|
|
|
|
|
* \param ms: meta stack
|
|
|
|
|
*/
|
2021-03-02 12:34:03 +01:00
|
|
|
void SEQ_meta_stack_free(struct Editing *ed, struct MetaStack *ms);
|
2020-12-19 05:57:27 +01:00
|
|
|
struct Sequence *SEQ_sequence_dupli_recursive(const struct Scene *scene_src,
|
2019-01-11 19:48:56 +01:00
|
|
|
struct Scene *scene_dst,
|
|
|
|
|
struct ListBase *new_seq_list,
|
|
|
|
|
struct Sequence *seq,
|
|
|
|
|
int dupe_flag);
|
2020-12-19 05:57:27 +01:00
|
|
|
void SEQ_sequence_base_dupli_recursive(const struct Scene *scene_src,
|
2017-08-10 13:00:01 +02:00
|
|
|
struct Scene *scene_dst,
|
|
|
|
|
struct ListBase *nseqbase,
|
|
|
|
|
const struct ListBase *seqbase,
|
Refactor ID copying (and to some extent, ID freeing).
This will allow much finer controll over how we copy data-blocks, from
full copy in Main database, to "lighter" ones (out of Main, inside an
already allocated datablock, etc.).
This commit also transfers a llot of what was previously handled by
per-ID-type custom code to generic ID handling code in BKE_library.
Hopefully will avoid in future inconsistencies and missing bits we had
all over the codebase in the past.
It also adds missing copying handling for a few types, most notably
Scene (which where using a fully customized handling previously).
Note that the type of allocation used during copying (regular in Main,
allocated but outside of Main, or not allocated by ID handling code at
all) is stored in ID's, which allows to handle them correctly when
freeing. This needs to be taken care of with caution when doing 'weird'
unusual things with ID copying and/or allocation!
As a final note, while rather noisy, this commit will hopefully not
break too much existing branches, old 'API' has been kept for the main
part, as a wrapper around new code. Cleaning it up will happen later.
Design task : T51804
Phab Diff: D2714
2017-08-07 16:39:55 +02:00
|
|
|
int dupe_flag,
|
2022-01-07 11:38:08 +11:00
|
|
|
int flag);
|
2021-09-28 10:33:42 +02:00
|
|
|
bool SEQ_valid_strip_channel(struct Sequence *seq);
|
2020-11-19 05:26:57 +01:00
|
|
|
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Read and Write functions for `.blend` file data.
|
|
|
|
|
*/
|
2021-08-20 16:30:34 +02:00
|
|
|
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);
|
|
|
|
|
|
2021-12-08 21:02:29 +11:00
|
|
|
/* 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.
|
|
|
|
|
*/
|
2021-08-20 16:30:34 +02:00
|
|
|
void SEQ_eval_sequences(struct Depsgraph *depsgraph,
|
|
|
|
|
struct Scene *scene,
|
|
|
|
|
struct ListBase *seqbase);
|
|
|
|
|
|
2021-06-16 00:29:17 +02:00
|
|
|
/* Defined in sequence_lookup.c */
|
|
|
|
|
|
|
|
|
|
typedef enum eSequenceLookupTag {
|
|
|
|
|
SEQ_LOOKUP_TAG_INVALID = (1 << 0),
|
|
|
|
|
} eSequenceLookupTag;
|
|
|
|
|
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
|
*/
|
2021-06-16 00:29:17 +02:00
|
|
|
struct Sequence *SEQ_sequence_lookup_by_name(const struct Scene *scene, const char *key);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Free lookup hash data.
|
|
|
|
|
*
|
|
|
|
|
* \param scene: scene that owns lookup hash
|
|
|
|
|
*/
|
2021-06-16 00:29:17 +02:00
|
|
|
void SEQ_sequence_lookup_free(const struct Scene *scene);
|
2021-12-08 21:02:29 +11:00
|
|
|
/**
|
|
|
|
|
* Find a sequence with a given name.
|
|
|
|
|
*
|
|
|
|
|
* \param scene: scene that owns lookup hash
|
|
|
|
|
* \param tag: tag to set
|
|
|
|
|
*/
|
2021-06-16 00:29:17 +02:00
|
|
|
void SEQ_sequence_lookup_tag(const struct Scene *scene, eSequenceLookupTag tag);
|
|
|
|
|
|
2019-11-29 11:42:18 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|