Blender  V2.93
transform_convert_tracking.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #include "DNA_space_types.h"
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "BLI_listbase.h"
29 #include "BLI_math.h"
30 
31 #include "BKE_context.h"
32 #include "BKE_movieclip.h"
33 #include "BKE_node.h"
34 #include "BKE_tracking.h"
35 
36 #include "ED_clip.h"
37 
38 #include "WM_api.h"
39 #include "WM_types.h"
40 
41 #include "transform.h"
42 #include "transform_convert.h"
43 
44 typedef struct TransDataTracking {
45  int mode, flag;
46 
47  /* tracks transformation from main window */
48  int area;
49  const float *relative, *loc;
50  float soffset[2], srelative[2];
51  float offset[2];
52 
53  float (*smarkers)[2];
54  int markersnr;
55  int framenr;
57 
58  /* marker transformation from curves editor */
59  float *prev_pos, scale;
60  short coord;
61 
65 
70 };
71 
72 /* -------------------------------------------------------------------- */
76 typedef struct TransformInitContext {
78 
81 
82  /* NOTE: These pointers will be `nullptr` during counting step.
83  * This means, that the transformation data initialization functions are to increment
84  * `tc->data_len` instead of filling in the transformation data when these pointers are
85  * `nullptr`. For simplicity, check the `current.td` against `nullptr`.
86  * Do not `tc->data_len` when filling in the transformation data. */
87  struct {
93 
95  MovieTrackingTrack *track,
96  MovieTrackingMarker *marker,
97  int area,
98  float loc[2],
99  const float rel[2],
100  const float off[2],
101  const float aspect[2])
102 {
103  TransData *td = init_context->current.td;
104  TransData2D *td2d = init_context->current.td2d;
105  TransDataTracking *tdt = init_context->current.tdt;
106 
107  if (td == NULL) {
108  init_context->tc->data_len++;
109  return;
110  }
111 
112  int anchor = area == TRACK_AREA_POINT && off;
113 
114  tdt->flag = marker->flag;
115  tdt->framenr = marker->framenr;
117 
118  if (anchor) {
119  td2d->loc[0] = rel[0] * aspect[0]; /* hold original location */
120  td2d->loc[1] = rel[1] * aspect[1];
121 
122  tdt->loc = loc;
123  td2d->loc2d = loc; /* current location */
124  }
125  else {
126  td2d->loc[0] = loc[0] * aspect[0]; /* hold original location */
127  td2d->loc[1] = loc[1] * aspect[1];
128 
129  td2d->loc2d = loc; /* current location */
130  }
131  td2d->loc[2] = 0.0f;
132 
133  tdt->relative = rel;
134  tdt->area = area;
135 
136  tdt->markersnr = track->markersnr;
137  tdt->markers = track->markers;
138  tdt->track = track;
139 
140  if (rel) {
141  if (!anchor) {
142  td2d->loc[0] += rel[0] * aspect[0];
143  td2d->loc[1] += rel[1] * aspect[1];
144  }
145 
146  copy_v2_v2(tdt->srelative, rel);
147  }
148 
149  if (off) {
150  copy_v2_v2(tdt->soffset, off);
151  }
152 
153  td->flag = 0;
154  td->loc = td2d->loc;
155  copy_v3_v3(td->iloc, td->loc);
156 
157  // copy_v3_v3(td->center, td->loc);
158  td->flag |= TD_INDIVIDUAL_SCALE;
159  td->center[0] = marker->pos[0] * aspect[0];
160  td->center[1] = marker->pos[1] * aspect[1];
161 
162  memset(td->axismtx, 0, sizeof(td->axismtx));
163  td->axismtx[2][2] = 1.0f;
164 
165  td->ext = NULL;
166  td->val = NULL;
167 
168  td->flag |= TD_SELECTED;
169  td->dist = 0.0;
170 
171  unit_m3(td->mtx);
172  unit_m3(td->smtx);
173 
174  init_context->current.td++;
175  init_context->current.td2d++;
176  init_context->current.tdt++;
177 }
178 
180  const int framenr,
181  MovieTrackingTrack *track,
182  const float aspect[2])
183 {
184  MovieTrackingMarker *marker = BKE_tracking_marker_ensure(track, framenr);
185 
187  track,
188  marker,
190  track->offset,
191  marker->pos,
192  track->offset,
193  aspect);
194 
195  if (track->flag & SELECT) {
197  init_context, track, marker, TRACK_AREA_POINT, marker->pos, NULL, NULL, aspect);
198  }
199 
200  if (track->pat_flag & SELECT) {
201  int a;
202 
203  for (a = 0; a < 4; a++) {
205  track,
206  marker,
208  marker->pattern_corners[a],
209  marker->pos,
210  NULL,
211  aspect);
212  }
213  }
214 
215  if (track->search_flag & SELECT) {
217  track,
218  marker,
220  marker->search_min,
221  marker->pos,
222  NULL,
223  aspect);
224 
226  track,
227  marker,
229  marker->search_max,
230  marker->pos,
231  NULL,
232  aspect);
233  }
234 
235  if (init_context->current.td != NULL) {
236  marker->flag &= ~(MARKER_DISABLED | MARKER_TRACKED);
237  }
238 }
239 
241  const int framenr,
242  MovieTrackingTrack *track,
243  const float aspect[2])
244 {
245  if (!TRACK_VIEW_SELECTED(init_context->space_clip, track)) {
246  return;
247  }
248  if (track->flag & TRACK_LOCKED) {
249  return;
250  }
251  trackToTransData(init_context, framenr, track, aspect);
252 }
253 
255  MovieTrackingPlaneTrack *plane_track,
256  MovieTrackingPlaneMarker *plane_marker,
257  float corner[2],
258  const float aspect[2])
259 {
260  TransData *td = init_context->current.td;
261  TransData2D *td2d = init_context->current.td2d;
262  TransDataTracking *tdt = init_context->current.tdt;
263 
264  if (td == NULL) {
265  init_context->tc->data_len++;
266  return;
267  }
268 
269  tdt->flag = plane_marker->flag;
270  tdt->framenr = plane_marker->framenr;
272  tdt->plane_track = plane_track;
273 
274  td2d->loc[0] = corner[0] * aspect[0]; /* hold original location */
275  td2d->loc[1] = corner[1] * aspect[1];
276 
277  td2d->loc2d = corner; /* current location */
278  td2d->loc[2] = 0.0f;
279 
280  td->flag = 0;
281  td->loc = td2d->loc;
282  copy_v3_v3(td->iloc, td->loc);
283  copy_v3_v3(td->center, td->loc);
284 
285  memset(td->axismtx, 0, sizeof(td->axismtx));
286  td->axismtx[2][2] = 1.0f;
287 
288  td->ext = NULL;
289  td->val = NULL;
290 
291  td->flag |= TD_SELECTED;
292  td->dist = 0.0;
293 
294  unit_m3(td->mtx);
295  unit_m3(td->smtx);
296 
297  init_context->current.td++;
298  init_context->current.td2d++;
299  init_context->current.tdt++;
300 }
301 
303  const int framenr,
304  MovieTrackingPlaneTrack *plane_track,
305  const float aspect[2])
306 {
307  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_ensure(plane_track, framenr);
308 
309  for (int i = 0; i < 4; i++) {
311  init_context, plane_track, plane_marker, plane_marker->corners[i], aspect);
312  }
313 
314  if (init_context->current.td != NULL) {
315  plane_marker->flag &= ~PLANE_MARKER_TRACKED;
316  }
317 }
318 
320  const int framenr,
321  MovieTrackingPlaneTrack *plane_track,
322  const float aspect[2])
323 {
324  if (!PLANE_TRACK_VIEW_SELECTED(plane_track)) {
325  return;
326  }
327  planeTrackToTransData(init_context, framenr, plane_track, aspect);
328 }
329 
332  TransCustomData *custom_data)
333 {
334  if (custom_data->data) {
335  TransDataTracking *tdt = custom_data->data;
336  if (tdt->smarkers) {
337  MEM_freeN(tdt->smarkers);
338  }
339 
340  MEM_freeN(tdt);
341  custom_data->data = NULL;
342  }
343 }
344 
346 {
347  SpaceClip *space_clip = CTX_wm_space_clip(C);
348  MovieClip *clip = ED_space_clip_get_clip(space_clip);
349  const ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
350  const ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
351  const int framenr = ED_space_clip_get_clip_frame_number(space_clip);
352 
354 
356  init_context.space_clip = space_clip;
357  init_context.t = t;
358  init_context.tc = tc;
359 
360  /* Count required transformation data. */
361 
362  tc->data_len = 0;
363 
364  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
365  trackToTransDataIfNeeded(&init_context, framenr, track, t->aspect);
366  }
367 
368  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
369  planeTrackToTransDataIfNeeded(&init_context, framenr, plane_track, t->aspect);
370  }
371 
372  if (tc->data_len == 0) {
373  return;
374  }
375 
376  tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransTracking TransData");
377  tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D), "TransTracking TransData2D");
379  "TransTracking TransDataTracking");
381 
382  init_context.current.td = tc->data;
383  init_context.current.td2d = tc->data_2d;
384  init_context.current.tdt = tc->custom.type.data;
385 
386  /* Create actual transformation data. */
387 
388  LISTBASE_FOREACH (MovieTrackingTrack *, track, tracksbase) {
389  trackToTransDataIfNeeded(&init_context, framenr, track, t->aspect);
390  }
391 
392  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
393  planeTrackToTransDataIfNeeded(&init_context, framenr, plane_track, t->aspect);
394  }
395 }
396 
398  TransData2D *td2d,
399  TransDataTracking *tdt,
400  MovieTrackingTrack *track,
401  MovieTrackingMarker *marker,
402  MovieTrackingMarker *prev_marker,
403  short coord,
404  float size)
405 {
406  float frames_delta = (marker->framenr - prev_marker->framenr);
407 
408  tdt->flag = marker->flag;
409  marker->flag &= ~MARKER_TRACKED;
410 
412  tdt->coord = coord;
413  tdt->scale = 1.0f / size * frames_delta;
414  tdt->prev_pos = prev_marker->pos;
415  tdt->track = track;
416 
417  /* calculate values depending on marker's speed */
418  td2d->loc[0] = marker->framenr;
419  td2d->loc[1] = (marker->pos[coord] - prev_marker->pos[coord]) * size / frames_delta;
420  td2d->loc[2] = 0.0f;
421 
422  td2d->loc2d = marker->pos; /* current location */
423 
424  td->flag = 0;
425  td->loc = td2d->loc;
426  copy_v3_v3(td->center, td->loc);
427  copy_v3_v3(td->iloc, td->loc);
428 
429  memset(td->axismtx, 0, sizeof(td->axismtx));
430  td->axismtx[2][2] = 1.0f;
431 
432  td->ext = NULL;
433  td->val = NULL;
434 
435  td->flag |= TD_SELECTED;
436  td->dist = 0.0;
437 
438  unit_m3(td->mtx);
439  unit_m3(td->smtx);
440 }
441 
443 {
444  TransData *td;
445  TransData2D *td2d;
447  MovieClip *clip = ED_space_clip_get_clip(sc);
448  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
449  MovieTrackingTrack *track;
450  MovieTrackingMarker *marker, *prev_marker;
451  TransDataTracking *tdt;
452  int i, width, height;
453 
454  BKE_movieclip_get_size(clip, &sc->user, &width, &height);
455 
457 
458  /* count */
459  tc->data_len = 0;
460 
461  if ((sc->flag & SC_SHOW_GRAPH_TRACKS_MOTION) == 0) {
462  return;
463  }
464 
465  track = tracksbase->first;
466  while (track) {
467  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
468  for (i = 1; i < track->markersnr; i++) {
469  marker = &track->markers[i];
470  prev_marker = &track->markers[i - 1];
471 
472  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
473  continue;
474  }
475 
476  if (marker->flag & MARKER_GRAPH_SEL_X) {
477  tc->data_len += 1;
478  }
479 
480  if (marker->flag & MARKER_GRAPH_SEL_Y) {
481  tc->data_len += 1;
482  }
483  }
484  }
485 
486  track = track->next;
487  }
488 
489  if (tc->data_len == 0) {
490  return;
491  }
492 
493  td = tc->data = MEM_callocN(tc->data_len * sizeof(TransData), "TransTracking TransData");
494  td2d = tc->data_2d = MEM_callocN(tc->data_len * sizeof(TransData2D),
495  "TransTracking TransData2D");
496  tc->custom.type.data = tdt = MEM_callocN(tc->data_len * sizeof(TransDataTracking),
497  "TransTracking TransDataTracking");
499 
500  /* create actual data */
501  track = tracksbase->first;
502  while (track) {
503  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
504  for (i = 1; i < track->markersnr; i++) {
505  marker = &track->markers[i];
506  prev_marker = &track->markers[i - 1];
507 
508  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
509  continue;
510  }
511 
512  if (marker->flag & MARKER_GRAPH_SEL_X) {
514  td, td2d, tdt, track, marker, &track->markers[i - 1], 0, width);
515  td += 1;
516  td2d += 1;
517  tdt += 1;
518  }
519 
520  if (marker->flag & MARKER_GRAPH_SEL_Y) {
522  td, td2d, tdt, track, marker, &track->markers[i - 1], 1, height);
523 
524  td += 1;
525  td2d += 1;
526  tdt += 1;
527  }
528  }
529  }
530 
531  track = track->next;
532  }
533 }
534 
536 {
537  ARegion *region = CTX_wm_region(C);
539  MovieClip *clip = ED_space_clip_get_clip(sc);
540  int width, height;
541 
543 
544  tc->data_len = 0;
545 
546  if (!clip) {
547  return;
548  }
549 
550  BKE_movieclip_get_size(clip, &sc->user, &width, &height);
551 
552  if (width == 0 || height == 0) {
553  return;
554  }
555 
556  if (region->regiontype == RGN_TYPE_PREVIEW) {
557  /* transformation was called from graph editor */
559  }
560  else {
562  }
563 }
564 
567 /* -------------------------------------------------------------------- */
572 {
574  TransDataTracking *tdt_array = tc->custom.type.data;
575 
576  int i = 0;
577  while (i < tc->data_len) {
578  TransDataTracking *tdt = &tdt_array[i];
579 
580  if (tdt->mode == transDataTracking_ModeTracks) {
581  MovieTrackingTrack *track = tdt->track;
583 
584  BLI_assert(marker != NULL);
585 
586  marker->flag = tdt->flag;
587 
588  if (track->flag & SELECT) {
589  i++;
590  }
591 
592  if (track->pat_flag & SELECT) {
593  i += 4;
594  }
595 
596  if (track->search_flag & SELECT) {
597  i += 2;
598  }
599  }
600  else if (tdt->mode == transDataTracking_ModeCurves) {
601  MovieTrackingTrack *track = tdt->track;
602  MovieTrackingMarker *marker, *prev_marker;
603  int a;
604 
605  for (a = 1; a < track->markersnr; a++) {
606  marker = &track->markers[a];
607  prev_marker = &track->markers[a - 1];
608 
609  if ((marker->flag & MARKER_DISABLED) || (prev_marker->flag & MARKER_DISABLED)) {
610  continue;
611  }
612 
613  if (marker->flag & (MARKER_GRAPH_SEL_X | MARKER_GRAPH_SEL_Y)) {
614  marker->flag = tdt->flag;
615  }
616  }
617  }
618  else if (tdt->mode == transDataTracking_ModePlaneTracks) {
619  MovieTrackingPlaneTrack *plane_track = tdt->plane_track;
621  tdt->framenr);
622 
623  BLI_assert(plane_marker != NULL);
624 
625  plane_marker->flag = tdt->flag;
626  i += 3;
627  }
628 
629  i++;
630  }
631 }
632 
634 {
635  TransData *td;
636  TransData2D *td2d;
637  TransDataTracking *tdt;
638  int a;
639 
640  if (t->state == TRANS_CANCEL) {
642  }
643 
645 
646  /* flush to 2d vector from internally used 3d vector */
647  for (a = 0, td = tc->data, td2d = tc->data_2d, tdt = tc->custom.type.data; a < tc->data_len;
648  a++, td2d++, td++, tdt++) {
649  if (tdt->mode == transDataTracking_ModeTracks) {
650  float loc2d[2];
651 
652  if (t->mode == TFM_ROTATION && tdt->area == TRACK_AREA_SEARCH) {
653  continue;
654  }
655 
656  loc2d[0] = td2d->loc[0] / t->aspect[0];
657  loc2d[1] = td2d->loc[1] / t->aspect[1];
658 
659  if (t->flag & T_ALT_TRANSFORM) {
660  if (t->mode == TFM_RESIZE) {
661  if (tdt->area != TRACK_AREA_PAT) {
662  continue;
663  }
664  }
665  else if (t->mode == TFM_TRANSLATION) {
666  if (tdt->area == TRACK_AREA_POINT && tdt->relative) {
667  float d[2], d2[2];
668 
669  if (!tdt->smarkers) {
670  tdt->smarkers = MEM_callocN(sizeof(*tdt->smarkers) * tdt->markersnr,
671  "flushTransTracking markers");
672  for (a = 0; a < tdt->markersnr; a++) {
673  copy_v2_v2(tdt->smarkers[a], tdt->markers[a].pos);
674  }
675  }
676 
677  sub_v2_v2v2(d, loc2d, tdt->soffset);
678  sub_v2_v2(d, tdt->srelative);
679 
680  sub_v2_v2v2(d2, loc2d, tdt->srelative);
681 
682  for (a = 0; a < tdt->markersnr; a++) {
683  add_v2_v2v2(tdt->markers[a].pos, tdt->smarkers[a], d2);
684  }
685 
686  negate_v2_v2(td2d->loc2d, d);
687  }
688  }
689  }
690 
691  if (tdt->area != TRACK_AREA_POINT || tdt->relative == NULL) {
692  td2d->loc2d[0] = loc2d[0];
693  td2d->loc2d[1] = loc2d[1];
694 
695  if (tdt->relative) {
696  sub_v2_v2(td2d->loc2d, tdt->relative);
697  }
698  }
699  }
700  else if (tdt->mode == transDataTracking_ModeCurves) {
701  td2d->loc2d[tdt->coord] = tdt->prev_pos[tdt->coord] + td2d->loc[1] * tdt->scale;
702  }
703  else if (tdt->mode == transDataTracking_ModePlaneTracks) {
704  td2d->loc2d[0] = td2d->loc[0] / t->aspect[0];
705  td2d->loc2d[1] = td2d->loc[1] / t->aspect[1];
706  }
707  }
708 }
709 
710 /* helper for recalcData() - for Movie Clip transforms */
712 {
713  SpaceClip *sc = t->area->spacedata.first;
714 
716  MovieClip *clip = ED_space_clip_get_clip(sc);
717  ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking);
718  MovieTrackingTrack *track;
719  int framenr = ED_space_clip_get_clip_frame_number(sc);
720 
722 
723  track = tracksbase->first;
724  while (track) {
725  if (TRACK_VIEW_SELECTED(sc, track) && (track->flag & TRACK_LOCKED) == 0) {
726  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
727 
728  if (t->mode == TFM_TRANSLATION) {
729  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
731  }
734  }
735  }
736  else if (t->mode == TFM_RESIZE) {
737  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
739  }
742  }
743  }
744  else if (t->mode == TFM_ROTATION) {
745  if (TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) {
747  }
748  }
749  }
750 
751  track = track->next;
752  }
753 
754  DEG_id_tag_update(&clip->id, 0);
755  }
756 }
757 
760 /* -------------------------------------------------------------------- */
765 {
766  SpaceClip *sc = t->area->spacedata.first;
767  MovieClip *clip = ED_space_clip_get_clip(sc);
768  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
769  const int framenr = ED_space_clip_get_clip_frame_number(sc);
770  /* Update coordinates of modified plane tracks. */
771  LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) {
772  bool do_update = false;
773  if (plane_track->flag & PLANE_TRACK_HIDDEN) {
774  continue;
775  }
776  do_update |= PLANE_TRACK_VIEW_SELECTED(plane_track) != 0;
777  if (do_update == false) {
778  if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) {
779  int i;
780  for (i = 0; i < plane_track->point_tracksnr; i++) {
781  MovieTrackingTrack *track = plane_track->point_tracks[i];
782  if (TRACK_VIEW_SELECTED(sc, track)) {
783  do_update = true;
784  break;
785  }
786  }
787  }
788  }
789  if (do_update) {
790  BKE_tracking_track_plane_from_existing_motion(plane_track, framenr);
791  }
792  }
793  if (t->scene->nodetree != NULL) {
794  /* Tracks can be used for stabilization nodes,
795  * flush update for such nodes.
796  */
797  nodeUpdateID(t->scene->nodetree, &clip->id);
799  }
800 }
801 
typedef float(TangentPoint)[2]
struct SpaceClip * CTX_wm_space_clip(const bContext *C)
Definition: context.c:899
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user, int *width, int *height)
Definition: movieclip.c:1540
bool nodeUpdateID(struct bNodeTree *ntree, struct ID *id)
Definition: node.cc:4346
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_ensure(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:2058
#define CLAMP_SEARCH_POS
Definition: BKE_tracking.h:517
struct ListBase * BKE_tracking_get_active_tracks(struct MovieTracking *tracking)
Definition: tracking.c:365
#define PLANE_TRACK_VIEW_SELECTED(plane_track)
Definition: BKE_tracking.h:503
#define CLAMP_SEARCH_DIM
Definition: BKE_tracking.h:516
struct MovieTrackingMarker * BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1567
struct MovieTrackingMarker * BKE_tracking_marker_get_exact(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1556
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:377
#define TRACK_AREA_SEARCH
Definition: BKE_tracking.h:522
#define TRACK_AREA_PAT
Definition: BKE_tracking.h:521
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get_exact(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:2045
#define TRACK_AREA_POINT
Definition: BKE_tracking.h:520
#define CLAMP_PAT_POS
Definition: BKE_tracking.h:515
#define TRACK_VIEW_SELECTED(sc, track)
Definition: BKE_tracking.h:497
#define TRACK_AREA_SELECTED(track, area)
Definition: BKE_tracking.h:492
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1523
#define CLAMP_PAT_DIM
Definition: BKE_tracking.h:514
void BKE_tracking_marker_clamp(struct MovieTrackingMarker *marker, int event)
Definition: tracking.c:1455
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void unit_m3(float m[3][3])
Definition: math_matrix.c:58
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
@ TRACK_LOCKED
@ PLANE_MARKER_TRACKED
@ PLANE_TRACK_HIDDEN
@ PLANE_TRACK_AUTOKEY
@ MARKER_GRAPH_SEL_X
@ MARKER_GRAPH_SEL_Y
@ MARKER_TRACKED
@ MARKER_DISABLED
int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc)
Definition: clip_editor.c:227
bool ED_space_clip_check_show_trackedit(struct SpaceClip *sc)
Definition: clip_editor.c:548
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:572
@ TFM_RESIZE
Definition: ED_transform.h:48
@ TFM_ROTATION
Definition: ED_transform.h:47
@ TFM_TRANSLATION
Definition: ED_transform.h:46
_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 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 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:39
#define NC_SCENE
Definition: WM_types.h:279
#define ND_NODES
Definition: WM_types.h:336
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
#define SELECT
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static unsigned a[3]
Definition: RandGen.cpp:92
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)
short regiontype
void * first
Definition: DNA_listBase.h:47
struct MovieTracking tracking
MovieTrackingMarker * markers
struct MovieTrackingTrack * next
struct MovieClipUser user
TransCustomData type
Definition: transform.h:428
void(* free_cb)(struct TransInfo *, struct TransDataContainer *tc, struct TransCustomData *custom_data)
Definition: transform.h:405
float loc[3]
TransCustomDataContainer custom
Definition: transform.h:501
TransData * data
Definition: transform.h:448
TransData2D * data_2d
Definition: transform.h:452
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::@576 current
@ T_ALT_TRANSFORM
Definition: transform.h:140
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t)
Definition: transform.h:810
@ TRANS_CANCEL
Definition: transform.h:193
conversion and adaptation of different datablocks to a common struct.
static void cancelTransTracking(TransInfo *t)
void special_aftertrans_update__movieclip(bContext *C, TransInfo *t)
static void markerToTransCurveDataInit(TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track, MovieTrackingMarker *marker, MovieTrackingMarker *prev_marker, short coord, float size)
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
void recalcData_tracking(TransInfo *t)
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
void createTransTrackingData(bContext *C, TransInfo *t)
@ TD_INDIVIDUAL_SCALE
@ TD_SELECTED
void WM_event_add_notifier(const bContext *C, uint type, void *reference)