Blender  V3.3
clip_utils.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. All rights reserved. */
3 
8 #include "DNA_scene_types.h"
9 
10 #include "MEM_guardedalloc.h"
11 
12 #include "BLI_listbase.h"
13 #include "BLI_math.h"
14 #include "BLI_rect.h"
15 #include "BLI_utildefines.h"
16 
17 #include "BKE_animsys.h"
18 #include "BKE_context.h"
19 #include "BKE_mask.h"
20 #include "BKE_movieclip.h"
21 #include "BKE_tracking.h"
22 
23 #include "DEG_depsgraph.h"
24 #include "DEG_depsgraph_build.h"
25 
26 #include "GPU_immediate.h"
27 #include "GPU_state.h"
28 
29 #include "WM_api.h"
30 #include "WM_types.h"
31 
32 #include "ED_clip.h"
33 #include "ED_mask.h"
34 #include "ED_screen.h"
35 
36 #include "UI_interface.h"
37 #include "UI_resources.h"
38 #include "UI_view2d.h"
39 
40 #include "clip_intern.h" /* own include */
41 
43 {
45  if ((sc->flag & SC_SHOW_GRAPH_TRACKS_MOTION) == 0) {
46  return false;
47  }
48  }
49  else if (value_source == CLIP_VALUE_SOURCE_REPROJECTION_ERROR) {
50  if ((sc->flag & SC_SHOW_GRAPH_TRACKS_ERROR) == 0) {
51  return false;
52  }
53  }
54  return true;
55 }
56 
58  SpaceClip *sc,
59  MovieTrackingTrack *track,
60  void *userdata,
64 {
66  int width, height, coord;
67 
68  BKE_movieclip_get_size(clip, &sc->user, &width, &height);
69 
70  for (coord = 0; coord < 2; coord++) {
71  eClipCurveValueSource value_source = (coord == 0) ? CLIP_VALUE_SOURCE_SPEED_X :
73  int i, prevfra = track->markers[0].framenr;
74  bool open = false;
75  float prevval = 0.0f;
76 
77  for (i = 0; i < track->markersnr; i++) {
78  MovieTrackingMarker *marker = &track->markers[i];
79  float val;
80 
81  if (marker->flag & MARKER_DISABLED) {
82  if (open) {
83  if (segment_end) {
84  segment_end(userdata, value_source);
85  }
86 
87  open = false;
88  }
89 
90  continue;
91  }
92 
93  if (!open) {
94  if (segment_start) {
95  if ((i + 1) == track->markersnr) {
96  segment_start(userdata, track, value_source, true);
97  }
98  else {
99  segment_start(
100  userdata, track, value_source, (track->markers[i + 1].flag & MARKER_DISABLED));
101  }
102  }
103 
104  open = true;
105  prevval = marker->pos[coord];
106  }
107 
108  /* value is a pixels per frame speed */
109  val = (marker->pos[coord] - prevval) * ((coord == 0) ? (width) : (height));
110  val /= marker->framenr - prevfra;
111 
112  if (func) {
113  int scene_framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
114 
115  func(userdata, track, marker, value_source, scene_framenr, val);
116  }
117 
118  prevval = marker->pos[coord];
119  prevfra = marker->framenr;
120  }
121 
122  if (open) {
123  if (segment_end) {
124  segment_end(userdata, value_source);
125  }
126  }
127  }
128 }
129 
131  MovieTracking *tracking,
132  MovieTrackingObject *tracking_object,
133  MovieTrackingTrack *track,
134  MovieTrackingMarker *marker,
135  const int clip_width,
136  const int clip_height,
137  const int scene_framenr)
138 {
139  float reprojected_position[4], bundle_position[4], marker_position[2], delta[2];
140  float weight = BKE_tracking_track_get_weight_for_marker(clip, track, marker);
141  const float aspy = 1.0f / tracking->camera.pixel_aspect;
142 
143  float projection_matrix[4][4];
145  tracking, tracking_object, scene_framenr, clip_width, clip_height, projection_matrix);
146 
147  copy_v3_v3(bundle_position, track->bundle_pos);
148  bundle_position[3] = 1;
149 
150  mul_v4_m4v4(reprojected_position, projection_matrix, bundle_position);
151  reprojected_position[0] = (reprojected_position[0] / (reprojected_position[3] * 2.0f) + 0.5f) *
152  clip_width;
153  reprojected_position[1] = (reprojected_position[1] / (reprojected_position[3] * 2.0f) + 0.5f) *
154  clip_height * aspy;
155 
157  tracking, clip_width, clip_height, reprojected_position, reprojected_position);
158 
159  marker_position[0] = (marker->pos[0] + track->offset[0]) * clip_width;
160  marker_position[1] = (marker->pos[1] + track->offset[1]) * clip_height * aspy;
161 
162  sub_v2_v2v2(delta, reprojected_position, marker_position);
163  return len_v2(delta) * weight;
164 }
165 
167  SpaceClip *sc,
168  MovieTrackingTrack *track,
169  void *userdata,
173 {
174  /* Tracks without bundle can not have any reprojection error curve. */
175  if ((track->flag & TRACK_HAS_BUNDLE) == 0) {
176  return;
177  }
178 
179  MovieClip *clip = ED_space_clip_get_clip(sc);
180  MovieTracking *tracking = &clip->tracking;
181  MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking);
182 
183  int clip_width, clip_height;
184  BKE_movieclip_get_size(clip, &sc->user, &clip_width, &clip_height);
185 
186  /* Iterate over segments. */
187  bool is_segment_open = false;
188  for (int marker_index = 0; marker_index < track->markersnr; marker_index++) {
189  MovieTrackingMarker *marker = &track->markers[marker_index];
190 
191  /* End of tracked segment, no reprojection error can be calculated here since the ground truth
192  * 2D position is not known. */
193  if (marker->flag & MARKER_DISABLED) {
194  if (is_segment_open) {
195  if (segment_end != NULL) {
196  segment_end(userdata, CLIP_VALUE_SOURCE_REPROJECTION_ERROR);
197  }
198  is_segment_open = false;
199  }
200  continue;
201  }
202 
203  /* Begin new segment if it is not open yet. */
204  if (!is_segment_open) {
205  if (segment_start != NULL) {
206  if ((marker_index + 1) == track->markersnr) {
207  segment_start(userdata, track, CLIP_VALUE_SOURCE_REPROJECTION_ERROR, true);
208  }
209  else {
210  segment_start(userdata,
211  track,
213  (track->markers[marker_index + 1].flag & MARKER_DISABLED));
214  }
215  }
216  is_segment_open = true;
217  }
218 
219  if (func != NULL) {
220  const int scene_framenr = BKE_movieclip_remap_clip_to_scene_frame(clip, marker->framenr);
221  const float reprojection_error = calculate_reprojection_error_at_marker(
222  clip, tracking, tracking_object, track, marker, clip_width, clip_height, scene_framenr);
223  func(userdata,
224  track,
225  marker,
227  scene_framenr,
228  reprojection_error);
229  }
230  }
231 
232  if (is_segment_open && segment_end != NULL) {
233  segment_end(userdata, CLIP_VALUE_SOURCE_REPROJECTION_ERROR);
234  }
235 }
236 
238  MovieTrackingTrack *track,
239  void *userdata,
243 {
245  sc, track, userdata, func, segment_start, segment_end);
246 
248  sc, track, userdata, func, segment_start, segment_end);
249 }
250 
252  bool selected_only,
253  bool include_hidden,
254  void *userdata,
258 {
259  MovieClip *clip = ED_space_clip_get_clip(sc);
260  MovieTracking *tracking = &clip->tracking;
261  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
262  MovieTrackingTrack *track;
263 
264  for (track = tracksbase->first; track; track = track->next) {
265  if (!include_hidden && (track->flag & TRACK_HIDDEN) != 0) {
266  continue;
267  }
268 
269  if (selected_only && !TRACK_SELECTED(track)) {
270  continue;
271  }
272 
274  sc, track, userdata, func, segment_start, segment_end);
275  }
276 }
277 
279  bool selected_only,
280  bool include_hidden,
281  void *userdata,
282  void (*func)(void *userdata, MovieTrackingMarker *marker))
283 {
284  MovieClip *clip = ED_space_clip_get_clip(sc);
285  MovieTracking *tracking = &clip->tracking;
286  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
287 
288  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
289  if (!include_hidden && (track->flag & TRACK_HIDDEN) != 0) {
290  continue;
291  }
292 
293  if (selected_only && !TRACK_SELECTED(track)) {
294  continue;
295  }
296 
297  for (int i = 0; i < track->markersnr; i++) {
298  MovieTrackingMarker *marker = &track->markers[i];
299 
300  if (marker->flag & MARKER_DISABLED) {
301  continue;
302  }
303 
304  if (func) {
305  func(userdata, marker);
306  }
307  }
308  }
309 }
310 
312 {
313  MovieTracking *tracking = &clip->tracking;
314  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
315  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
316  bool has_bundle = false;
317  const bool used_for_stabilization = (track->flag &
319  if (track == act_track) {
320  tracking->act_track = NULL;
321  }
322  /* Handle reconstruction display in 3d viewport. */
323  if (track->flag & TRACK_HAS_BUNDLE) {
324  has_bundle = true;
325  }
326  /* Make sure no plane will use freed track */
328  /* Delete f-curves associated with the track (such as weight, i.e.) */
329  /* Escaped object name, escaped track name, rest of the path. */
330  char rna_path[MAX_NAME * 4 + 64];
331  BKE_tracking_get_rna_path_for_track(tracking, track, rna_path, sizeof(rna_path));
332  if (BKE_animdata_fix_paths_remove(&clip->id, rna_path)) {
334  }
335  /* Delete track itself. */
337  BLI_freelinkN(tracksbase, track);
338  /* Send notifiers. */
340  if (used_for_stabilization) {
342  }
343  /* Inform dependency graph. */
344  DEG_id_tag_update(&clip->id, 0);
345  if (has_bundle) {
347  }
348 }
349 
351  MovieClip *clip,
352  MovieTrackingTrack *track,
353  MovieTrackingMarker *marker)
354 {
355  if (track->markersnr == 1) {
356  clip_delete_track(C, clip, track);
357  }
358  else {
359  BKE_tracking_marker_delete(track, marker->framenr);
360 
362  }
363 }
364 
366 {
367  MovieTracking *tracking = &clip->tracking;
368  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
369  /* Delete f-curves associated with the track (such as weight, i.e.) */
370  /* Escaped object name, escaped track name, rest of the path. */
371  char rna_path[MAX_NAME * 4 + 64];
372  BKE_tracking_get_rna_path_for_plane_track(tracking, plane_track, rna_path, sizeof(rna_path));
373  if (BKE_animdata_fix_paths_remove(&clip->id, rna_path)) {
375  }
376  /* Delete the plane track itself. */
377  BKE_tracking_plane_track_free(plane_track);
378  BLI_freelinkN(plane_tracks_base, plane_track);
379  /* TODO(sergey): Any notifiers to be sent here? */
380  (void)C;
381  /* Inform dependency graph. */
382  DEG_id_tag_update(&clip->id, 0);
383 }
384 
386  SpaceClip *sc, const float x, const float y, float *r_offset_x, float *r_offset_y)
387 {
388  int width, height;
390 
391  float aspx, aspy;
392  ED_space_clip_get_aspect(sc, &aspx, &aspy);
393 
394  *r_offset_x = (x - 0.5f) * width * aspx;
395  *r_offset_y = (y - 0.5f) * height * aspy;
396 }
397 
398 void clip_view_center_to_point(SpaceClip *sc, float x, float y)
399 {
400  clip_view_offset_for_center_to_point(sc, x, y, &sc->xof, &sc->yof);
401 }
402 
403 static bool selected_tracking_boundbox(SpaceClip *sc, float min[2], float max[2])
404 {
405  MovieClip *clip = ED_space_clip_get_clip(sc);
406  MovieTrackingTrack *track;
407  int width, height;
408  bool ok = false;
409  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
410  int framenr = ED_space_clip_get_clip_frame_number(sc);
411 
412  INIT_MINMAX2(min, max);
413 
415 
416  track = tracksbase->first;
417  while (track) {
418  if (TRACK_VIEW_SELECTED(sc, track)) {
419  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
420 
421  if (marker) {
422  float pos[3];
423 
424  pos[0] = marker->pos[0] + track->offset[0];
425  pos[1] = marker->pos[1] + track->offset[1];
426  pos[2] = 0.0f;
427 
428  /* undistortion happens for normalized coords */
430  /* undistortion happens for normalized coords */
432  }
433 
434  pos[0] *= width;
435  pos[1] *= height;
436 
437  mul_v3_m4v3(pos, sc->stabmat, pos);
438 
440 
441  ok = true;
442  }
443  }
444 
445  track = track->next;
446  }
447 
448  return ok;
449 }
450 
451 static bool tracking_has_selection(SpaceClip *space_clip)
452 {
453  MovieClip *clip = ED_space_clip_get_clip(space_clip);
454  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
455  const int framenr = ED_space_clip_get_clip_frame_number(space_clip);
456 
457  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
458  if (!TRACK_VIEW_SELECTED(space_clip, track)) {
459  continue;
460  }
461  const MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
462  if (marker != NULL) {
463  return true;
464  }
465  }
466 
467  return false;
468 }
469 
470 static bool mask_has_selection(const bContext *C)
471 {
473  if (mask == NULL) {
474  return false;
475  }
476 
477  LISTBASE_FOREACH (MaskLayer *, mask_layer, &mask->masklayers) {
478  if (mask_layer->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) {
479  continue;
480  }
481  LISTBASE_FOREACH (MaskSpline *, spline, &mask_layer->splines) {
482  for (int i = 0; i < spline->tot_point; i++) {
483  const MaskSplinePoint *point = &spline->points[i];
484  const BezTriple *bezt = &point->bezt;
485  if (!MASKPOINT_ISSEL_ANY(point)) {
486  continue;
487  }
488  if (bezt->f2 & SELECT) {
489  return true;
490  }
491 
493  return true;
494  }
495 
496  if ((bezt->f1 & SELECT) && (bezt->h1 != HD_VECT)) {
497  return true;
498  }
499  if ((bezt->f3 & SELECT) && (bezt->h2 != HD_VECT)) {
500  return true;
501  }
502  }
503  }
504  }
505 
506  return false;
507 }
508 
509 static bool selected_boundbox(const bContext *C,
510  float min[2],
511  float max[2],
512  bool handles_as_control_point)
513 {
515  if (sc->mode == SC_MODE_TRACKING) {
516  return selected_tracking_boundbox(sc, min, max);
517  }
518 
519  if (ED_mask_selected_minmax(C, min, max, handles_as_control_point)) {
520  MovieClip *clip = ED_space_clip_get_clip(sc);
521  int width, height;
523  BKE_mask_coord_to_movieclip(clip, &sc->user, min, min);
524  BKE_mask_coord_to_movieclip(clip, &sc->user, max, max);
525  min[0] *= width;
526  min[1] *= height;
527  max[0] *= width;
528  max[1] *= height;
529  return true;
530  }
531  return false;
532 }
533 
535  const bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom)
536 {
538 
539  int frame_width, frame_height;
540  ED_space_clip_get_size(sc, &frame_width, &frame_height);
541 
542  if ((frame_width == 0) || (frame_height == 0) || (sc->clip == NULL)) {
543  return false;
544  }
545 
546  /* NOTE: The `fit` argument is set to truth when doing "View to Selected" operator, and it set to
547  * false when this function is used for Lock-to-Selection functionality. When locking to
548  * selection the handles are to use control point position. So we can derive the
549  * `handles_as_control_point` from `fit`.
550  *
551  * TODO(sergey): Make such decision more explicit. Maybe pass use-case for the calculation to
552  * tell operator from lock-to-selection apart. */
553  float min[2], max[2];
554  if (!selected_boundbox(C, min, max, !fit)) {
555  return false;
556  }
557 
558  /* center view */
560  (max[0] + min[0]) / (2 * frame_width),
561  (max[1] + min[1]) / (2 * frame_height),
562  r_offset_x,
563  r_offset_y);
564 
565  const int w = max[0] - min[0];
566  const int h = max[1] - min[1];
567 
568  /* set zoom to see all selection */
569  *r_zoom = sc->zoom;
570  if (w > 0 && h > 0) {
571  ARegion *region = CTX_wm_region(C);
572 
573  int width, height;
574  float zoomx, zoomy, newzoom, aspx, aspy;
575 
576  ED_space_clip_get_aspect(sc, &aspx, &aspy);
577 
578  width = BLI_rcti_size_x(&region->winrct) + 1;
579  height = BLI_rcti_size_y(&region->winrct) + 1;
580 
581  zoomx = (float)width / w / aspx;
582  zoomy = (float)height / h / aspy;
583 
584  newzoom = 1.0f / power_of_2(1.0f / min_ff(zoomx, zoomy));
585 
586  if (fit) {
587  *r_zoom = newzoom;
588  }
589  }
590 
591  return true;
592 }
593 
595 {
596  SpaceClip *space_clip = CTX_wm_space_clip(C);
597 
598  if ((space_clip->flag & SC_LOCK_SELECTION) == 0) {
599  return false;
600  }
601 
602  if (space_clip->mode == SC_MODE_TRACKING) {
603  return tracking_has_selection(space_clip);
604  }
605 
606  return mask_has_selection(C);
607 }
608 
610 {
612 
613  /* currently clip editor supposes that editing clip length is equal to scene frame range */
615 
618 
619  immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
620  immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)scene->r.sfra, v2d->cur.ymax);
621  immRectf(pos, (float)scene->r.efra, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
622 
624 
626 
627  /* thin lines where the actual frames are */
628  GPU_line_width(1.0f);
629 
631  immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymin);
632  immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymax);
633  immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymin);
634  immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymax);
635  immEnd();
636 
638 }
typedef float(TangentPoint)[2]
bool BKE_animdata_fix_paths_remove(struct ID *id, const char *path)
Definition: anim_data.c:1067
struct SpaceClip * CTX_wm_space_clip(const bContext *C)
Definition: context.c:923
struct Mask * CTX_data_edit_mask(const bContext *C)
Definition: context.c:1390
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
@ MASK_HANDLE_MODE_STICK
Definition: BKE_mask.h:40
#define MASKPOINT_ISSEL_ANY(p)
Definition: BKE_mask.h:296
void BKE_mask_coord_to_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
Definition: mask.c:1246
eMaskhandleMode BKE_mask_point_handles_mode_get(const struct MaskSplinePoint *point)
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height)
Definition: movieclip.c:1520
float BKE_movieclip_remap_clip_to_scene_frame(const struct MovieClip *clip, float framenr)
void BKE_tracking_plane_tracks_remove_point_track(struct MovieTracking *tracking, struct MovieTrackingTrack *track)
Definition: tracking.c:1775
void BKE_tracking_plane_track_free(struct MovieTrackingPlaneTrack *plane_track)
Definition: tracking.c:1694
struct ListBase * BKE_tracking_get_active_tracks(struct MovieTracking *tracking)
Definition: tracking.c:346
void BKE_tracking_get_rna_path_for_track(const struct MovieTracking *tracking, const struct MovieTrackingTrack *track, char *rna_path, size_t rna_path_len)
Definition: tracking.c:3495
#define TRACK_SELECTED(track)
Definition: BKE_tracking.h:823
float BKE_tracking_track_get_weight_for_marker(struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker)
Definition: tracking.c:1239
struct MovieTrackingTrack * BKE_tracking_track_get_active(struct MovieTracking *tracking)
Definition: tracking.c:1089
void BKE_tracking_track_free(struct MovieTrackingTrack *track)
Definition: tracking.c:606
struct ListBase * BKE_tracking_get_active_plane_tracks(struct MovieTracking *tracking)
Definition: tracking.c:357
void BKE_tracking_distort_v2(struct MovieTracking *tracking, int image_width, int image_height, const float co[2], float r_co[2])
Definition: tracking.c:2457
void BKE_tracking_get_rna_path_for_plane_track(const struct MovieTracking *tracking, const struct MovieTrackingPlaneTrack *plane_track, char *rna_path, size_t rna_path_len)
Definition: tracking.c:3533
#define TRACK_VIEW_SELECTED(sc, track)
Definition: BKE_tracking.h:831
void BKE_tracking_get_projection_matrix(struct MovieTracking *tracking, struct MovieTrackingObject *object, int framenr, int winx, int winy, float mat[4][4])
Definition: tracking.c:391
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1424
struct MovieTrackingObject * BKE_tracking_object_get_active(struct MovieTracking *tracking)
Definition: tracking.c:2092
void BKE_tracking_marker_delete(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1347
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
MINLINE float min_ff(float a, float b)
MINLINE float power_of_2(float f)
void mul_v4_m4v4(float r[4], const float M[4][4], const float v[4])
Definition: math_matrix.c:850
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:739
MINLINE void copy_v3_v3(float r[3], const float a[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
Definition: math_vector.c:890
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float len_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:190
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
unsigned int uint
Definition: BLI_sys_types.h:67
#define INIT_MINMAX2(min, max)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ HD_VECT
#define MAX_NAME
Definition: DNA_defs.h:48
#define MASK_HIDE_SELECT
#define MASK_HIDE_VIEW
@ MCLIP_PROXY_RENDER_UNDISTORT
@ SC_MODE_TRACKING
@ SC_LOCK_SELECTION
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ SC_SHOW_GRAPH_TRACKS_ERROR
@ MARKER_DISABLED
@ TRACK_HIDDEN
@ TRACK_USE_2D_STAB
@ TRACK_HAS_BUNDLE
@ TRACK_USE_2D_STAB_ROT
int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc)
Definition: clip_editor.c:231
void ED_clip_point_undistorted_pos(struct SpaceClip *sc, const float co[2], float r_co[2])
Definition: clip_editor.c:462
void ED_space_clip_get_aspect(struct SpaceClip *sc, float *aspx, float *aspy)
Definition: clip_editor.c:176
void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height)
Definition: clip_editor.c:146
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:570
bool ED_mask_selected_minmax(const struct bContext *C, float min[2], float max[2], bool handles_as_control_point)
void immUniformColor4f(float r, float g, float b, float a)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immUniformThemeColorShade(int color_id, int offset)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
GPUVertFormat * immVertexFormat(void)
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 y
_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 width
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:20
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:201
@ GPU_BLEND_NONE
Definition: GPU_state.h:60
@ GPU_BLEND_ALPHA
Definition: GPU_state.h:62
void GPU_blend(eGPUBlend blend)
Definition: gpu_state.cc:39
void GPU_line_width(float width)
Definition: gpu_state.cc:158
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
#define C
Definition: RandGen.cpp:25
@ TH_BACK
Definition: UI_resources.h:39
void UI_view2d_view_ortho(const struct View2D *v2d)
#define ND_DISPLAY
Definition: WM_types.h:439
#define NC_MOVIECLIP
Definition: WM_types.h:347
#define NA_EDITED
Definition: WM_types.h:523
#define ND_SPACE_VIEW3D
Definition: WM_types.h:471
#define NC_SPACE
Definition: WM_types.h:342
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
void(* ClipTrackValueSegmentStartCallback)(void *userdata, struct MovieTrackingTrack *track, eClipCurveValueSource value_source, bool is_point)
Definition: clip_intern.h:127
void(* ClipTrackValueSegmentEndCallback)(void *userdata, eClipCurveValueSource value_source)
Definition: clip_intern.h:132
eClipCurveValueSource
Definition: clip_intern.h:114
@ CLIP_VALUE_SOURCE_REPROJECTION_ERROR
Definition: clip_intern.h:117
@ CLIP_VALUE_SOURCE_SPEED_Y
Definition: clip_intern.h:116
@ CLIP_VALUE_SOURCE_SPEED_X
Definition: clip_intern.h:115
void(* ClipTrackValueCallback)(void *userdata, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val)
Definition: clip_intern.h:120
static bool mask_has_selection(const bContext *C)
Definition: clip_utils.c:470
void clip_graph_tracking_values_iterate_track(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:237
bool clip_graph_value_visible(SpaceClip *sc, eClipCurveValueSource value_source)
Definition: clip_utils.c:42
static float calculate_reprojection_error_at_marker(MovieClip *clip, MovieTracking *tracking, MovieTrackingObject *tracking_object, MovieTrackingTrack *track, MovieTrackingMarker *marker, const int clip_width, const int clip_height, const int scene_framenr)
Definition: clip_utils.c:130
void clip_delete_marker(bContext *C, MovieClip *clip, MovieTrackingTrack *track, MovieTrackingMarker *marker)
Definition: clip_utils.c:350
static bool tracking_has_selection(SpaceClip *space_clip)
Definition: clip_utils.c:451
void clip_delete_plane_track(bContext *C, MovieClip *clip, MovieTrackingPlaneTrack *plane_track)
Definition: clip_utils.c:365
void clip_view_center_to_point(SpaceClip *sc, float x, float y)
Definition: clip_utils.c:398
static bool selected_tracking_boundbox(SpaceClip *sc, float min[2], float max[2])
Definition: clip_utils.c:403
void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
Definition: clip_utils.c:609
static void clip_graph_tracking_values_iterate_track_reprojection_error_values(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:166
bool clip_view_calculate_view_selection(const bContext *C, bool fit, float *r_offset_x, float *r_offset_y, float *r_zoom)
Definition: clip_utils.c:534
bool clip_view_has_locked_selection(const bContext *C)
Definition: clip_utils.c:594
void clip_graph_tracking_values_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:251
void clip_graph_tracking_iterate(SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void(*func)(void *userdata, MovieTrackingMarker *marker))
Definition: clip_utils.c:278
static void clip_graph_tracking_values_iterate_track_speed_values(SpaceClip *sc, MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:57
void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track)
Definition: clip_utils.c:311
void clip_view_offset_for_center_to_point(SpaceClip *sc, const float x, const float y, float *r_offset_x, float *r_offset_y)
Definition: clip_utils.c:385
static bool selected_boundbox(const bContext *C, float min[2], float max[2], bool handles_as_control_point)
Definition: clip_utils.c:509
#define SELECT
Scene scene
SyclQueue void void size_t num_bytes void
uint pos
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define min(a, b)
Definition: sort.c:35
uint8_t h1
uint8_t f3
uint8_t f1
uint8_t f2
uint8_t h2
void * first
Definition: DNA_listBase.h:31
struct MovieTracking tracking
MovieTrackingMarker * markers
struct MovieTrackingTrack * next
MovieTrackingTrack * act_track
MovieTrackingCamera camera
struct RenderData r
struct MovieClipUser user
float stabmat[4][4]
struct MovieClip * clip
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
float max
void WM_event_add_notifier(const bContext *C, uint type, void *reference)