Blender  V3.3
transform_convert_sequencer.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include "DNA_space_types.h"
9 
10 #include "MEM_guardedalloc.h"
11 
12 #include "BLI_listbase.h"
13 #include "BLI_math.h"
14 
15 #include "BKE_context.h"
16 #include "BKE_main.h"
17 #include "BKE_report.h"
18 
19 #include "ED_markers.h"
20 #include "ED_time_scrub_ui.h"
21 
22 #include "SEQ_animation.h"
23 #include "SEQ_channels.h"
24 #include "SEQ_edit.h"
25 #include "SEQ_effects.h"
26 #include "SEQ_iterator.h"
27 #include "SEQ_relations.h"
28 #include "SEQ_sequencer.h"
29 #include "SEQ_time.h"
30 #include "SEQ_transform.h"
31 #include "SEQ_utils.h"
32 
33 #include "UI_view2d.h"
34 
35 #include "transform.h"
36 #include "transform_convert.h"
37 
38 #define SEQ_EDGE_PAN_INSIDE_PAD 3.5
39 #define SEQ_EDGE_PAN_OUTSIDE_PAD 0 /* Disable clamping for panning, use whole screen. */
40 #define SEQ_EDGE_PAN_SPEED_RAMP 1
41 #define SEQ_EDGE_PAN_MAX_SPEED 4 /* In UI units per second, slower than default. */
42 #define SEQ_EDGE_PAN_DELAY 1.0f
43 #define SEQ_EDGE_PAN_ZOOM_INFLUENCE 0.5f
44 
46 typedef struct TransDataSeq {
47  struct Sequence *seq;
49  int flag;
54  short sel_flag;
55 
57 
61 typedef struct TransSeq {
65 
66  /* Initial rect of the view2d, used for computing offset during edge panning */
69 
70  /* Strips that aren't selected, but their position entirely depends on transformed strips. */
73 
74 /* -------------------------------------------------------------------- */
78 /* This function applies the rules for transforming a strip so duplicate
79  * checks don't need to be added in multiple places.
80  *
81  * count and flag MUST be set.
82  */
83 static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_count, int *r_flag)
84 {
85  Scene *scene = t->scene;
86  Editing *ed = SEQ_editing_get(t->scene);
88 
89  /* for extend we need to do some tricks */
90  if (t->mode == TFM_TIME_EXTEND) {
91 
92  /* *** Extend Transform *** */
93  int cfra = scene->r.cfra;
96 
97  if (((seq->flag & SELECT) == 0 || SEQ_transform_is_locked(channels, seq))) {
98  *r_count = 0;
99  *r_flag = 0;
100  }
101  else {
102  *r_count = 1; /* unless its set to 0, extend will never set 2 handles at once */
103  *r_flag = (seq->flag | SELECT) & ~(SEQ_LEFTSEL | SEQ_RIGHTSEL);
104 
105  if (t->frame_side == 'R') {
106  if (right <= cfra) {
107  *r_count = *r_flag = 0;
108  } /* ignore */
109  else if (left > cfra) {
110  } /* keep the selection */
111  else {
112  *r_flag |= SEQ_RIGHTSEL;
113  }
114  }
115  else {
116  if (left >= cfra) {
117  *r_count = *r_flag = 0;
118  } /* ignore */
119  else if (right < cfra) {
120  } /* keep the selection */
121  else {
122  *r_flag |= SEQ_LEFTSEL;
123  }
124  }
125  }
126  }
127  else {
128 
129  t->frame_side = 'B';
130 
131  /* *** Normal Transform *** */
132 
133  /* Count */
134 
135  /* Non nested strips (resect selection and handles) */
136  if ((seq->flag & SELECT) == 0 || SEQ_transform_is_locked(channels, seq)) {
137  *r_count = 0;
138  *r_flag = 0;
139  }
140  else {
141  if ((seq->flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) == (SEQ_LEFTSEL | SEQ_RIGHTSEL)) {
142  *r_flag = seq->flag;
143  *r_count = 2; /* we need 2 transdata's */
144  }
145  else {
146  *r_flag = seq->flag;
147  *r_count = 1; /* selected or with a handle selected */
148  }
149  }
150  }
151 }
152 
153 static int SeqTransCount(TransInfo *t, ListBase *seqbase)
154 {
155  Sequence *seq;
156  int tot = 0, count, flag;
157 
158  for (seq = seqbase->first; seq; seq = seq->next) {
159  SeqTransInfo(t, seq, &count, &flag); /* ignore the flag */
160  tot += count;
161  }
162 
163  return tot;
164 }
165 
167  TransData *td,
168  TransData2D *td2d,
169  TransDataSeq *tdsq,
170  Sequence *seq,
171  int flag,
172  int sel_flag)
173 {
174  int start_left;
175 
176  switch (sel_flag) {
177  case SELECT:
178  /* Use seq_tx_get_final_left() and an offset here
179  * so transform has the left hand location of the strip.
180  * tdsq->start_offset is used when flushing the tx data back */
181  start_left = SEQ_time_left_handle_frame_get(scene, seq);
182  td2d->loc[0] = start_left;
183  tdsq->start_offset = start_left - seq->start; /* use to apply the original location */
184  break;
185  case SEQ_LEFTSEL:
186  start_left = SEQ_time_left_handle_frame_get(scene, seq);
187  td2d->loc[0] = start_left;
188  break;
189  case SEQ_RIGHTSEL:
190  td2d->loc[0] = SEQ_time_right_handle_frame_get(scene, seq);
191  break;
192  }
193 
194  td2d->loc[1] = seq->machine; /* channel - Y location */
195  td2d->loc[2] = 0.0f;
196  td2d->loc2d = NULL;
197 
198  tdsq->seq = seq;
199 
200  /* Use instead of seq->flag for nested strips and other
201  * cases where the selection may need to be modified */
202  tdsq->flag = flag;
203  tdsq->sel_flag = sel_flag;
204 
205  td->extra = (void *)tdsq; /* allow us to update the strip from here */
206 
207  td->flag = 0;
208  td->loc = td2d->loc;
209  copy_v3_v3(td->center, td->loc);
210  copy_v3_v3(td->iloc, td->loc);
211 
212  memset(td->axismtx, 0, sizeof(td->axismtx));
213  td->axismtx[2][2] = 1.0f;
214 
215  td->ext = NULL;
216  td->val = NULL;
217 
218  td->flag |= TD_SELECTED;
219  td->dist = 0.0;
220 
221  unit_m3(td->mtx);
222  unit_m3(td->smtx);
223 
224  /* Time Transform (extend) */
225  td->val = td2d->loc;
226  td->ival = td2d->loc[0];
227 
228  return td;
229 }
230 
232  TransInfo *t, ListBase *seqbase, TransData *td, TransData2D *td2d, TransDataSeq *tdsq)
233 {
234  Sequence *seq;
235  Scene *scene = t->scene;
236  int count, flag;
237  int tot = 0;
238 
239  for (seq = seqbase->first; seq; seq = seq->next) {
240 
241  SeqTransInfo(t, seq, &count, &flag);
242 
243  /* use 'flag' which is derived from seq->flag but modified for special cases */
244  if (flag & SELECT) {
245  if (flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) {
246  if (flag & SEQ_LEFTSEL) {
247  SeqToTransData(scene, td++, td2d++, tdsq++, seq, flag, SEQ_LEFTSEL);
248  tot++;
249  }
250  if (flag & SEQ_RIGHTSEL) {
251  SeqToTransData(scene, td++, td2d++, tdsq++, seq, flag, SEQ_RIGHTSEL);
252  tot++;
253  }
254  }
255  else {
256  SeqToTransData(scene, td++, td2d++, tdsq++, seq, flag, SELECT);
257  tot++;
258  }
259  }
260  }
261  return tot;
262 }
263 
265 {
266  if ((custom_data->data != NULL) && custom_data->use_free) {
267  TransSeq *ts = custom_data->data;
269  MEM_freeN(ts->tdseq);
270  MEM_freeN(custom_data->data);
271  custom_data->data = NULL;
272  }
273 }
274 
275 /* Canceled, need to update the strips display. */
276 static void seq_transform_cancel(TransInfo *t, SeqCollection *transformed_strips)
277 {
278  ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(t->scene));
279 
280  Sequence *seq;
281  SEQ_ITERATOR_FOREACH (seq, transformed_strips) {
282  /* Handle pre-existing overlapping strips even when operator is canceled.
283  * This is necessary for SEQUENCER_OT_duplicate_move macro for example. */
284  if (SEQ_transform_test_overlap(t->scene, seqbase, seq)) {
285  SEQ_transform_seqbase_shuffle(seqbase, seq, t->scene);
286  }
287  }
288 }
289 
291 {
292  Editing *ed = SEQ_editing_get(t->scene);
293  return SEQ_active_seqbase_get(ed);
294 }
295 
296 static bool seq_transform_check_overlap(SeqCollection *transformed_strips)
297 {
298  Sequence *seq;
299  SEQ_ITERATOR_FOREACH (seq, transformed_strips) {
300  if (seq->flag & SEQ_OVERLAP) {
301  return true;
302  }
303  }
304  return false;
305 }
306 
308 {
309  SeqCollection *collection = SEQ_collection_create(__func__);
310  TransData *td = tc->data;
311  for (int a = 0; a < tc->data_len; a++, td++) {
312  Sequence *seq = ((TransDataSeq *)td->extra)->seq;
313  SEQ_collection_append_strip(seq, collection);
314  }
315  return collection;
316 }
317 
318 static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data)
319 {
320  Editing *ed = SEQ_editing_get(t->scene);
321  if (ed == NULL) {
322  free_transform_custom_data(custom_data);
323  return;
324  }
325 
326  SeqCollection *transformed_strips = seq_transform_collection_from_transdata(tc);
328  t->scene, seqbase_active_get(t), transformed_strips, SEQ_query_strip_effect_chain);
329 
330  Sequence *seq;
331  SEQ_ITERATOR_FOREACH (seq, transformed_strips) {
332  seq->flag &= ~SEQ_IGNORE_CHANNEL_LOCK;
333  }
334 
335  if (t->state == TRANS_CANCEL) {
336  seq_transform_cancel(t, transformed_strips);
337  SEQ_collection_free(transformed_strips);
338  free_transform_custom_data(custom_data);
339  return;
340  }
341 
342  TransSeq *ts = tc->custom.type.data;
343  ListBase *seqbasep = seqbase_active_get(t);
344  Scene *scene = t->scene;
345  const bool use_sync_markers = (((SpaceSeq *)t->area->spacedata.first)->flag &
346  SEQ_MARKER_TRANS) != 0;
347  if (seq_transform_check_overlap(transformed_strips)) {
349  scene, seqbasep, transformed_strips, ts->time_dependent_strips, use_sync_markers);
350  }
351 
352  SEQ_collection_free(transformed_strips);
354  free_transform_custom_data(custom_data);
355 }
356 
358 {
359  SeqCollection *strips = SEQ_collection_create(__func__);
360  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
361  if ((seq->flag & SELECT) != 0 && ((seq->flag & (SEQ_LEFTSEL | SEQ_RIGHTSEL)) == 0)) {
362  SEQ_collection_append_strip(seq, strips);
363  }
364  }
365  return strips;
366 }
367 
368 typedef enum SeqInputSide {
372 
374 {
375  Sequence *input = effect->seq1;
376  if (effect->seq2 && (SEQ_time_left_handle_frame_get(scene, effect->seq2) -
378  side >
379  0) {
380  input = effect->seq2;
381  }
382  return input;
383 }
384 
386 {
387  Sequence *input = effect, *seq_iter = effect;
388  while (seq_iter != NULL) {
389  input = seq_iter;
390  seq_iter = effect_input_get(scene, seq_iter, side);
391  }
392  return input;
393 }
394 
400 {
401  ListBase *seqbase = seqbase_active_get(t);
402 
403  /* Query dependent strips where used strips do not have handles selected.
404  * If all inputs of any effect even indirectly(through another effect) points to selected strip,
405  * it's position will change. */
406 
407  SeqCollection *strips_no_handles = query_selected_strips_no_handles(seqbase);
408  /* Selection is needed as reference for related strips. */
409  SeqCollection *dependent = SEQ_collection_duplicate(strips_no_handles);
410  SEQ_collection_expand(t->scene, seqbase, strips_no_handles, SEQ_query_strip_effect_chain);
411  bool strip_added = true;
412 
413  while (strip_added) {
414  strip_added = false;
415 
416  Sequence *seq;
417  SEQ_ITERATOR_FOREACH (seq, strips_no_handles) {
418  if (SEQ_collection_has_strip(seq, dependent)) {
419  continue; /* Strip is already in collection, skip it. */
420  }
421 
422  /* If both seq1 and seq2 exist, both must be selected. */
423  if (seq->seq1 && SEQ_collection_has_strip(seq->seq1, dependent)) {
424  if (seq->seq2 && !SEQ_collection_has_strip(seq->seq2, dependent)) {
425  continue;
426  }
427  strip_added = true;
428  SEQ_collection_append_strip(seq, dependent);
429  }
430  }
431  }
432 
433  SEQ_collection_free(strips_no_handles);
434 
435  /* Query dependent strips where used strips do have handles selected.
436  * If any 2-input effect changes position because handles were moved, animation should be offset.
437  * With single input effect, it is less likely desirable to move animation. */
438 
439  SeqCollection *selected_strips = SEQ_query_selected_strips(seqbase);
440  SEQ_collection_expand(t->scene, seqbase, selected_strips, SEQ_query_strip_effect_chain);
441  Sequence *seq;
442  SEQ_ITERATOR_FOREACH (seq, selected_strips) {
443  /* Check only 2 input effects. */
444  if (seq->seq1 == NULL || seq->seq2 == NULL) {
445  continue;
446  }
447 
448  /* Find immediate base inputs(left and right side). */
449  Sequence *input_left = effect_base_input_get(t->scene, seq, SEQ_INPUT_LEFT);
450  Sequence *input_right = effect_base_input_get(t->scene, seq, SEQ_INPUT_RIGHT);
451 
452  if ((input_left->flag & SEQ_RIGHTSEL) != 0 && (input_right->flag & SEQ_LEFTSEL) != 0) {
453  SEQ_collection_append_strip(seq, dependent);
454  }
455  }
456  SEQ_collection_free(selected_strips);
457 
458  /* Remove all non-effects. */
459  SEQ_ITERATOR_FOREACH (seq, dependent) {
461  SEQ_collection_remove_strip(seq, dependent);
462  }
463  }
464 
465  return dependent;
466 }
467 
469 {
470  Scene *scene = t->scene;
471  Editing *ed = SEQ_editing_get(t->scene);
472  TransData *td = NULL;
473  TransData2D *td2d = NULL;
474  TransDataSeq *tdsq = NULL;
475  TransSeq *ts = NULL;
476 
477  int count = 0;
478 
480 
481  if (ed == NULL) {
482  tc->data_len = 0;
483  return;
484  }
485 
486  /* Disable cursor wrapping for edge pan. */
487  if (t->mode == TFM_TRANSLATION) {
488  t->flag |= T_NO_CURSOR_WRAP;
489  }
490 
492  t->frame_side = transform_convert_frame_side_dir_get(t, (float)scene->r.cfra);
493 
494  count = SeqTransCount(t, ed->seqbasep);
495 
496  /* allocate memory for data */
497  tc->data_len = count;
498 
499  /* stop if trying to build list if nothing selected */
500  if (count == 0) {
501  return;
502  }
503 
504  tc->custom.type.data = ts = MEM_callocN(sizeof(TransSeq), "transseq");
505  tc->custom.type.use_free = true;
506  td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransSeq TransData");
507  td2d = tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransSeq TransData2D");
508  ts->tdseq = tdsq = MEM_callocN(tc->data_len * sizeof(TransDataSeq), "TransSeq TransDataSeq");
509 
510  /* Custom data to enable edge panning during transformation. */
511  UI_view2d_edge_pan_init(t->context,
512  &ts->edge_pan,
519  UI_view2d_edge_pan_set_limits(&ts->edge_pan, -FLT_MAX, FLT_MAX, 1, MAXSEQ + 1);
520  ts->initial_v2d_cur = t->region->v2d.cur;
521 
522  /* loop 2: build transdata array */
523  SeqToTransData_build(t, ed->seqbasep, td, td2d, tdsq);
524 
527  if ((seq->flag & SELECT) != 0) {
530  }
531  }
532 
534 }
535 
538 /* -------------------------------------------------------------------- */
542 static void view2d_edge_pan_loc_compensate(TransInfo *t, float loc_in[2], float r_loc[2])
543 {
544  TransSeq *ts = (TransSeq *)TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data;
545 
546  /* Initial and current view2D rects for additional transform due to view panning and zooming */
547  const rctf *rect_src = &ts->initial_v2d_cur;
548  const rctf *rect_dst = &t->region->v2d.cur;
549 
550  if (t->options & CTX_VIEW2D_EDGE_PAN) {
551  if (t->state == TRANS_CANCEL) {
552  UI_view2d_edge_pan_cancel(t->context, &ts->edge_pan);
553  }
554  else {
555  /* Edge panning functions expect window coordinates, mval is relative to region */
556  const int xy[2] = {
557  t->region->winrct.xmin + t->mval[0],
558  t->region->winrct.ymin + t->mval[1],
559  };
560  UI_view2d_edge_pan_apply(t->context, &ts->edge_pan, xy);
561  }
562  }
563 
564  copy_v2_v2(r_loc, loc_in);
565  /* Additional offset due to change in view2D rect. */
566  BLI_rctf_transform_pt_v(rect_dst, rect_src, r_loc, r_loc);
567 }
568 
569 static void flushTransSeq(TransInfo *t)
570 {
571  /* Editing null check already done */
572  ListBase *seqbasep = seqbase_active_get(t);
573 
574  int a, new_frame, offset;
575 
576  TransData *td = NULL;
577  TransData2D *td2d = NULL;
578  TransDataSeq *tdsq = NULL;
579  Sequence *seq;
580 
581  Scene *scene = t->scene;
582 
584 
585  /* This is calculated for offsetting animation of effects that change position with inputs.
586  * Maximum(positive or negative) value is used, because individual strips can be clamped. This
587  * works fairly well in most scenarios, but there can be some edge cases.
588  *
589  * Better solution would be to store effect position and calculate real offset. However with many
590  * (>5) effects in chain, there is visible lag in strip position update, because during
591  * recalculation, hierarchy is not taken into account. */
592  int max_offset = 0;
593 
594  /* Flush to 2D vector from internally used 3D vector. */
595  for (a = 0, td = tc->data, td2d = tc->data_2d; a < tc->data_len; a++, td++, td2d++) {
596  tdsq = (TransDataSeq *)td->extra;
597  seq = tdsq->seq;
598  float loc[2];
599  view2d_edge_pan_loc_compensate(t, td->loc, loc);
600  new_frame = round_fl_to_int(loc[0]);
601 
602  switch (tdsq->sel_flag) {
603  case SELECT: {
605  offset = new_frame - tdsq->start_offset - seq->start;
607  if (abs(offset) > abs(max_offset)) {
608  max_offset = offset;
609  }
610  }
611  seq->machine = round_fl_to_int(loc[1]);
612  CLAMP(seq->machine, 1, MAXSEQ);
613  break;
614  }
615  case SEQ_LEFTSEL: { /* No vertical transform. */
616  int old_startdisp = SEQ_time_left_handle_frame_get(scene, seq);
617  SEQ_time_left_handle_frame_set(t->scene, seq, new_frame);
619 
620  if (abs(SEQ_time_left_handle_frame_get(scene, seq) - old_startdisp) > abs(max_offset)) {
621  max_offset = SEQ_time_left_handle_frame_get(scene, seq) - old_startdisp;
622  }
623  break;
624  }
625  case SEQ_RIGHTSEL: { /* No vertical transform. */
626  int old_enddisp = SEQ_time_right_handle_frame_get(scene, seq);
627  SEQ_time_right_handle_frame_set(t->scene, seq, new_frame);
629 
630  if (abs(SEQ_time_right_handle_frame_get(scene, seq) - old_enddisp) > abs(max_offset)) {
631  max_offset = SEQ_time_right_handle_frame_get(scene, seq) - old_enddisp;
632  }
633  break;
634  }
635  }
636  }
637 
638  TransSeq *ts = (TransSeq *)TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data;
639 
640  /* Update animation for effects. */
642  SEQ_offset_animdata(t->scene, seq, max_offset);
643  }
644 
645  /* need to do the overlap check in a new loop otherwise adjacent strips
646  * will not be updated and we'll get false positives */
647  SeqCollection *transformed_strips = seq_transform_collection_from_transdata(tc);
649  t->scene, seqbase_active_get(t), transformed_strips, SEQ_query_strip_effect_chain);
650 
651  SEQ_ITERATOR_FOREACH (seq, transformed_strips) {
652  /* test overlap, displays red outline */
653  seq->flag &= ~SEQ_OVERLAP;
654  if (SEQ_transform_test_overlap(scene, seqbasep, seq)) {
655  seq->flag |= SEQ_OVERLAP;
656  }
657  }
658 
659  SEQ_collection_free(transformed_strips);
660 }
661 
663 {
664  TransData *td;
665  int a;
666  Sequence *seq_prev = NULL;
667 
669 
670  for (a = 0, td = tc->data; a < tc->data_len; a++, td++) {
671  TransDataSeq *tdsq = (TransDataSeq *)td->extra;
672  Sequence *seq = tdsq->seq;
673 
674  if (seq != seq_prev) {
676  }
677 
678  seq_prev = seq;
679  }
680 
682 
683  flushTransSeq(t);
684 }
685 
688 /* -------------------------------------------------------------------- */
693 {
694  if (t->state == TRANS_CANCEL) {
695  return;
696  }
697  /* freeSeqData in transform_conversions.c does this
698  * keep here so the else at the end won't run... */
699 
700  SpaceSeq *sseq = (SpaceSeq *)t->area->spacedata.first;
701 
702  /* Marker transform, not especially nice but we may want to move markers
703  * at the same time as strips in the Video Sequencer. */
704  if (sseq->flag & SEQ_MARKER_TRANS) {
705  /* can't use TFM_TIME_EXTEND
706  * for some reason EXTEND is changed into TRANSLATE, so use frame_side instead */
707 
708  if (t->mode == TFM_SEQ_SLIDE) {
709  if (t->frame_side == 'B') {
711  &t->scene->markers, t->scene, TFM_TIME_TRANSLATE, t->values_final[0], t->frame_side);
712  }
713  }
714  else if (ELEM(t->frame_side, 'L', 'R')) {
716  &t->scene->markers, t->scene, TFM_TIME_EXTEND, t->values_final[0], t->frame_side);
717  }
718  }
719 }
720 
722 {
723  const TransSeq *ts = (TransSeq *)TRANS_DATA_CONTAINER_FIRST_SINGLE(t)->custom.type.data;
724  const int channel_offset = round_fl_to_int(r_val[1]);
725  const int min_channel_after_transform = ts->selection_channel_range_min + channel_offset;
726  const int max_channel_after_transform = ts->selection_channel_range_max + channel_offset;
727 
728  if (max_channel_after_transform > MAXSEQ) {
729  r_val[1] -= max_channel_after_transform - MAXSEQ;
730  }
731  if (min_channel_after_transform < 1) {
732  r_val[1] -= min_channel_after_transform - 1;
733  }
734 }
735 
739  /* flags */ (T_POINTS | T_2D_EDIT),
740  /* createTransData */ createTransSeqData,
741  /* recalcData */ recalcData_sequencer,
742  /* special_aftertrans_update */ special_aftertrans_update__sequencer,
743 };
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
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])
Definition: math_matrix.c:40
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BLI_rctf_transform_pt_v(const rctf *dst, const rctf *src, float xy_dst[2], const float xy_src[2])
Definition: rct.c:529
#define UNUSED(x)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_SEQUENCER_STRIPS
Definition: DNA_ID.h:838
@ SEQ_RIGHTSEL
@ SEQ_IGNORE_CHANNEL_LOCK
@ SEQ_OVERLAP
@ SEQ_LEFTSEL
#define MAXSEQ
@ SEQ_MARKER_TRANS
@ TFM_TIME_TRANSLATE
Definition: ED_transform.h:50
@ TFM_TIME_EXTEND
Definition: ED_transform.h:53
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:61
@ TFM_TRANSLATION
Definition: ED_transform.h:30
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
#define C
Definition: RandGen.cpp:25
#define SEQ_ITERATOR_FOREACH(var, collection)
Definition: SEQ_iterator.h:35
void UI_view2d_edge_pan_apply(struct bContext *C, struct View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
void UI_view2d_edge_pan_set_limits(struct View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax)
void UI_view2d_edge_pan_init(struct bContext *C, struct View2DEdgePanData *vpd, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void UI_view2d_edge_pan_cancel(struct bContext *C, struct View2DEdgePanData *vpd)
int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, float value, char side)
Definition: anim_markers.c:103
void SEQ_offset_animdata(Scene *scene, Sequence *seq, int ofs)
Definition: animation.c:67
ListBase * SEQ_channels_displayed_get(Editing *ed)
Definition: channels.c:23
#define SELECT
Scene scene
int count
void SEQ_query_strip_effect_chain(const Scene *scene, Sequence *seq_reference, ListBase *seqbase, SeqCollection *collection)
Definition: iterator.c:335
void SEQ_collection_expand(const Scene *scene, ListBase *seqbase, SeqCollection *collection, void seq_query_func(const Scene *scene, Sequence *seq_reference, ListBase *seqbase, SeqCollection *collection))
Definition: iterator.c:151
bool SEQ_collection_remove_strip(Sequence *seq, SeqCollection *collection)
Definition: iterator.c:128
SeqCollection * SEQ_query_selected_strips(ListBase *seqbase)
Definition: iterator.c:215
SeqCollection * SEQ_collection_duplicate(SeqCollection *collection)
Definition: iterator.c:172
SeqCollection * SEQ_collection_create(const char *name)
Definition: iterator.c:87
bool SEQ_collection_append_strip(Sequence *seq, SeqCollection *collection)
Definition: iterator.c:117
bool SEQ_collection_has_strip(const Sequence *seq, const SeqCollection *collection)
Definition: iterator.c:100
void SEQ_collection_free(SeqCollection *collection)
Definition: iterator.c:81
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static int left
static unsigned a[3]
Definition: RandGen.cpp:78
T abs(const T &a)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Definition: sequencer.c:388
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq)
void SEQ_time_right_handle_frame_set(const Scene *scene, Sequence *seq, int val)
Definition: strip_time.c:539
int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq)
Definition: strip_time.c:506
void SEQ_time_left_handle_frame_set(const Scene *scene, Sequence *seq, int val)
Definition: strip_time.c:524
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
Definition: strip_time.c:515
bool SEQ_transform_seqbase_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene)
bool SEQ_transform_is_locked(ListBase *channels, Sequence *seq)
bool SEQ_transform_test_overlap(const Scene *scene, ListBase *seqbasep, Sequence *test)
void SEQ_transform_fix_single_image_seq_offsets(const Scene *scene, Sequence *seq)
void SEQ_transform_handle_overlap(Scene *scene, ListBase *seqbasep, SeqCollection *transformed_strips, SeqCollection *time_dependent_strips, bool use_sync_markers)
bool SEQ_transform_sequence_can_be_translated(Sequence *seq)
void SEQ_transform_translate_sequence(Scene *evil_scene, Sequence *seq, int delta)
ListBase * seqbasep
void * first
Definition: DNA_listBase.h:31
struct RenderData r
struct Sequence * seq1
struct Sequence * seq2
struct Sequence * next
void(* free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data)
float * loc2d
float loc[3]
struct Sequence * seq
float smtx[3][3]
float axismtx[3][3]
float mtx[3][3]
TransDataExtension * ext
float * val
TransDataSeq * tdseq
View2DEdgePanData edge_pan
SeqCollection * time_dependent_strips
char transform_convert_frame_side_dir_get(TransInfo *t, float cframe)
conversion and adaptation of different datablocks to a common struct.
static SeqCollection * query_time_dependent_strips_strips(TransInfo *t)
static void view2d_edge_pan_loc_compensate(TransInfo *t, float loc_in[2], float r_loc[2])
static void flushTransSeq(TransInfo *t)
static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data)
#define SEQ_EDGE_PAN_DELAY
static int SeqToTransData_build(TransInfo *t, ListBase *seqbase, TransData *td, TransData2D *td2d, TransDataSeq *tdsq)
static int SeqTransCount(TransInfo *t, ListBase *seqbase)
static void special_aftertrans_update__sequencer(bContext *UNUSED(C), TransInfo *t)
struct TransDataSeq TransDataSeq
static Sequence * effect_base_input_get(const Scene *scene, Sequence *effect, SeqInputSide side)
static void createTransSeqData(bContext *UNUSED(C), TransInfo *t)
static TransData * SeqToTransData(Scene *scene, TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag)
static void recalcData_sequencer(TransInfo *t)
static ListBase * seqbase_active_get(const TransInfo *t)
#define SEQ_EDGE_PAN_INSIDE_PAD
TransConvertTypeInfo TransConvertType_Sequencer
static SeqCollection * query_selected_strips_no_handles(ListBase *seqbase)
void transform_convert_sequencer_channel_clamp(TransInfo *t, float r_val[2])
static Sequence * effect_input_get(const Scene *scene, Sequence *effect, SeqInputSide side)
#define SEQ_EDGE_PAN_ZOOM_INFLUENCE
static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_count, int *r_flag)
#define SEQ_EDGE_PAN_MAX_SPEED
static SeqCollection * seq_transform_collection_from_transdata(TransDataContainer *tc)
static bool seq_transform_check_overlap(SeqCollection *transformed_strips)
struct TransSeq TransSeq
#define SEQ_EDGE_PAN_OUTSIDE_PAD
static void seq_transform_cancel(TransInfo *t, SeqCollection *transformed_strips)
static void free_transform_custom_data(TransCustomData *custom_data)
#define SEQ_EDGE_PAN_SPEED_RAMP
@ TD_SELECTED
int xy[2]
Definition: wm_draw.c:135