Blender V5.3
transform_snap_sequencer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstddef>
10#include <cstdlib>
11
12#include "BLI_assert.hh"
13#include "BLI_listbase.hh"
14#include "BLI_map.hh"
15#include "BLI_math_base_c.hh"
16#include "BLI_math_vector.hh"
17#include "BLI_math_vector_c.hh"
18#include "BLI_vector.hh"
19
20#include "MEM_guardedalloc.h"
21
22#include "DNA_scene_types.h"
23#include "DNA_screen_types.h"
24#include "DNA_sequence_types.h"
25#include "DNA_space_types.h"
26
27#include "BKE_scene.hh"
28
29#include "ED_transform.hh"
30
31#include "UI_view2d.hh"
32
33#include "SEQ_channels.hh"
34#include "SEQ_iterator.hh"
35#include "SEQ_relations.hh"
36#include "SEQ_render.hh"
37#include "SEQ_retiming.hh"
38#include "SEQ_sequencer.hh"
39#include "SEQ_transform.hh"
40
41#include "transform.hh"
42#include "transform_convert.hh"
43#include "transform_snap.hh"
44
45namespace blender::ed::transform {
46
50
51 MEM_CXX_CLASS_ALLOC_FUNCS("TransSeqSnapData")
52};
53
54/* In timeline snap data, a channel of 0 indicates "this snap type always applies to all channels",
55 * e.g. for snapping to frame ranges or markers, rather than individual strips. */
56static constexpr int all_channels = 0;
57
58/* -------------------------------------------------------------------- */
61
63{
64 const int snap_distance = seq::tool_settings_snap_distance_get(t->scene);
65 const View2D *v2d = &t->region->v2d;
66 return ui::view2d_region_to_view_x(v2d, snap_distance) - ui::view2d_region_to_view_x(v2d, 0);
67}
68
73
75
76/* -------------------------------------------------------------------- */
79
81{
82 const Editing *ed = seq::editing_get(scene);
83 const ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
84 ListBaseT<Strip> *seqbase = seq::active_seqbase_get(ed);
85
86 VectorSet<Strip *> strip_sources = seq::query_selected_strips(seqbase);
87 strip_sources.remove_if([&](Strip *strip) { return seq::transform_is_locked(channels, strip); });
88
89 const Map retiming_selection = seq::retiming_selection_get(ed);
90 /* Strips owned by retiming keys are technically not selected,
91 * but adding them to strip sources ensures they will be properly excluded from targets. */
92 for (Strip *strip : retiming_selection.values()) {
93 strip_sources.add(strip);
94 }
95
96 return strip_sources;
97}
98
100{
101 VectorSet<Strip *> strip_sources;
102
103 Editing *ed = seq::editing_get(scene);
104 ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
105
106 strip_sources = seq::query_rendered_strips(
107 scene, channels, ed->current_strips(), scene->r.cfra, 0);
108 strip_sources.remove_if([&](Strip *strip) { return (strip->flag & SEQ_SELECT) == 0; });
109
110 return strip_sources;
111}
112
114
115/* -------------------------------------------------------------------- */
118
120 const Span<Strip *> strip_sources,
121 const bool drag_and_drop)
122{
124 ListBaseT<Strip> *seqbase = seq::active_seqbase_get(ed);
125 ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
126 const short snap_flag = seq::tool_settings_snap_flag_get(scene);
127
128 /* Effects will always change position with strip to which they are connected and they don't
129 * have to be selected. Remove such strips from `snap_targets` collection. */
130 VectorSet effects_of_strip_sources = strip_sources;
131 seq::expand_strips(ed, effects_of_strip_sources, seq::StripRelation::Effects);
132 effects_of_strip_sources.remove_if(
133 [&](Strip *strip) { return strip->is_effect() && !strip->is_effect_with_inputs(); });
134
135 VectorSet<Strip *> strip_targets;
136 for (Strip &strip : *seqbase) {
137 if (!drag_and_drop && strip.flag & SEQ_SELECT && !seq::transform_is_locked(channels, &strip)) {
138 /* Selected (and unlocked) strips are being transformed, they shouldn't be a target. */
139 continue;
140 }
141 if (seq::render_is_muted(channels, &strip) && (snap_flag & SEQ_SNAP_IGNORE_MUTED)) {
142 continue;
143 }
144 if (strip.type == STRIP_TYPE_SOUND && (snap_flag & SEQ_SNAP_IGNORE_SOUND)) {
145 continue;
146 }
147 if (effects_of_strip_sources.contains(&strip)) {
148 continue;
149 }
150
151 strip_targets.add(&strip);
152 }
153
154 return strip_targets;
155}
156
158{
159 Scene *scene = t->scene;
160 short snap_mode = t->tsnap.mode;
161
162 VectorSet<Strip *> strip_targets;
163
164 /* We don't need to calculate strip snap targets if the option is unselected. */
165 if ((snap_mode & SEQ_SNAP_TO_STRIPS_PREVIEW) == 0) {
166 return strip_targets;
167 }
168
169 Editing *ed = seq::editing_get(scene);
170 ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
171
172 strip_targets = seq::query_rendered_strips(
173 scene, channels, ed->current_strips(), scene->r.cfra, 0);
174
175 /* Selected strips are only valid targets when snapping the cursor or origin. */
176 if ((t->data_type == &TransConvertType_SequencerImage) && (t->flag & T_ORIGIN) == 0) {
177 strip_targets.remove_if([&](Strip *strip) { return (strip->flag & SEQ_SELECT) != 0; });
178 }
179
180 return strip_targets;
181}
182
184
185/* -------------------------------------------------------------------- */
188
189static int cmp_fn(const void *a, const void *b)
190{
191 return round_fl_to_int((*static_cast<float2 *>(const_cast<void *>(a)))[0] -
192 (*static_cast<float2 *>(const_cast<void *>(b)))[0]);
193}
194
195static void build_sources_timeline(const Scene *scene,
196 TransSeqSnapData *snap_data,
197 const Span<Strip *> strip_sources)
198{
199 for (Strip *strip : strip_sources) {
200 const int channel = strip->channel;
201 const int left = strip->left_handle();
202 const int right = strip->right_handle(scene);
203
204 if (strip->flag & SEQ_LEFTSEL && !(strip->flag & SEQ_RIGHTSEL)) {
205 snap_data->sources.append(float2(left, channel));
206 }
207 else if (strip->flag & SEQ_RIGHTSEL && !(strip->flag & SEQ_LEFTSEL)) {
208 snap_data->sources.append(float2(right, channel));
209 }
210 else {
211 snap_data->sources.append(float2(left, channel));
212 snap_data->sources.append(float2(right, channel));
213 }
214 }
215
216 qsort(snap_data->sources.data(), snap_data->sources.size(), sizeof(float2), cmp_fn);
217}
218
219static void build_sources_timeline_retiming(const Scene *scene, TransSeqSnapData *snap_data)
220{
221 const Editing *ed = seq::editing_get(scene);
222 const Map retiming_selection = seq::retiming_selection_get(ed);
223
224 for (auto item : retiming_selection.items()) {
225 const int channel = item.value->channel;
226 const int key_frame = seq::retiming_key_frame_get(scene, item.value, item.key);
227 snap_data->sources.append(float2(key_frame, channel));
228 }
229
230 qsort(snap_data->sources.data(), snap_data->sources.size(), sizeof(float2), cmp_fn);
231}
232
233static void build_sources_preview(const Scene *scene,
234 TransSeqSnapData *snap_data,
235 const Span<Strip *> strip_sources,
236 bool translate_origin)
237{
238 for (Strip *strip : strip_sources) {
239 if (!translate_origin) {
240 const Array<float2> strip_image_quad = seq::image_transform_quad_get(scene, strip);
241 for (const float2 &point : strip_image_quad) {
242 snap_data->sources.append(point);
243 }
244 }
245
246 /* Add origins last */
247 const float2 image_origin = seq::image_transform_origin_preview_offset_get(scene, strip);
248 snap_data->sources.append(image_origin);
249 }
250}
251
253
254/* -------------------------------------------------------------------- */
257
258static void build_targets_timeline(const Scene *scene,
259 const short snap_mode,
260 TransSeqSnapData *snap_data,
261 const Span<Strip *> strip_targets)
262{
263 if (snap_mode & SEQ_SNAP_TO_CURRENT_FRAME) {
264 snap_data->targets.append(float2(scene->r.cfra, all_channels));
265 }
266
267 if (snap_mode & SEQ_SNAP_TO_MARKERS) {
268 for (TimeMarker &marker : scene->markers) {
269 snap_data->targets.append(float2(marker.frame, all_channels));
270 }
271 }
272
273 if (snap_mode & SEQ_SNAP_TO_FRAME_RANGE) {
274 snap_data->targets.append(float2(scene->playback_start(), all_channels));
275 snap_data->targets.append(float2(scene->playback_end() + 1, all_channels));
276 /* Also snap to meta-strip display range if we are in a meta-strip. */
278 if (ms != nullptr) {
279 snap_data->targets.append(float2(ms->disp_range[0], all_channels));
280 snap_data->targets.append(float2(ms->disp_range[1], all_channels));
281 }
282 }
283
284 for (Strip *strip : strip_targets) {
285 const int channel = strip->channel;
286 /* Snap to left and right handles by default. */
287 snap_data->targets.append(float2(strip->left_handle(), channel));
288 snap_data->targets.append(float2(strip->right_handle(scene), channel));
289
290 /* Effects and strips with a single static image do not have holds. Skip these strips. */
291 if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD && !strip->is_effect() &&
293 {
294 if (strip->content_start() > strip->left_handle()) {
295 snap_data->targets.append(float2(strip->content_start(), channel));
296 }
297 if (strip->content_end(scene) < strip->right_handle(scene)) {
298 snap_data->targets.append(float2(strip->content_end(scene), channel));
299 }
300 }
301
302 if (snap_mode & SEQ_SNAP_TO_RETIMING) {
303 for (SeqRetimingKey &key : seq::retiming_keys_get(strip)) {
304 const int key_frame = seq::retiming_key_frame_get(scene, strip, &key);
305 /* Only add visible keyframes. */
306 if (strip->intersects_frame(scene, key_frame)) {
307 snap_data->targets.append(float2(key_frame, channel));
308 }
309 }
310 }
311 }
312
313 qsort(snap_data->targets.data(), snap_data->targets.size(), sizeof(float2), cmp_fn);
314}
315
316static void build_targets_preview(const Scene *scene,
317 const View2D *v2d,
318 const short snap_mode,
319 TransSeqSnapData *snap_data,
320 const Span<Strip *> strip_targets,
321 const Span<Strip *> strip_sources,
322 bool translate_origin)
323{
324 if (snap_mode & SEQ_SNAP_TO_PREVIEW_BORDERS) {
325 snap_data->targets.append(float2(v2d->tot.xmin, v2d->tot.ymin));
326 snap_data->targets.append(float2(v2d->tot.xmax, v2d->tot.ymax));
327 snap_data->targets.append(float2(v2d->tot.xmin, v2d->tot.ymax));
328 snap_data->targets.append(float2(v2d->tot.xmax, v2d->tot.ymin));
329 }
330
331 if (snap_mode & SEQ_SNAP_TO_PREVIEW_CENTER) {
332 snap_data->targets.append(float2(0, 0));
333 }
334
335 auto build_corners = [&](Strip *strip) {
336 const Array<float2> corners = seq::image_transform_quad_get(scene, strip);
337 for (const float2 &point : corners) {
338 snap_data->targets.append(point);
339 }
340 return corners;
341 };
342
343 if (snap_mode & SEQ_SNAP_TO_STRIPS_PREVIEW) {
344 for (Strip *strip : strip_targets) {
345 build_corners(strip);
346 const float2 image_origin = seq::image_transform_origin_preview_offset_get(scene, strip);
347 snap_data->targets.append(image_origin);
348 }
349 }
350
351 if (translate_origin) {
352 for (Strip *strip : strip_sources) {
353 const Array<float2> corners = build_corners(strip);
354 const float2 center = (corners[0] + corners[1] + corners[2] + corners[3]) * 0.25f;
355 snap_data->targets.append(center);
356 }
357 }
358}
359
361
362/* -------------------------------------------------------------------- */
365
366static void build_snap_data_timeline(const TransInfo *t, TransSeqSnapData *snap_data)
367{
368 Scene *scene = t->scene;
369 short snap_mode = t->tsnap.mode;
370
372 VectorSet<Strip *> strip_targets = query_strip_targets_timeline(scene, strip_sources, false);
373
374 /* Build arrays of snap points. */
376 build_sources_timeline(scene, snap_data, strip_sources);
377 }
378 else { /* &TransConvertType_SequencerRetiming */
379 build_sources_timeline_retiming(scene, snap_data);
380 }
381 build_targets_timeline(scene, snap_mode, snap_data, strip_targets);
382}
383
384static void build_snap_data_preview(const TransInfo *t, TransSeqSnapData *snap_data)
385{
386 Scene *scene = t->scene;
387 short snap_mode = t->tsnap.mode;
388 View2D *v2d = &t->region->v2d;
389 SpaceSeq *sseq = t->area->spacedata.first_as<SpaceSeq>();
390
391 VectorSet<Strip *> strip_sources = query_strip_sources_preview(scene);
393
394 /* Build arrays of snap points. */
396 const bool translate_origin = (t->flag & T_ORIGIN);
397 build_sources_preview(scene, snap_data, strip_sources, translate_origin);
399 scene, v2d, snap_mode, snap_data, strip_targets, strip_sources, translate_origin);
400 }
402 float2 cursor_view = float2(sseq->cursor) * float2(t->aspect);
403 snap_data->sources.append(cursor_view);
404 build_targets_preview(scene, v2d, snap_mode, snap_data, strip_targets, {}, false);
405 }
406}
407
409{
410 TransSeqSnapData *snap_data = MEM_new<TransSeqSnapData>(__func__);
411
413 build_snap_data_timeline(t, snap_data);
414 }
415 else {
416 build_snap_data_preview(t, snap_data);
417 }
418
419 if (snap_data->sources.is_empty() || snap_data->targets.is_empty()) {
420 MEM_delete(snap_data);
421 return nullptr;
422 }
423
424 return snap_data;
425}
426
428{
429 MEM_delete(data);
430}
431
433
434/* -------------------------------------------------------------------- */
437
438static bool snap_calc_timeline(TransInfo *t, const TransSeqSnapData *snap_data)
439{
440 /* Prevent snapping when constrained to Y axis. */
441 if (t->con.mode & CON_APPLY && t->con.mode & CON_AXIS1) {
442 return false;
443 }
444
445 const short snap_flag = seq::tool_settings_snap_flag_get(t->scene);
446 const bool ignore_other_channels = !(snap_flag & SEQ_SNAP_TO_ALL_CHANNEL_STRIPS);
447
448 int best_dist = MAXFRAME;
449 float2 best_target(0.0f);
450 float2 best_source(0.0f);
451
452 for (const float2 source : snap_data->sources) {
453 for (const float2 target : snap_data->targets) {
454 if (ignore_other_channels && target[1] != all_channels &&
455 (source[1] + round_fl_to_int(t->values[1])) != target[1])
456 {
457 continue;
458 }
459
460 int source_frame = source[0];
461 int target_frame = target[0];
462 int dist = abs(target_frame - (source_frame + round_fl_to_int(t->values[0])));
463 if (dist > best_dist) {
464 continue;
465 }
466
467 best_dist = dist;
468 best_target = target;
469 best_source = source;
470 }
471 }
472
473 if (best_dist > snap_distance_frame_threshold_get(t)) {
474 return false;
475 }
476
477 float2 best_offset(float(best_target[0] - best_source[0]), 0.0f);
478 if (transform_convert_sequencer_clamp(t, best_offset)) {
479 return false;
480 }
481
482 copy_v2_v2(t->tsnap.snap_target, best_target);
483 copy_v2_v2(t->tsnap.snap_source, best_source);
484 return true;
485}
486
487static bool snap_calc_preview(TransInfo *t, const TransSeqSnapData *snap_data)
488{
489 /* Store best snap candidates in x and y directions separately. */
490 float2 best_dist(std::numeric_limits<float>::max());
491 float2 best_target(0.0f);
492 float2 best_source(0.0f);
493
494 for (const float2 source : snap_data->sources) {
495 for (const float2 target : snap_data->targets) {
496 /* First update snaps in x direction, then y direction. */
497 constexpr int num_axes = 2;
498 for (const int i : IndexRange(num_axes)) {
499 int dist = abs(target[i] - (source[i] + t->values[i]));
500 if (dist > best_dist[i]) {
501 continue;
502 }
503
504 best_dist[i] = dist;
505 best_target[i] = target[i];
506 best_source[i] = source[i];
507 }
508 }
509 }
510
513
514 if (best_dist[0] <= thr) {
515 t->tsnap.snap_target[0] = best_target[0];
516 t->tsnap.snap_source[0] = best_source[0];
518 }
519
520 if (best_dist[1] <= thr) {
521 t->tsnap.snap_target[1] = best_target[1];
522 t->tsnap.snap_source[1] = best_source[1];
524 }
525
526 return (best_dist[0] <= thr || best_dist[1] <= thr);
527}
528
530{
531 const TransSeqSnapData *snap_data = t->tsnap.seq_context;
532 if (snap_data == nullptr) {
533 return false;
534 }
535
537 return snap_calc_timeline(t, snap_data);
538 }
539 return snap_calc_preview(t, snap_data);
540}
541
543{
544 *vec = t->tsnap.snap_target[0] - t->tsnap.snap_source[0];
545}
546
548{
549 /* Apply snap along x and y axes independently. */
550 if (t->tsnap.direction & DIR_GLOBAL_X) {
551 vec[0] = t->tsnap.snap_target[0] - t->tsnap.snap_source[0];
552 }
553
554 if (t->tsnap.direction & DIR_GLOBAL_Y) {
555 vec[1] = t->tsnap.snap_target[1] - t->tsnap.snap_source[1];
556 }
557}
558
560
561/* -------------------------------------------------------------------- */
564
566 const int left_frame,
567 const int right_frame,
568 const int channel)
569{
570 Scene *scene = t->scene;
571 TransSeqSnapData *snap_data = MEM_new<TransSeqSnapData>(__func__);
572
573 VectorSet<Strip *> empty_col;
574 VectorSet<Strip *> strip_targets = query_strip_targets_timeline(scene, empty_col, true);
575
576 BLI_assert(left_frame <= right_frame);
577
578 snap_data->sources.append(float2(left_frame, channel));
579 snap_data->sources.append(float2(right_frame, channel));
580
581 /* Build arrays of snap target frames. */
582 const short snap_mode = t->tsnap.mode;
583 build_targets_timeline(scene, snap_mode, snap_data, strip_targets);
584
585 t->tsnap.seq_context = snap_data;
586 bool snap_success = snap_sequencer_calc(t);
587 snap_sequencer_data_free(snap_data);
588 t->tsnap.seq_context = nullptr;
589
590 float snap_offset = 0;
591 if (snap_success) {
593 snap_sequencer_apply_seqslide(t, &snap_offset);
594 }
595 else {
597 }
598
599 return snap_offset;
600}
601
603 ARegion *region,
604 const int left_frame,
605 const int right_frame,
606 const int channel,
607 int *r_snap_distance,
608 float2 *r_snap_point)
609{
610 TransInfo t = {nullptr};
611 t.scene = scene;
612 t.region = region;
613 t.values[0] = 0;
615
618 *r_snap_distance = snap_sequencer_calc_drag_drop_impl(&t, left_frame, right_frame, channel);
619 copy_v2_v2(*r_snap_point, t.tsnap.snap_target);
620 return validSnap(&t);
621}
622
623void snap_sequencer_draw_drag_drop(Scene *scene, ARegion *region, const float2 snap_point)
624{
625 /* Reuse the snapping drawing code from the transform system. */
626 TransInfo t = {nullptr};
627 t.scene = scene;
628 t.region = region;
632 t.tsnap.flag = SCE_SNAP;
634 copy_v2_v2(t.tsnap.snap_target, snap_point);
635
636 drawSnapping(&t);
637}
638
640
641} // namespace blender::ed::transform
#define MAXFRAME
Read Blender memory allocation and freeing.
#define ELEM(...)
constexpr IndexRange()=default
ValueIterator values() const &
Definition BLI_map.hh:884
ItemIterator items() const &
Definition BLI_map.hh:902
bool add(const Key &key)
bool contains(const Key &key) const
int64_t remove_if(Predicate &&predicate)
#define abs
static void build_snap_data_preview(const TransInfo *t, TransSeqSnapData *snap_data)
static int snap_sequencer_calc_drag_drop_impl(TransInfo *t, const int left_frame, const int right_frame, const int channel)
TransConvertTypeInfo TransConvertType_Sequencer
static int snap_distance_frame_threshold_get(const TransInfo *t)
static constexpr int all_channels
static VectorSet< Strip * > query_strip_targets_preview(const TransInfo *t)
bool validSnap(const TransInfo *t)
static void build_targets_timeline(const Scene *scene, const short snap_mode, TransSeqSnapData *snap_data, const Span< Strip * > strip_targets)
void snap_sequencer_apply_seqslide(TransInfo *t, float *vec)
static VectorSet< Strip * > query_strip_sources_preview(const Scene *scene)
void snap_sequencer_image_apply_translate(TransInfo *t, float vec[2])
static void build_targets_preview(const Scene *scene, const View2D *v2d, const short snap_mode, TransSeqSnapData *snap_data, const Span< Strip * > strip_targets, const Span< Strip * > strip_sources, bool translate_origin)
bool snap_sequencer_calc_drag_drop(Scene *scene, ARegion *region, const int left_frame, const int right_frame, const int channel, int *r_snap_distance, float2 *r_snap_point)
static bool snap_calc_preview(TransInfo *t, const TransSeqSnapData *snap_data)
TransSeqSnapData * snap_sequencer_data_build(const TransInfo *t)
void snap_sequencer_draw_drag_drop(Scene *scene, ARegion *region, const float2 snap_point)
bool transform_convert_sequencer_clamp(const TransInfo *t, float r_val[2])
static void build_sources_timeline(const Scene *scene, TransSeqSnapData *snap_data, const Span< Strip * > strip_sources)
static float snap_distance_view_threshold_get(const TransInfo *t)
void drawSnapping(TransInfo *t)
static void build_sources_preview(const Scene *scene, TransSeqSnapData *snap_data, const Span< Strip * > strip_sources, bool translate_origin)
static void build_sources_timeline_retiming(const Scene *scene, TransSeqSnapData *snap_data)
void snap_sequencer_data_free(TransSeqSnapData *data)
static VectorSet< Strip * > query_strip_targets_timeline(Scene *scene, const Span< Strip * > strip_sources, const bool drag_and_drop)
static VectorSet< Strip * > query_strip_sources_timeline(const Scene *scene)
static int cmp_fn(const void *a, const void *b)
TransConvertTypeInfo TransConvertType_CursorSequencer
static bool snap_calc_timeline(TransInfo *t, const TransSeqSnapData *snap_data)
static void build_snap_data_timeline(const TransInfo *t, TransSeqSnapData *snap_data)
MutableSpan< SeqRetimingKey > retiming_keys_get(const Strip *strip)
VectorSet< Strip * > query_selected_strips(ListBaseT< Strip > *seqbase)
Definition iterator.cc:164
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
Definition sequencer.cc:463
Array< float2 > image_transform_quad_get(const Scene *scene, const Strip *strip)
bool render_is_muted(const ListBaseT< SeqTimelineChannel > *channels, const Strip *strip)
Definition render.cc:2241
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:304
int retiming_key_frame_get(const Scene *scene, const Strip *strip, const SeqRetimingKey *key)
void expand_strips(Editing *ed, VectorSet< Strip * > &strips, const StripRelation include)
Definition iterator.cc:70
bool transform_single_image_check(const Strip *strip)
MetaStack * meta_stack_active_get(const Editing *ed)
Definition sequencer.cc:484
Editing * editing_ensure(Scene *scene)
Definition sequencer.cc:309
float2 image_transform_origin_preview_offset_get(const Scene *scene, const Strip *strip)
short tool_settings_snap_flag_get(Scene *scene)
Definition sequencer.cc:421
int tool_settings_snap_distance_get(Scene *scene)
Definition sequencer.cc:427
bool transform_is_locked(const ListBaseT< SeqTimelineChannel > *channels, const Strip *strip)
short tool_settings_snap_mode_get(Scene *scene)
Definition sequencer.cc:415
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
Definition channels.cc:26
Map< SeqRetimingKey *, Strip * > retiming_selection_get(const Editing *ed)
VectorSet< Strip * > query_rendered_strips(const Scene *scene, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbase, const int timeline_frame, const int displayed_channel)
Definition iterator.cc:239
float view2d_region_to_view_x(const View2D *v2d, float x)
Definition view2d.cc:1640
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE int round_fl_to_int(float a)
MINLINE void copy_v2_v2(float r[2], const float a[2])
VecBase< float, 2 > float2
BMesh const char void * data
@ SEQ_SNAP_TO_ALL_CHANNEL_STRIPS
@ SEQ_SNAP_TO_PREVIEW_BORDERS
@ SEQ_SNAP_TO_PREVIEW_CENTER
@ SEQ_SNAP_TO_STRIPS_PREVIEW
@ SEQ_SNAP_TO_CURRENT_FRAME
@ SEQ_SNAP_TO_FRAME_RANGE
ListBaseT< TimeMarker > markers
struct RenderData r
ListBaseT< SpaceLink > spacedata
TransConvertTypeInfo * data_type
Definition transform.hh:836
conversion and adaptation of different datablocks to a common struct.