Ref: #132179 Renames: - `Editing.act_seq` -> `Editing.act_strip` - `SequenceModifierData` -> `StripModifierData` - Its member `mask_sequence` is now `mask_strip`. - `MetaStack.parseq` -> `MetaStack.parent_strip` - Remaining function names/parameters that were not dealt with in #132748 - Various references to `seq` or `sequence` throughout code and docs when referring to a strip Also moves `_get` to the end of the renamed function names where applicable for standardization (unless "by" or "from" are used). There should be no changes to current behavior. Pull Request: https://projects.blender.org/blender/blender/pulls/138077
102 lines
2.6 KiB
C++
102 lines
2.6 KiB
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup sequencer
|
|
*/
|
|
|
|
#include "DNA_sequence_types.h"
|
|
|
|
#include "SEQ_channels.hh"
|
|
#include "SEQ_relations.hh"
|
|
#include "SEQ_render.hh"
|
|
#include "SEQ_sequencer.hh"
|
|
#include "SEQ_time.hh"
|
|
#include "SEQ_utils.hh"
|
|
|
|
#include "effects.hh"
|
|
#include "render.hh"
|
|
|
|
namespace blender::seq {
|
|
|
|
/* No effect inputs for adjustment, we use #give_ibuf_seq. */
|
|
static int num_inputs_adjustment()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static StripEarlyOut early_out_adjustment(const Strip * /*strip*/, float /*fac*/)
|
|
{
|
|
return StripEarlyOut::NoInput;
|
|
}
|
|
|
|
static ImBuf *do_adjustment_impl(const RenderData *context, Strip *strip, float timeline_frame)
|
|
{
|
|
Editing *ed;
|
|
ImBuf *i = nullptr;
|
|
|
|
ed = context->scene->ed;
|
|
|
|
ListBase *seqbasep = get_seqbase_by_strip(context->scene, strip);
|
|
ListBase *channels = get_channels_by_strip(ed, strip);
|
|
|
|
/* Clamp timeline_frame to strip range so it behaves as if it had "still frame" offset (last
|
|
* frame is static after end of strip). This is how most strips behave. This way transition
|
|
* effects that doesn't overlap or speed effect can't fail rendering outside of strip range. */
|
|
timeline_frame = clamp_i(timeline_frame,
|
|
time_left_handle_frame_get(context->scene, strip),
|
|
time_right_handle_frame_get(context->scene, strip) - 1);
|
|
|
|
if (strip->machine > 1) {
|
|
i = seq_render_give_ibuf_seqbase(
|
|
context, timeline_frame, strip->machine - 1, channels, seqbasep);
|
|
}
|
|
|
|
/* Found nothing? so let's work the way up the meta-strip stack, so
|
|
* that it is possible to group a bunch of adjustment strips into
|
|
* a meta-strip and have that work on everything below the meta-strip. */
|
|
|
|
if (!i) {
|
|
Strip *meta;
|
|
|
|
meta = lookup_meta_by_strip(ed, strip);
|
|
|
|
if (meta) {
|
|
i = do_adjustment_impl(context, meta, timeline_frame);
|
|
}
|
|
}
|
|
|
|
return i;
|
|
}
|
|
|
|
static ImBuf *do_adjustment(const RenderData *context,
|
|
Strip *strip,
|
|
float timeline_frame,
|
|
float /*fac*/,
|
|
ImBuf * /*ibuf1*/,
|
|
ImBuf * /*ibuf2*/)
|
|
{
|
|
ImBuf *out;
|
|
Editing *ed;
|
|
|
|
ed = context->scene->ed;
|
|
|
|
if (!ed) {
|
|
return nullptr;
|
|
}
|
|
|
|
out = do_adjustment_impl(context, strip, timeline_frame);
|
|
|
|
return out;
|
|
}
|
|
|
|
void adjustment_effect_get_handle(EffectHandle &rval)
|
|
{
|
|
rval.num_inputs = num_inputs_adjustment;
|
|
rval.early_out = early_out_adjustment;
|
|
rval.execute = do_adjustment;
|
|
}
|
|
|
|
} // namespace blender::seq
|