42#define STRIP_EDGE_PAN_INSIDE_PAD 3.5f
43#define STRIP_EDGE_PAN_OUTSIDE_PAD 0.0f
44#define STRIP_EDGE_PAN_SPEED_RAMP 1.0f
45#define STRIP_EDGE_PAN_MAX_SPEED 26.0f
46#define STRIP_EDGE_PAN_DELAY 0.5f
47#define STRIP_EDGE_PAN_ZOOM_INFLUENCE 0.0f
84 int cfra = scene->
r.
cfra;
85 int left = strip->left_handle();
86 int right = strip->right_handle(scene);
98 *r_count = *r_flag = 0;
100 else if (left > cfra) {
108 *r_count = *r_flag = 0;
110 else if (right < cfra) {
133 *r_flag = strip->flag;
137 *r_flag = strip->flag;
146 int tot = 0, count, flag;
148 for (
Strip &strip : *seqbase) {
171 start_left = strip->left_handle();
172 td2d->
loc[0] = start_left;
173 tdsq->start_offset = start_left - strip->start;
176 start_left = strip->left_handle();
177 td2d->
loc[0] = start_left;
180 td2d->
loc[0] = strip->right_handle(scene);
184 td2d->
loc[1] = strip->channel;
186 td2d->loc2d =
nullptr;
193 tdsq->sel_flag = sel_flag;
195 td->
extra =
static_cast<void *
>(tdsq);
227 for (
Strip &strip : *seqbase) {
254 if ((custom_data->
data !=
nullptr) && custom_data->
use_free) {
256 MEM_delete(
static_cast<TransDataSeq *
>(ts->
tdseq));
258 custom_data->
data =
nullptr;
269 for (
Strip *strip : transformed_strips) {
279 for (
Strip *strip : transformed_strips) {
295 for (
Strip *strip : transformed_strips) {
307 for (
int a = 0; a < tc->
data_len; a++, td++) {
308 Strip *strip = (
static_cast<TransDataSeq *
>(td->
extra))->strip;
324 ed->edit_point_set(scene, std::nullopt);
329 for (
Strip *strip : transformed_strips) {
331 strip->runtime->flag &=
~seq::StripRuntimeFlag::IgnoreChannelLock;
348 for (
Strip &strip : *seqbase) {
363 Strip *input = effect->input1;
364 if (effect->input2 && (effect->input2->left_handle() - effect->input1->left_handle()) * side > 0)
366 input = effect->input2;
373 Strip *input = effect, *strip_iter = effect;
374 while (strip_iter !=
nullptr) {
400 bool strip_added =
true;
402 while (strip_added) {
405 for (
Strip *strip : strips_no_handles) {
406 if (time_dependent_strips.
contains(strip)) {
411 if (strip->input1 && time_dependent_strips.
contains(strip->input1)) {
412 if (strip->input2 && !time_dependent_strips.
contains(strip->input2)) {
416 time_dependent_strips.
add(strip);
427 for (
Strip *strip : selected_strips) {
429 if (strip->input1 ==
nullptr || strip->input2 ==
nullptr) {
438 time_dependent_strips.
add(strip);
452 bool only_handles_selected =
true;
458 for (
Strip *strip : strips) {
459 if (!strip->is_effect_with_inputs()) {
465 (!strip->input2 || !(strip->input2->flag &
SEQ_SELECT)))
479 for (
Strip *strip : strips) {
488 if (clamp_default && (strip->startofs < 0 || strip->end_offset() < 0) &&
495 bool can_clamp_holds = !(left_sel && right_sel) ||
496 (strip->content_length() >=
497 strip->right_handle(scene) - strip->left_handle());
501 if (left_sel || right_sel) {
504 if (!(left_sel && right_sel)) {
505 int offset = (strip->right_handle(scene) - 1) - strip->left_handle();
509 if (can_clamp_holds) {
515 if (!(left_sel && right_sel)) {
517 int offset = (strip->left_handle() + 1) - strip->right_handle(scene);
521 if (can_clamp_holds) {
531 only_handles_selected =
false;
538 if (only_handles_selected) {
561 TransDataSeq *tdsq =
nullptr;
598 view2d_edge_pan_init(t->
context,
672 float edge_pan_offset[2] = {0.0f, 0.0f};
676 for (
int a = 0; a < tc->
data_len; a++, td++) {
677 TransDataSeq *tdsq =
static_cast<TransDataSeq *
>(td->
extra);
678 Strip *strip = tdsq->strip;
684 float offset_clamped[2];
696 strip->runtime->flag &=
~seq::StripRuntimeFlag::ClampedLH;
699 strip->runtime->flag &=
~seq::StripRuntimeFlag::ClampedRH;
702 if (offset_clamped[0] > offset[0] && new_frame == strip->content_start()) {
705 else if (offset_clamped[0] < offset[0] && new_frame == strip->content_end(scene)) {
710 switch (tdsq->sel_flag) {
712 int offset = new_frame - tdsq->start_offset - strip->start;
715 if (
abs(offset) >
abs(max_offset)) {
719 strip->channel_set(new_channel);
727 if (both_handles_selected && new_frame >= strip->right_handle(scene)) {
730 strip->right_handle_set(scene, new_frame + 1);
733 int old_startdisp = strip->left_handle();
734 strip->left_handle_set(scene, new_frame);
736 if (
abs(strip->left_handle() - old_startdisp) >
abs(max_offset)) {
737 max_offset = strip->left_handle() - old_startdisp;
742 int old_enddisp = strip->right_handle(scene);
743 strip->right_handle_set(scene, new_frame);
745 if (
abs(strip->right_handle(scene) - old_enddisp) >
abs(max_offset)) {
746 max_offset = strip->right_handle(scene) - old_enddisp;
765 for (
Strip *strip : transformed_strips) {
767 strip->runtime->flag &=
~seq::StripRuntimeFlag::Overlap;
777 const Strip *strip =
ed->act_strip;
778 std::optional<int> edit_point;
779 if (strip !=
nullptr && (strip->flag &
SEQ_SELECT)) {
781 edit_point = strip->right_handle(scene) - 1;
784 edit_point = strip->left_handle();
787 ed->edit_point_set(scene, edit_point);
794 Strip *strip_prev =
nullptr;
799 for (a = 0, td = tc->
data; a < tc->data_len; a++, td++) {
800 TransDataSeq *tdsq =
static_cast<TransDataSeq *
>(td->
extra);
801 Strip *strip = tdsq->strip;
803 if (strip != strip_prev) {
826 const bool use_sync_markers)
861 for (
Strip *strip : strips) {
879 if (deselect_handles) {
910 if (deselect_handles) {
926 bool clamped =
false;
930 r_val[0] =
float(val[0]);
931 r_val[1] =
float(val[1]);
Read Blender memory allocation and freeing.
#define SET_FLAG_FROM_TEST(value, test, flag)
void add_multiple(Span< Key > keys)
bool contains(const Key &key) const
int64_t remove_if(Predicate &&predicate)
void sync_active_scene_and_time_with_scene_strip(bContext &C)
void relations_invalidate_cache(Scene *scene, Strip *strip)
VectorSet< Strip * > query_selected_strips(ListBaseT< Strip > *seqbase)
void transform_translate_strip(Scene *evil_scene, Strip *strip, int delta)
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
void transform_handle_overlap(Scene *scene, ListBaseT< Strip > *seqbasep, Span< Strip * > source_strips, bool use_sync_markers, Span< Strip * > time_dependent_strips)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
void edit_remove_flagged_strips(Scene *scene, ListBaseT< Strip > *seqbase)
void offset_animdata(const Scene *scene, Strip *strip, float ofs)
void expand_strips(Editing *ed, VectorSet< Strip * > &strips, const StripRelation include)
bool transform_single_image_check(const Strip *strip)
constexpr int MAX_CHANNELS
void edit_flag_for_removal(Scene *scene, Strip *strip)
eSeqRippleFlag tool_settings_ripple_flag_get(Scene *scene)
void transform_shuffle_vertical(ListBaseT< Strip > *seqbasep, Span< Strip * > strips, Scene *scene, const int channel_delta)
bool transform_is_locked(const ListBaseT< SeqTimelineChannel > *channels, const Strip *strip)
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
bool transform_strip_can_be_translated(const Strip *strip)
void tool_settings_overlap_mode_set(Scene *scene, eSeqOverlapMode overlap_mode)
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
int RNA_enum_get(PointerRNA *ptr, const char *name)
Scene * CTX_data_sequencer_scene(const bContext *C)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE int round_fl_to_int(float a)
MINLINE void copy_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])
MINLINE int max_ii(int a, int b)
MINLINE void add_v2_v2(float r[2], const float a[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)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
@ SEQ_RIPPLE_ALL_CHANNELS
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
@ USER_SEQ_ED_CLAMP_STRIPS_BY_DEFAULT
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
void unit_m3(float m[3][3])
@ ID_RECALC_SEQUENCER_STRIPS
MINLINE int min_ii(int a, int b)
int ED_markers_post_apply_transform(ListBaseT< TimeMarker > *markers, Scene *scene, int mode, float value, char side)
bool BLI_rcti_clamp_pt_v(const struct rcti *rect, int xy[2])
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
@ SPACE_SEQ_DESELECT_STRIP_HANDLE
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< TimeMarker > markers
ListBaseT< SpaceLink > spacedata