41#define STRIP_EDGE_PAN_INSIDE_PAD 3.5
42#define STRIP_EDGE_PAN_OUTSIDE_PAD 0
43#define STRIP_EDGE_PAN_SPEED_RAMP 1
44#define STRIP_EDGE_PAN_MAX_SPEED 4
45#define STRIP_EDGE_PAN_DELAY 1.0f
46#define STRIP_EDGE_PAN_ZOOM_INFLUENCE 0.5f
70 int hold_clamp_min, hold_clamp_max;
101 int cfra = scene->
r.
cfra;
115 *r_count = *r_flag = 0;
117 else if (
left > cfra) {
125 *r_count = *r_flag = 0;
127 else if (right < cfra) {
150 *r_flag = strip->
flag;
154 *r_flag = strip->
flag;
189 td2d->
loc[0] = start_left;
190 tdsq->start_offset = start_left - strip->
start;
194 td2d->
loc[0] = start_left;
203 td2d->
loc2d =
nullptr;
210 tdsq->sel_flag = sel_flag;
212 td->
extra = (
void *)tdsq;
271 if ((custom_data->
data !=
nullptr) && custom_data->
use_free) {
272 TransSeq *ts =
static_cast<TransSeq *
>(custom_data->
data);
275 custom_data->
data =
nullptr;
286 for (
Strip *strip : transformed_strips) {
293 for (
Strip *strip : transformed_strips) {
311 for (
Strip *strip : transformed_strips) {
323 for (
int a = 0; a < tc->
data_len; a++, td++) {
324 Strip *strip = ((TransDataSeq *)td->
extra)->strip;
343 for (
Strip *strip : transformed_strips) {
360 scene, seqbasep, transformed_strips, ts->time_dependent_strips, use_sync_markers);
399 while (strip_iter !=
nullptr) {
424 bool strip_added =
true;
426 while (strip_added) {
429 for (
Strip *strip : strips_no_handles) {
430 if (time_dependent_strips.
contains(strip)) {
435 if (strip->input1 && time_dependent_strips.
contains(strip->input1)) {
436 if (strip->input2 && !time_dependent_strips.
contains(strip->input2)) {
440 time_dependent_strips.
add(strip);
451 for (
Strip *strip : selected_strips) {
453 if (strip->input1 ==
nullptr || strip->input2 ==
nullptr) {
462 time_dependent_strips.
add(strip);
476 bool only_handles_selected =
true;
482 for (
Strip *strip : strips) {
488 if (!(strip->input1->flag &
SELECT) && (!strip->input2 || !(strip->input2->flag &
SELECT))) {
489 ts->offset_clamp.xmin = 0;
490 ts->offset_clamp.xmax = 0;
496 ts->hold_clamp_min = -INT_MAX;
497 ts->hold_clamp_max = INT_MAX;
498 for (
Strip *strip : strips) {
512 bool can_clamp_holds = !(left_sel && right_sel) ||
518 if (left_sel || right_sel) {
521 if (!(left_sel && right_sel)) {
524 ts->offset_clamp.xmax =
min_ii(ts->offset_clamp.xmax, offset);
527 if (can_clamp_holds) {
529 ts->hold_clamp_min =
max_ii(ts->hold_clamp_min, -strip->startofs);
533 if (!(left_sel && right_sel)) {
537 ts->offset_clamp.xmin =
max_ii(ts->offset_clamp.xmin, offset);
540 if (can_clamp_holds) {
542 ts->hold_clamp_max =
min_ii(ts->hold_clamp_max, strip->endofs);
548 ts->offset_clamp.ymin =
max_ii(ts->offset_clamp.ymin, 1 - strip->channel);
550 only_handles_selected =
false;
557 if (only_handles_selected) {
558 ts->offset_clamp.ymin = 0;
559 ts->offset_clamp.ymax = 0;
572 TransDataSeq *tdsq =
nullptr;
573 TransSeq *ts =
nullptr;
682 float edge_pan_offset[2] = {0.0f, 0.0f};
686 for (
int a = 0; a < tc->
data_len; a++, td++, td2d++) {
687 TransDataSeq *tdsq = (TransDataSeq *)td->
extra;
688 Strip *strip = tdsq->strip;
694 float offset_clamped[2];
715 else if (offset_clamped[0] < offset[0] &&
722 switch (tdsq->sel_flag) {
724 int offset = new_frame - tdsq->start_offset - strip->
start;
727 if (
abs(offset) >
abs(max_offset)) {
768 for (
Strip *strip : ts->time_dependent_strips) {
778 for (
Strip *strip : transformed_strips) {
791 Strip *strip_prev =
nullptr;
796 for (a = 0, td = tc->
data; a < tc->data_len; a++, td++) {
797 TransDataSeq *tdsq = (TransDataSeq *)td->
extra;
798 Strip *strip = tdsq->strip;
800 if (strip != strip_prev) {
827 for (
Strip *strip : strips) {
863 bool clamped =
false;
867 r_val[0] =
float(val[0]);
868 r_val[1] =
float(val[1]);
874 if (val[0] < ts->hold_clamp_min) {
875 r_val[0] =
float(ts->hold_clamp_min);
878 else if (val[0] > ts->hold_clamp_max) {
879 r_val[0] =
float(ts->hold_clamp_max);
Scene * CTX_data_sequencer_scene(const bContext *C)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int round_fl_to_int(float a)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void unit_m3(float m[3][3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
bool BLI_rcti_clamp_pt_v(const struct rcti *rect, int xy[2])
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SEQUENCER_STRIPS
@ STRIP_IGNORE_CHANNEL_LOCK
@ SPACE_SEQ_DESELECT_STRIP_HANDLE
Read Guarded memory(de)allocation.
void UI_view2d_edge_pan_set_limits(View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax)
void UI_view2d_edge_pan_cancel(bContext *C, View2DEdgePanData *vpd)
void UI_view2d_edge_pan_init(bContext *C, View2DEdgePanData *vpd, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void UI_view2d_edge_pan_apply(bContext *C, View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, float value, char side)
void add_multiple(Span< Key > keys)
bool contains(const Key &key) const
int64_t remove_if(Predicate &&predicate)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
void relations_invalidate_cache(Scene *scene, Strip *strip)
ListBase * channels_displayed_get(const Editing *ed)
void edit_remove_flagged_strips(Scene *scene, ListBase *seqbase)
float time_content_end_frame_get(const Scene *scene, const Strip *strip)
void edit_flag_for_removal(Scene *scene, ListBase *seqbase, Strip *strip)
VectorSet< Strip * > query_selected_strips(ListBase *seqbase)
void transform_translate_strip(Scene *evil_scene, Strip *strip, int delta)
void strip_channel_set(Strip *strip, int channel)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
int time_left_handle_frame_get(const Scene *, const Strip *strip)
void offset_animdata(const Scene *scene, Strip *strip, float ofs)
float time_start_frame_get(const Strip *strip)
void query_strip_effect_chain(const Scene *scene, Strip *reference_strip, ListBase *seqbase, VectorSet< Strip * > &r_strips)
bool transform_single_image_check(const Strip *strip)
constexpr int MAX_CHANNELS
void iterator_set_expand(const Scene *scene, ListBase *seqbase, VectorSet< Strip * > &strips, void strip_query_func(const Scene *scene, Strip *strip_reference, ListBase *seqbase, VectorSet< Strip * > &strips))
bool transform_is_locked(ListBase *channels, const Strip *strip)
void time_left_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
void transform_handle_overlap(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips, bool use_sync_markers)
ListBase * active_seqbase_get(const Editing *ed)
void time_right_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
bool transform_strip_can_be_translated(const Strip *strip)
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
int effect_get_num_inputs(int strip_type)