Blender  V3.3
transform_convert_tracking.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_movieclip.h"
18 #include "BKE_node.h"
19 #include "BKE_node_tree_update.h"
20 #include "BKE_tracking.h"
21 
22 #include "ED_clip.h"
23 
24 #include "WM_api.h"
25 #include "WM_types.h"
26 
27 #include "transform.h"
28 #include "transform_convert.h"
29 
30 typedef struct TransDataTracking {
31  int mode, flag;
32 
33  /* tracks transformation from main window */
34  int area;
35  const float *relative, *loc;
36  float soffset[2], srelative[2];
37  float offset[2];
38 
39  float (*smarkers)[2];
40  int markersnr;
41  int framenr;
43 
44  /* marker transformation from curves editor */
45  float *prev_pos, scale;
46  short coord;
47 
51 
56 };
57 
58 /* -------------------------------------------------------------------- */
62 typedef struct TransformInitContext {
64 
67 
68  /* NOTE: These pointers will be `nullptr` during counting step.
69  * This means, that the transformation data initialization functions are to increment
70  * `tc->data_len` instead of filling in the transformation data when these pointers are
71  * `nullptr`. For simplicity, check the `current.td` against `nullptr`.
72  * Do not `tc->data_len` when filling in the transformation data. */
73  struct {
79 
81  MovieTrackingTrack *track,
82  MovieTrackingMarker *marker,
83  int area,
84  float loc[2],
85  const float rel[2],
86  const float off[2],
87  const float aspect[2])
88 {
89  TransData *td = init_context->current.td;
90  TransData2D *td2d = init_context->current.td2d;
91  TransDataTracking *tdt = init_context->current.tdt;
92 
93  if (td == NULL) {
94  init_context->tc->data_len++;
95  return;
96  }
97 
98  int anchor = area == TRACK_AREA_POINT && off;
99 
100  tdt->flag = marker->flag;
101  tdt->framenr = marker->framenr;
103 
104  if (anchor) {
105  td2d->loc[0] = rel[0] * aspect[0]; /* hold original location */
106  td2d->loc[1] = rel[1] * aspect[1];
107 
108  tdt->loc = loc;
109  td2d->loc2d = loc; /* current location */
110  }
111  else {
112  td2d->loc[0] = loc[0] * aspect[0]; /* hold original location */
113  td2d->loc[1] = loc[1] * aspect[1];
114 
115  td2d->loc2d = loc; /* current location */
116  }
117  td2d->loc[2] = 0.0f;
118 
119  tdt->relative = rel;
120  tdt->area = area;
121 
122  tdt->markersnr = track->markersnr;
123  tdt->markers = track->markers;
124  tdt->track = track;
125 
126  if (rel) {
127  if (!anchor) {
128  td2d->loc[0] += rel[0] * aspect[0];
129  td2d->loc[1] += rel[1] * aspect[1];
130  }
131 
132  copy_v2_v2(tdt->srelative, rel);
133  }
134 
135  if (off) {
136  copy_v2_v2(tdt->soffset, off);
137  }
138 
139  td->flag = 0;
140  td->loc = td2d->loc;
141  copy_v3_v3(td->iloc, td->loc);
142 
143  // copy_v3_v3(td->center, td->loc);
144  td->flag |= TD_INDIVIDUAL_SCALE;
145  td->center[0] = marker->pos[0] * aspect[0];
146  td->center[1] = marker->pos[1] * aspect[1];
147 
148  memset(td->axismtx, 0, sizeof(td->axismtx));
149  td->axismtx[2][2] = 1.0f;
150 
151  td->ext = NULL;
152  td->val = NULL;
153 
154  td->flag |= TD_SELECTED;
155  td->dist = 0.0;
156 
157  unit_m3(td->mtx);
158  unit_m3(td->smtx);
159 
160  init_context->current.td++;
161  init_context->current.td2d++;
162  init_context->current.tdt++;
163 }
164 
166  const int framenr,
167  MovieTrackingTrack *track,
168  const float aspect[2])
169 {
170  MovieTrackingMarker *marker = BKE_tracking_marker_ensure(track, framenr);
171 
173  track,
174  marker,
176  track->offset,
177  marker->pos,
178  track->offset,
179  aspect);
180 
181  if (track->flag & SELECT) {
183  init_context, track, marker, TRACK_AREA_POINT, marker->pos, NULL, NULL, aspect);
184  }
185 
186  if (track->pat_flag & SELECT) {
187  int a;
188 
189  for (a = 0; a < 4; a++) {
191  track,
192  marker,
194  marker->pattern_corners[a],
195  marker->pos,
196  NULL,
197  aspect);
198  }
199  }
200 
201  if (track->search_flag & SELECT) {
203  track,
204  marker,
206  marker->search_min,
207  marker->pos,
208  NULL,
209  aspect);
210 
212  track,
213  marker,
215  marker->search_max,
216  marker->pos,
217  NULL,
218  aspect);
219  }
220 
221  if (init_context->current.td != NULL) {
222  marker->flag &= ~(MARKER_DISABLED | MARKER_TRACKED);
223  }
224 }
225 
227  const int framenr,
228  MovieTrackingTrack *track,
229  const float aspect[2])
230 {
231  if (!TRACK_VIEW_SELECTED(init_context->space_clip, track)) {
232  return;
233  }
234  if (track->flag & TRACK_LOCKED) {
235  return;
236  }
237  trackToTransData(init_context, framenr, track, aspect);
238 }
239 
241  MovieTrackingPlaneTrack *plane_track,
242  MovieTrackingPlaneMarker *plane_marker,
243  float corner[2],
244  const float aspect[2])
245 {
246  TransData *td = init_context->current.td;
247  TransData2D *td2d = init_context->current.td2d;
248  TransDataTracking *tdt = init_context->current.tdt;
249 
250  if (td == NULL) {
251  init_context->tc->data_len++;
252  return;
253  }
254 
255  tdt->flag = plane_marker->flag;
256  tdt->framenr = plane_marker->framenr;
258  tdt->plane_track = plane_track;
259 
260  td2d->loc[0] = corner[0] * aspect[0]; /* hold original location */
261  td2d->loc[1] = corner[1] * aspect[1];
262 
263  td2d->loc2d = corner; /* current location */
264  td2d->loc[2] = 0.0f;
265 
266  td->flag = 0;
267  td->loc = td2d->loc;
268  copy_v3_v3(td->iloc, td->loc);
269  copy_v3_v3(td->center, td->loc);
270 
271  memset(td->axismtx, 0, sizeof(td->axismtx));
272  td->axismtx[2][2] = 1.0f;
273 
274  td->ext = NULL;
275  td->val = NULL;
276 
277  td->flag |= TD_SELECTED;
278  td->dist = 0.0;
279 
280  unit_m3(td->mtx);
281  unit_m3(td->smtx);
282 
283  init_context->current.td++;
284  init_context->current.td2d++;
285  init_context->current.tdt++;
286 }
287 
289  const int framenr,
290  MovieTrackingPlaneTrack *plane_track,
291  const float aspect[2])
292 {
293  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_ensure(plane_track, framenr);
294 
295  for (int i = 0; i < 4; i++) {
297  init_context, plane_track, plane_marker, plane_marker->corners[i], aspect);
298  }
299 
300  if (init_context->current.td != NULL) {
301  plane_marker->flag &= ~PLANE_MARKER_TRACKED;
302  }
303 }
304 
306  const int framenr,
307  MovieTrackingPlaneTrack *plane_track,
308  const float aspect[2])
309 {
310  if (!PLANE_TRACK_VIEW_SELECTED(plane_track)) {
311  return;
312  }
313  planeTrackToTransData(init_context, framenr, plane_track, aspect);
314 }
315 
318  TransCustomData *custom_data)
319 {
320  if (custom_data->data) {
321  TransDataTracking *tdt = custom_data->data;
322  if (tdt->smarkers) {
323  MEM_freeN(tdt->smarkers);
324  }
325 
326  MEM_freeN(tdt);
327  custom_data->data = NULL;
328  }
329 }
330 
332 {
333  SpaceClip *space_clip = CTX_wm_space_clip(C);
334  MovieClip *clip = ED_space_clip_get_clip(space_clip);
335  const ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
336  const ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
337  const int framenr = ED_space_clip_get_clip_frame_number(space_clip);
338 
340 
342  init_context.space_clip = space_clip;
343  init_context.t = t;
344  init_context.tc = tc;
345 
346  /* Count required transformation data. */
347 
348  tc->data_len = 0;
349 
350  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
351  trackToTransDataIfNeeded(&init_context, framenr, track, t->aspect);
352  }
353 
354  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
355  planeTrackToTransDataIfNeeded(&init_context, framenr, plane_track, t->aspect);
356  }
357 
358  if (tc->data_len == 0) {
359  return;
360  }
361 
362  tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransTracking TransData");
363  tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransTracking TransData2D");
365  "TransTracking TransDataTracking");
367 
368  init_context.current.td = tc->data;
369  init_context.current.td2d = tc->data_2d;
370  init_context.current.tdt = tc->custom.type.data;
371 
372  /* Create actual transformation data. */
373 
374  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
375  trackToTransDataIfNeeded(&init_context, framenr, track, t->aspect);
376  }
377 
378  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
379  planeTrackToTransDataIfNeeded(&init_context, framenr, plane_track, t->aspect);
380  }
381 }
382 
384  TransData2D *td2d,
385  TransDataTracking *tdt,
386  MovieTrackingTrack *track,
387  MovieTrackingMarker *marker,
388  MovieTrackingMarker *prev_marker,
389  short coord,
390  float size)
391 {
392  float frames_delta = (marker->framenr - prev_marker->framenr);
393 
394  tdt->flag = marker->flag;
395  marker->flag &= ~MARKER_TRACKED;
396 
398  tdt->coord = coord;
399  tdt->scale = 1.0f / size * frames_delta;
400  tdt->prev_pos = prev_marker->pos;
401  tdt->track = track;
402 
403  /* calculate values depending on marker's speed */
404  td2d->loc[0] = marker->framenr;
405  td2d->loc[1] = (marker->pos[coord] - prev_marker->pos[coord]) * size / frames_delta;
406  td2d->loc[2] = 0.0f;
407 
408  td2d->loc2d = marker->pos; /* current location */
409 
410  td->flag = 0;
411  td->loc = td2d->loc;
412  copy_v3_v3(td->center, td->loc);
413  copy_v3_v3(td->iloc, td->loc);
414 
415  memset(td->axismtx, 0, sizeof(td->axismtx));
416  td->axismtx[2][2] = 1.0f;
417 
418  td->ext = NULL;
419  td->val = NULL;
420 
421  td->flag |= TD_SELECTED;
422  td->dist = 0.0;
423 
424  unit_m3(td->mtx);
425  unit_m3(td->smtx);
426 }
427 
429 {
430  TransData *td;
431  TransData2D *td2d;
433  MovieClip *clip = ED_space_clip_get_clip(sc);
434  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
435  MovieTrackingTrack *track;
436  MovieTrackingMarker *marker, *prev_marker;
437  TransDataTracking *tdt;
438  int i, width, height;
439 
440  BKE_movieclip_get_size(clip, &sc->user, &width, &height);
441 
443 
444  /* count */
445  tc->data_len = 0;
446 
447  if ((sc->flag & SC_SHOW_GRAPH_TRACKS_MOTION) == 0) {
448  return;
449  }
450 
451  track = tracksbase->first;
452  while (track) {
453  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
454  for (i = 1; i < track->markersnr; i++) {
455  marker = &track->markers[i];
456  prev_marker = &track->markers[i - 1];
457 
458  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
459  continue;
460  }
461 
462  if (marker->flag & MARKER_GRAPH_SEL_X) {
463  tc->data_len += 1;
464  }
465 
466  if (marker->flag & MARKER_GRAPH_SEL_Y) {
467  tc->data_len += 1;
468  }
469  }
470  }
471 
472  track = track->next;
473  }
474 
475  if (tc->data_len == 0) {
476  return;
477  }
478 
479  td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransTracking TransData");
480  td2d = tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D),
481  "TransTracking TransData2D");
482  tc->custom.type.data = tdt = MEM_callocN(tc->data_len * sizeof(TransDataTracking),
483  "TransTracking TransDataTracking");
485 
486  /* create actual data */
487  track = tracksbase->first;
488  while (track) {
489  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
490  for (i = 1; i < track->markersnr; i++) {
491  marker = &track->markers[i];
492  prev_marker = &track->markers[i - 1];
493 
494  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
495  continue;
496  }
497 
498  if (marker->flag & MARKER_GRAPH_SEL_X) {
500  td, td2d, tdt, track, marker, &track->markers[i - 1], 0, width);
501  td += 1;
502  td2d += 1;
503  tdt += 1;
504  }
505 
506  if (marker->flag & MARKER_GRAPH_SEL_Y) {
508  td, td2d, tdt, track, marker, &track->markers[i - 1], 1, height);
509 
510  td += 1;
511  td2d += 1;
512  tdt += 1;
513  }
514  }
515  }
516 
517  track = track->next;
518  }
519 }
520 
522 {
523  ARegion *region = CTX_wm_region(C);
525  MovieClip *clip = ED_space_clip_get_clip(sc);
526  int width, height;
527 
529 
530  tc->data_len = 0;
531 
532  if (!clip) {
533  return;
534  }
535 
536  BKE_movieclip_get_size(clip, &sc->user, &width, &height);
537 
538  if (width == 0 || height == 0) {
539  return;
540  }
541 
542  if (region->regiontype == RGN_TYPE_PREVIEW) {
543  /* transformation was called from graph editor */
545  }
546  else {
548  }
549 }
550 
553 /* -------------------------------------------------------------------- */
558 {
560  TransDataTracking *tdt_array = tc->custom.type.data;
561 
562  int i = 0;
563  while (i < tc->data_len) {
564  TransDataTracking *tdt = &tdt_array[i];
565 
566  if (tdt->mode == transDataTracking_ModeTracks) {
567  MovieTrackingTrack *track = tdt->track;
569 
570  BLI_assert(marker != NULL);
571 
572  marker->flag = tdt->flag;
573 
574  if (track->flag & SELECT) {
575  i++;
576  }
577 
578  if (track->pat_flag & SELECT) {
579  i += 4;
580  }
581 
582  if (track->search_flag & SELECT) {
583  i += 2;
584  }
585  }
586  else if (tdt->mode == transDataTracking_ModeCurves) {
587  MovieTrackingTrack *track = tdt->track;
588  MovieTrackingMarker *marker, *prev_marker;
589  int a;
590 
591  for (a = 1; a < track->markersnr; a++) {
592  marker = &track->markers[a];
593  prev_marker = &track->markers[a - 1];
594 
595  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
596  continue;
597  }
598 
599  if (marker->flag & (MARKER_GRAPH_SEL_X | MARKER_GRAPH_SEL_Y)) {
600  marker->flag = tdt->flag;
601  }
602  }
603  }
604  else if (tdt->mode == transDataTracking_ModePlaneTracks) {
605  MovieTrackingPlaneTrack *plane_track = tdt->plane_track;
607  tdt->framenr);
608 
609  BLI_assert(plane_marker != NULL);
610 
611  plane_marker->flag = tdt->flag;
612  i += 3;
613  }
614 
615  i++;
616  }
617 }
618 
620 {
621  TransData *td;
622  TransData2D *td2d;
623  TransDataTracking *tdt;
624  int td_index;
625 
626  if (t->state == TRANS_CANCEL) {
628  }
629 
631 
632  /* flush to 2d vector from internally used 3d vector */
633  for (td_index = 0, td = tc->data, td2d = tc->data_2d, tdt = tc->custom.type.data;
634  td_index < tc->data_len;
635  td_index++, td2d++, td++, tdt++) {
636  if (tdt->mode == transDataTracking_ModeTracks) {
637  float loc2d[2];
638 
639  if (t->mode == TFM_ROTATION && tdt->area == TRACK_AREA_SEARCH) {
640  continue;
641  }
642 
643  loc2d[0] = td2d->loc[0] / t->aspect[0];
644  loc2d[1] = td2d->loc[1] / t->aspect[1];
645 
646  if (t->flag & T_ALT_TRANSFORM) {
647  if (t->mode == TFM_RESIZE) {
648  if (tdt->area != TRACK_AREA_PAT) {
649  continue;
650  }
651  }
652  else if (t->mode == TFM_TRANSLATION) {
653  if (tdt->area == TRACK_AREA_POINT && tdt->relative) {
654  float d[2], d2[2];
655 
656  if (!tdt->smarkers) {
657  tdt->smarkers = MEM_callocN(sizeof(*tdt->smarkers) * tdt->markersnr,
658  "flushTransTracking markers");
659  for (int a = 0; a < tdt->markersnr; a++) {
660  copy_v2_v2(tdt->smarkers[a], tdt->markers[a].pos);
661  }
662  }
663 
664  sub_v2_v2v2(d, loc2d, tdt->soffset);
665  sub_v2_v2(d, tdt->srelative);
666 
667  sub_v2_v2v2(d2, loc2d, tdt->srelative);
668 
669  for (int a = 0; a < tdt->markersnr; a++) {
670  add_v2_v2v2(tdt->markers[a].pos, tdt->smarkers[a], d2);
671  }
672 
673  negate_v2_v2(td2d->loc2d, d);
674  }
675  }
676  }
677 
678  if (tdt->area != TRACK_AREA_POINT || tdt->relative == NULL) {
679  td2d->loc2d[0] = loc2d[0];
680  td2d->loc2d[1] = loc2d[1];
681 
682  if (tdt->relative) {
683  sub_v2_v2(td2d->loc2d, tdt->relative);
684  }
685  }
686  }
687  else if (tdt->mode == transDataTracking_ModeCurves) {
688  td2d->loc2d[tdt->coord] = tdt->prev_pos[tdt->coord] + td2d->loc[1] * tdt->scale;
689  }
690  else if (tdt->mode == transDataTracking_ModePlaneTracks) {
691  td2d->loc2d[0] = td2d->loc[0] / t->aspect[0];
692  td2d->loc2d[1] = td2d->loc[1] / t->aspect[1];
693  }
694  }
695 }
696 
698 {
699  SpaceClip *sc = t->area->spacedata.first;
700 
702  MovieClip *clip = ED_space_clip_get_clip(sc);
703  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
704  MovieTrackingTrack *track;
705  int framenr = ED_space_clip_get_clip_frame_number(sc);
706 
708 
709  track = tracksbase->first;
710  while (track) {
711  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
712  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
713 
714  if (t->mode == TFM_TRANSLATION) {
715  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
717  }
720  }
721  }
722  else if (t->mode == TFM_RESIZE) {
723  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
725  }
728  }
729  }
730  else if (t->mode == TFM_ROTATION) {
731  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
733  }
734  }
735  }
736 
737  track = track->next;
738  }
739 
740  DEG_id_tag_update(&clip->id, 0);
741  }
742 }
743 
746 /* -------------------------------------------------------------------- */
751 {
752  SpaceClip *sc = t->area->spacedata.first;
753  MovieClip *clip = ED_space_clip_get_clip(sc);
754  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
755  const int framenr = ED_space_clip_get_clip_frame_number(sc);
756  /* Update coordinates of modified plane tracks. */
757  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
758  bool do_update = false;
759  if (plane_track->flag & PLANE_TRACK_HIDDEN) {
760  continue;
761  }
762  do_update |= PLANE_TRACK_VIEW_SELECTED(plane_track) != 0;
763  if (do_update == false) {
764  if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) {
765  int i;
766  for (i = 0; i < plane_track->point_tracksnr; i++) {
767  MovieTrackingTrack *track = plane_track->point_tracks[i];
768  if (TRACK_VIEW_SELECTED(sc, track)) {
769  do_update = true;
770  break;
771  }
772  }
773  }
774  }
775  if (do_update) {
776  BKE_tracking_track_plane_from_existing_motion(plane_track, framenr);
777  }
778  }
779  if (t->scene->nodetree != NULL) {
780  /* Tracks can be used for stabilization nodes,
781  * flush update for such nodes.
782  */
783  if (t->context != NULL) {
784  Main *bmain = CTX_data_main(C);
785  BKE_ntree_update_tag_id_changed(bmain, &clip->id);
786  BKE_ntree_update_main(bmain, NULL);
788  }
789  }
790 }
791 
795  /* flags */ (T_POINTS | T_2D_EDIT),
796  /* createTransData */ createTransTrackingData,
797  /* recalcData */ recalcData_tracking,
798  /* special_aftertrans_update */ special_aftertrans_update__movieclip,
799 };
typedef float(TangentPoint)[2]
struct SpaceClip * CTX_wm_space_clip(const bContext *C)
Definition: context.c:923
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height)
Definition: movieclip.c:1520
void BKE_ntree_update_tag_id_changed(struct Main *bmain, struct ID *id)
void BKE_ntree_update_main(struct Main *bmain, struct NodeTreeUpdateExtraParams *params)
void BKE_tracking_marker_clamp_pattern_position(struct MovieTrackingMarker *marker)
Definition: tracking.c:1374
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_ensure(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:1950
struct ListBase * BKE_tracking_get_active_tracks(struct MovieTracking *tracking)
Definition: tracking.c:346
#define PLANE_TRACK_VIEW_SELECTED(plane_track)
Definition: BKE_tracking.h:837
@ TRACK_AREA_POINT
Definition: BKE_tracking.h:38
@ TRACK_AREA_PAT
Definition: BKE_tracking.h:39
@ TRACK_AREA_SEARCH
Definition: BKE_tracking.h:40
struct MovieTrackingMarker * BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1468
void BKE_tracking_marker_clamp_search_position(struct MovieTrackingMarker *marker)
Definition: tracking.c:1404
struct MovieTrackingMarker * BKE_tracking_marker_get_exact(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1457
void BKE_tracking_track_plane_from_existing_motion(struct MovieTrackingPlaneTrack *plane_track, int start_frame)
struct ListBase * BKE_tracking_get_active_plane_tracks(struct MovieTracking *tracking)
Definition: tracking.c:357
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get_exact(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:1938
void BKE_tracking_marker_clamp_search_size(struct MovieTrackingMarker *marker)
Definition: tracking.c:1393
#define TRACK_VIEW_SELECTED(sc, track)
Definition: BKE_tracking.h:831
#define TRACK_AREA_SELECTED(track, area)
Definition: BKE_tracking.h:826
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1424
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void unit_m3(float m[3][3])
Definition: math_matrix.c:40
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
#define UNUSED(x)
void DEG_id_tag_update(struct ID *id, int flag)
@ RGN_TYPE_PREVIEW
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ PLANE_MARKER_TRACKED
@ PLANE_TRACK_HIDDEN
@ PLANE_TRACK_AUTOKEY
@ MARKER_GRAPH_SEL_X
@ MARKER_GRAPH_SEL_Y
@ MARKER_TRACKED
@ MARKER_DISABLED
@ TRACK_LOCKED
int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc)
Definition: clip_editor.c:231
bool ED_space_clip_check_show_trackedit(struct SpaceClip *sc)
Definition: clip_editor.c:546
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:570
@ TFM_RESIZE
Definition: ED_transform.h:32
@ TFM_ROTATION
Definition: ED_transform.h:31
@ 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 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 GLsizei width
_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.
#define C
Definition: RandGen.cpp:25
#define NC_SCENE
Definition: WM_types.h:328
#define ND_NODES
Definition: WM_types.h:384
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
#define SELECT
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static unsigned a[3]
Definition: RandGen.cpp:78
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void init_context(DupliContext *r_ctx, Depsgraph *depsgraph, Scene *scene, Object *ob, const float space_mat[4][4], Vector< Object * > &instance_stack)
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
short regiontype
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct MovieTracking tracking
MovieTrackingMarker * markers
struct MovieTrackingTrack * next
struct MovieClipUser user
void(* free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data)
float * loc2d
float loc[3]
MovieTrackingMarker * markers
MovieTrackingTrack * track
MovieTrackingPlaneTrack * plane_track
float smtx[3][3]
float axismtx[3][3]
float mtx[3][3]
TransDataExtension * ext
float * val
struct TransformInitContext::@606 current
conversion and adaptation of different datablocks to a common struct.
static void cancelTransTracking(TransInfo *t)
static void markerToTransCurveDataInit(TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track, MovieTrackingMarker *marker, MovieTrackingMarker *prev_marker, short coord, float size)
static void recalcData_tracking(TransInfo *t)
static void planeMarkerToTransDataInit(TransformInitContext *init_context, MovieTrackingPlaneTrack *plane_track, MovieTrackingPlaneMarker *plane_marker, float corner[2], const float aspect[2])
static void flushTransTracking(TransInfo *t)
static void planeTrackToTransDataIfNeeded(TransformInitContext *init_context, const int framenr, MovieTrackingPlaneTrack *plane_track, const float aspect[2])
static void planeTrackToTransData(TransformInitContext *init_context, const int framenr, MovieTrackingPlaneTrack *plane_track, const float aspect[2])
static void trackToTransDataIfNeeded(TransformInitContext *init_context, const int framenr, MovieTrackingTrack *track, const float aspect[2])
static void transDataTrackingFree(TransInfo *UNUSED(t), TransDataContainer *UNUSED(tc), TransCustomData *custom_data)
struct TransDataTracking TransDataTracking
static void markerToTransDataInit(TransformInitContext *init_context, MovieTrackingTrack *track, MovieTrackingMarker *marker, int area, float loc[2], const float rel[2], const float off[2], const float aspect[2])
static void createTransTrackingTracksData(bContext *C, TransInfo *t)
struct TransformInitContext TransformInitContext
TransConvertTypeInfo TransConvertType_Tracking
static void trackToTransData(TransformInitContext *init_context, const int framenr, MovieTrackingTrack *track, const float aspect[2])
static void createTransTrackingCurvesData(bContext *C, TransInfo *t)
@ transDataTracking_ModeTracks
@ transDataTracking_ModeCurves
@ transDataTracking_ModePlaneTracks
static void createTransTrackingData(bContext *C, TransInfo *t)
static void special_aftertrans_update__movieclip(bContext *C, TransInfo *t)
@ TD_INDIVIDUAL_SCALE
@ TD_SELECTED
void WM_event_add_notifier(const bContext *C, uint type, void *reference)