Blender  V3.3
transform_snap_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 <stdlib.h>
9 
10 #include "MEM_guardedalloc.h"
11 
12 #include "BLI_blenlib.h"
13 #include "BLI_math.h"
14 
15 #include "BKE_context.h"
16 
17 #include "ED_screen.h"
18 #include "ED_transform.h"
19 
20 #include "UI_view2d.h"
21 
22 #include "SEQ_channels.h"
23 #include "SEQ_effects.h"
24 #include "SEQ_iterator.h"
25 #include "SEQ_relations.h"
26 #include "SEQ_render.h"
27 #include "SEQ_sequencer.h"
28 #include "SEQ_time.h"
29 
30 #include "transform.h"
31 #include "transform_convert.h"
32 #include "transform_snap.h"
33 
34 typedef struct TransSeqSnapData {
40 
41 /* -------------------------------------------------------------------- */
46 {
47  return SEQ_collection_len(snap_sources) * 2;
48 }
49 
50 static void seq_snap_source_points_alloc(TransSeqSnapData *snap_data, SeqCollection *snap_sources)
51 {
52  const size_t point_count = seq_get_snap_source_points_len(snap_sources);
53  snap_data->source_snap_points = MEM_callocN(sizeof(int) * point_count, __func__);
54  memset(snap_data->source_snap_points, 0, sizeof(int));
55  snap_data->source_snap_point_count = point_count;
56 }
57 
58 static int cmp_fn(const void *a, const void *b)
59 {
60  return (*(int *)a - *(int *)b);
61 }
62 
64  TransSeqSnapData *snap_data,
65  SeqCollection *snap_sources)
66 {
67  int i = 0;
68  Sequence *seq;
69  SEQ_ITERATOR_FOREACH (seq, snap_sources) {
70  int left = 0, right = 0;
71  if (seq->flag & SEQ_LEFTSEL) {
73  }
74  else if (seq->flag & SEQ_RIGHTSEL) {
76  }
77  else {
80  }
81 
82  snap_data->source_snap_points[i] = left;
83  snap_data->source_snap_points[i + 1] = right;
84  i += 2;
85  BLI_assert(i <= snap_data->source_snap_point_count);
86  }
87 
88  qsort(snap_data->source_snap_points, snap_data->source_snap_point_count, sizeof(int), cmp_fn);
89 }
90 
93 /* -------------------------------------------------------------------- */
97 /* Add effect strips directly or indirectly connected to `seq_reference` to `collection`. */
98 static void query_strip_effects_fn(const Scene *scene,
99  Sequence *seq_reference,
100  ListBase *seqbase,
101  SeqCollection *collection)
102 {
103  if (!SEQ_collection_append_strip(seq_reference, collection)) {
104  return; /* Strip is already in set, so all effects connected to it are as well. */
105  }
106 
107  /* Find all strips connected to `seq_reference`. */
108  LISTBASE_FOREACH (Sequence *, seq_test, seqbase) {
109  if (SEQ_relation_is_effect_of_strip(seq_test, seq_reference)) {
110  query_strip_effects_fn(scene, seq_test, seqbase, collection);
111  }
112  }
113 }
114 
116 {
117  SeqCollection *effects = SEQ_collection_create(__func__);
118  Sequence *seq;
119  SEQ_ITERATOR_FOREACH (seq, collection) {
120  if (SEQ_effect_get_num_inputs(seq->type) > 0) {
121  SEQ_collection_append_strip(seq, effects);
122  }
123  }
124  return effects;
125 }
126 
128  SeqCollection *snap_sources,
129  bool exclude_selected)
130 {
132  ListBase *seqbase = SEQ_active_seqbase_get(ed);
134  const short snap_flag = SEQ_tool_settings_snap_flag_get(scene);
135  SeqCollection *snap_targets = SEQ_collection_create(__func__);
136  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
137  if (exclude_selected && seq->flag & SELECT) {
138  continue; /* Selected are being transformed. */
139  }
140  if (SEQ_render_is_muted(channels, seq) && (snap_flag & SEQ_SNAP_IGNORE_MUTED)) {
141  continue;
142  }
143  if (seq->type == SEQ_TYPE_SOUND_RAM && (snap_flag & SEQ_SNAP_IGNORE_SOUND)) {
144  continue;
145  }
146  SEQ_collection_append_strip(seq, snap_targets);
147  }
148 
149  /* Effects will always change position with strip to which they are connected and they don't have
150  * to be selected. Remove such strips from `snap_targets` collection. */
151  SeqCollection *snap_sources_temp = SEQ_collection_duplicate(snap_sources);
152  SEQ_collection_expand(scene, seqbase, snap_sources_temp, query_strip_effects_fn);
153  SeqCollection *snap_sources_effects = seq_collection_extract_effects(snap_sources_temp);
154  SEQ_collection_exclude(snap_targets, snap_sources_effects);
155  SEQ_collection_free(snap_sources_temp);
156 
157  return snap_targets;
158 }
159 
160 static int seq_get_snap_target_points_count(short snap_mode, SeqCollection *snap_targets)
161 {
162  int count = 2; /* Strip start and end are always used. */
163 
164  if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD) {
165  count += 2;
166  }
167 
168  count *= SEQ_collection_len(snap_targets);
169 
170  if (snap_mode & SEQ_SNAP_TO_CURRENT_FRAME) {
171  count++;
172  }
173 
174  return count;
175 }
176 
177 static void seq_snap_target_points_alloc(short snap_mode,
178  TransSeqSnapData *snap_data,
179  SeqCollection *snap_targets)
180 {
181  const size_t point_count = seq_get_snap_target_points_count(snap_mode, snap_targets);
182  snap_data->target_snap_points = MEM_callocN(sizeof(int) * point_count, __func__);
183  memset(snap_data->target_snap_points, 0, sizeof(int));
184  snap_data->target_snap_point_count = point_count;
185 }
186 
188  short snap_mode,
189  TransSeqSnapData *snap_data,
190  SeqCollection *snap_targets)
191 {
192  int i = 0;
193 
194  if (snap_mode & SEQ_SNAP_TO_CURRENT_FRAME) {
195  snap_data->target_snap_points[i] = scene->r.cfra;
196  i++;
197  }
198 
199  Sequence *seq;
200  SEQ_ITERATOR_FOREACH (seq, snap_targets) {
202  snap_data->target_snap_points[i + 1] = SEQ_time_right_handle_frame_get(scene, seq);
203  i += 2;
204 
205  if (snap_mode & SEQ_SNAP_TO_STRIP_HOLD) {
206  int content_start = min_ii(SEQ_time_right_handle_frame_get(scene, seq), seq->start);
207  int content_end = max_ii(SEQ_time_left_handle_frame_get(scene, seq), seq->start + seq->len);
208  /* Effects and single image strips produce incorrect content length. Skip these strips. */
209  if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->len == 1) {
210  content_start = SEQ_time_left_handle_frame_get(scene, seq);
211  content_end = SEQ_time_right_handle_frame_get(scene, seq);
212  }
213 
214  CLAMP(content_start,
217  CLAMP(content_end,
220 
221  snap_data->target_snap_points[i] = content_start;
222  snap_data->target_snap_points[i + 1] = content_end;
223  i += 2;
224  }
225  }
226  BLI_assert(i <= snap_data->target_snap_point_count);
227  qsort(snap_data->target_snap_points, snap_data->target_snap_point_count, sizeof(int), cmp_fn);
228 }
229 
232 /* -------------------------------------------------------------------- */
237 {
238  const int snap_distance = SEQ_tool_settings_snap_distance_get(t->scene);
239  const struct View2D *v2d = &t->region->v2d;
240  return round_fl_to_int(UI_view2d_region_to_view_x(v2d, snap_distance) -
242 }
243 
247 {
248  if (t->data_type == &TransConvertType_SequencerImage) {
249  return NULL;
250  }
251 
252  Scene *scene = t->scene;
253  TransSeqSnapData *snap_data = MEM_callocN(sizeof(TransSeqSnapData), __func__);
255 
256  SeqCollection *snap_sources = SEQ_query_selected_strips(seqbase);
257  SeqCollection *snap_targets = query_snap_targets(scene, snap_sources, true);
258 
259  if (SEQ_collection_len(snap_sources) == 0) {
260  SEQ_collection_free(snap_targets);
261  SEQ_collection_free(snap_sources);
262  MEM_freeN(snap_data);
263  return NULL;
264  }
265 
266  /* Build arrays of snap points. */
267  seq_snap_source_points_alloc(snap_data, snap_sources);
268  seq_snap_source_points_build(scene, snap_data, snap_sources);
269  SEQ_collection_free(snap_sources);
270 
271  short snap_mode = t->tsnap.mode;
272  seq_snap_target_points_alloc(snap_mode, snap_data, snap_targets);
273  seq_snap_target_points_build(scene, snap_mode, snap_data, snap_targets);
274  SEQ_collection_free(snap_targets);
275 
276  return snap_data;
277 }
278 
280 {
281  MEM_freeN(data->source_snap_points);
282  MEM_freeN(data->target_snap_points);
283  MEM_freeN(data);
284 }
285 
287 {
288  const TransSeqSnapData *snap_data = t->tsnap.seq_context;
289  if (snap_data == NULL) {
290  return false;
291  }
292 
293  /* Prevent snapping when constrained to Y axis. */
294  if (t->con.mode & CON_APPLY && t->con.mode & CON_AXIS1) {
295  return false;
296  }
297 
298  int best_dist = MAXFRAME, best_target_frame = 0, best_source_frame = 0;
299 
300  for (int i = 0; i < snap_data->source_snap_point_count; i++) {
301  int snap_source_frame = snap_data->source_snap_points[i] + round_fl_to_int(t->values[0]);
302  for (int j = 0; j < snap_data->target_snap_point_count; j++) {
303  int snap_target_frame = snap_data->target_snap_points[j];
304 
305  int dist = abs(snap_target_frame - snap_source_frame);
306  if (dist > best_dist) {
307  continue;
308  }
309 
310  best_dist = dist;
311  best_target_frame = snap_target_frame;
312  best_source_frame = snap_source_frame;
313  }
314  }
315 
316  if (best_dist > seq_snap_threshold_get_frame_distance(t)) {
317  return false;
318  }
319 
320  t->tsnap.snapPoint[0] = best_target_frame;
321  t->tsnap.snapTarget[0] = best_source_frame;
322  return true;
323 }
324 
326 {
327  *vec += t->tsnap.snapPoint[0] - t->tsnap.snapTarget[0];
328 }
329 
330 static int transform_snap_sequencer_to_closest_strip_ex(TransInfo *t, int frame_1, int frame_2)
331 {
332  Scene *scene = t->scene;
333  TransSeqSnapData *snap_data = MEM_callocN(sizeof(TransSeqSnapData), __func__);
334 
335  SeqCollection *empty_col = SEQ_collection_create(__func__);
336  SeqCollection *snap_targets = query_snap_targets(scene, empty_col, false);
337  SEQ_collection_free(empty_col);
338 
339  snap_data->source_snap_points = MEM_callocN(sizeof(int) * 2, __func__);
340  snap_data->source_snap_point_count = 2;
341  BLI_assert(frame_1 <= frame_2);
342  snap_data->source_snap_points[0] = frame_1;
343  snap_data->source_snap_points[1] = frame_2;
344 
345  short snap_mode = t->tsnap.mode;
346  /* Build arrays of snap points. */
347  seq_snap_target_points_alloc(snap_mode, snap_data, snap_targets);
348  seq_snap_target_points_build(scene, snap_mode, snap_data, snap_targets);
349  SEQ_collection_free(snap_targets);
350 
351  t->tsnap.seq_context = snap_data;
352  bool snap_success = transform_snap_sequencer_calc(t);
354  t->tsnap.seq_context = NULL;
355 
356  float snap_offset = 0;
357  if (snap_success) {
358  t->tsnap.status |= (POINT_INIT | TARGET_INIT);
360  }
361  else {
362  t->tsnap.status &= ~(POINT_INIT | TARGET_INIT);
363  }
364 
365  return snap_offset;
366 }
367 
369  ARegion *region,
370  int frame_1,
371  int frame_2,
372  int *r_snap_distance,
373  float *r_snap_frame)
374 {
375  TransInfo t;
376  t.scene = scene;
377  t.region = region;
378  t.values[0] = 0;
379  t.data_type = &TransConvertType_Sequencer;
380 
382  *r_snap_distance = transform_snap_sequencer_to_closest_strip_ex(&t, frame_1, frame_2);
383  *r_snap_frame = t.tsnap.snapPoint[0];
384  return validSnap(&t);
385 }
386 
387 void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point)
388 {
389  /* Reuse the snapping drawing code from the transform system. */
390  TransInfo t;
391  t.mode = TFM_SEQ_SLIDE;
392  t.modifiers = MOD_SNAP;
393  t.spacetype = SPACE_SEQ;
394  t.tsnap.status = (POINT_INIT | TARGET_INIT);
395  t.tsnap.snapPoint[0] = snap_point;
396 
397  drawSnapping(C, &t);
398 }
#define BLI_assert(a)
Definition: BLI_assert.h:46
#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)
#define SEQ_SNAP_TO_STRIP_HOLD
#define SEQ_SNAP_TO_CURRENT_FRAME
#define SEQ_SNAP_IGNORE_MUTED
#define SEQ_SNAP_IGNORE_SOUND
#define MAXFRAME
@ SEQ_TYPE_SOUND_RAM
@ SEQ_TYPE_EFFECT
@ SEQ_RIGHTSEL
@ SEQ_LEFTSEL
@ SPACE_SEQ
@ TFM_SEQ_SLIDE
Definition: ED_transform.h:61
_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
float UI_view2d_region_to_view_x(const struct View2D *v2d, float x)
Definition: view2d.cc:1655
ListBase * SEQ_channels_displayed_get(Editing *ed)
Definition: channels.c:23
#define SELECT
Scene scene
int SEQ_effect_get_num_inputs(int seq_type)
Definition: effects.c:3741
int count
void SEQ_collection_exclude(SeqCollection *collection, SeqCollection *exclude_elements)
Definition: iterator.c:142
uint SEQ_collection_len(const SeqCollection *collection)
Definition: iterator.c:95
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
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
void SEQ_collection_free(SeqCollection *collection)
Definition: iterator.c:81
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)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
bool SEQ_render_is_muted(const ListBase *channels, const Sequence *seq)
Definition: render.c:2199
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Definition: sequencer.c:388
short SEQ_tool_settings_snap_mode_get(Scene *scene)
Definition: sequencer.c:352
int SEQ_tool_settings_snap_distance_get(Scene *scene)
Definition: sequencer.c:364
short SEQ_tool_settings_snap_flag_get(Scene *scene)
Definition: sequencer.c:358
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence *input)
int SEQ_time_left_handle_frame_get(const Scene *UNUSED(scene), const Sequence *seq)
Definition: strip_time.c:506
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
Definition: strip_time.c:515
struct RenderData r
conversion and adaptation of different datablocks to a common struct.
TransConvertTypeInfo TransConvertType_Sequencer
TransConvertTypeInfo TransConvertType_SequencerImage
bool validSnap(const TransInfo *t)
void drawSnapping(const struct bContext *C, TransInfo *t)
static void seq_snap_target_points_alloc(short snap_mode, TransSeqSnapData *snap_data, SeqCollection *snap_targets)
static int seq_get_snap_target_points_count(short snap_mode, SeqCollection *snap_targets)
static void query_strip_effects_fn(const Scene *scene, Sequence *seq_reference, ListBase *seqbase, SeqCollection *collection)
void transform_snap_sequencer_data_free(TransSeqSnapData *data)
void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point)
static int transform_snap_sequencer_to_closest_strip_ex(TransInfo *t, int frame_1, int frame_2)
TransSeqSnapData * transform_snap_sequencer_data_alloc(const TransInfo *t)
bool ED_transform_snap_sequencer_to_closest_strip_calc(Scene *scene, ARegion *region, int frame_1, int frame_2, int *r_snap_distance, float *r_snap_frame)
static void seq_snap_target_points_build(Scene *scene, short snap_mode, TransSeqSnapData *snap_data, SeqCollection *snap_targets)
static SeqCollection * query_snap_targets(Scene *scene, SeqCollection *snap_sources, bool exclude_selected)
static void seq_snap_source_points_build(const Scene *scene, TransSeqSnapData *snap_data, SeqCollection *snap_sources)
static int seq_snap_threshold_get_frame_distance(const TransInfo *t)
struct TransSeqSnapData TransSeqSnapData
bool transform_snap_sequencer_calc(TransInfo *t)
static int cmp_fn(const void *a, const void *b)
static SeqCollection * seq_collection_extract_effects(SeqCollection *collection)
static void seq_snap_source_points_alloc(TransSeqSnapData *snap_data, SeqCollection *snap_sources)
void transform_snap_sequencer_apply_translate(TransInfo *t, float *vec)
static int seq_get_snap_source_points_len(SeqCollection *snap_sources)