Blender  V3.3
clip_graph_ops.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 "BLI_math.h"
11 #include "BLI_rect.h"
12 #include "BLI_utildefines.h"
13 
14 #include "BKE_context.h"
15 #include "BKE_tracking.h"
16 
17 #include "DEG_depsgraph.h"
18 
19 #include "WM_api.h"
20 #include "WM_types.h"
21 
22 #include "ED_clip.h"
23 #include "ED_screen.h"
24 #include "ED_select_utils.h"
25 
26 #include "RNA_access.h"
27 #include "RNA_define.h"
28 
29 #include "UI_view2d.h"
30 
31 #include "clip_intern.h" /* own include */
32 
33 /******************** common graph-editing utilities ********************/
34 
36 {
39 
40  return sc->view == SC_VIEW_GRAPH;
41  }
42 
43  return false;
44 }
45 
47 {
50 
52  }
53  return false;
54 }
55 
56 typedef struct {
57  int action;
59 
60 static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
61 {
62  SelectUserData *data = (SelectUserData *)userdata;
63 
64  switch (data->action) {
65  case SEL_SELECT:
66  marker->flag |= MARKER_GRAPH_SEL;
67  break;
68  case SEL_DESELECT:
69  marker->flag &= ~MARKER_GRAPH_SEL;
70  break;
71  case SEL_INVERT:
72  marker->flag ^= MARKER_GRAPH_SEL;
73  break;
74  }
75 }
76 
77 /******************** mouse select operator ********************/
78 
79 typedef struct {
82  bool has_prev; /* if there's valid coordinate of previous point of curve segment */
83 
84  float min_dist_sq; /* minimal distance between mouse and currently found entity */
85  float mouse_co[2]; /* mouse coordinate */
86  float prev_co[2]; /* coordinate of previous point of segment */
87  float min_co[2]; /* coordinate of entity with minimal distance */
88 
89  MovieTrackingTrack *track; /* nearest found track */
90  MovieTrackingMarker *marker; /* nearest found marker */
92 
93 static void find_nearest_tracking_segment_cb(void *userdata,
94  MovieTrackingTrack *track,
95  MovieTrackingMarker *UNUSED(marker),
96  eClipCurveValueSource value_source,
97  int scene_framenr,
98  float val)
99 {
100  MouseSelectUserData *data = userdata;
101  const float co[2] = {scene_framenr, val};
102 
103  if (!clip_graph_value_visible(data->sc, value_source)) {
104  return;
105  }
106 
107  if (data->has_prev) {
108  float dist_sq = dist_squared_to_line_segment_v2(data->mouse_co, data->prev_co, co);
109 
110  if (data->track == NULL || dist_sq < data->min_dist_sq) {
111  data->track = track;
112  data->min_dist_sq = dist_sq;
113  data->value_source = value_source;
114  copy_v2_v2(data->min_co, co);
115  }
116  }
117 
118  data->has_prev = true;
119  copy_v2_v2(data->prev_co, co);
120 }
121 
122 static void find_nearest_tracking_segment_end_cb(void *userdata,
123  eClipCurveValueSource UNUSED(source_value))
124 {
125  MouseSelectUserData *data = userdata;
126 
127  data->has_prev = false;
128 }
129 
130 static void find_nearest_tracking_knot_cb(void *userdata,
131  MovieTrackingTrack *track,
132  MovieTrackingMarker *marker,
133  eClipCurveValueSource value_source,
134  int scene_framenr,
135  float val)
136 {
137  MouseSelectUserData *data = userdata;
138  const float mdiff[2] = {scene_framenr - data->mouse_co[0], val - data->mouse_co[1]};
139  float dist_sq = len_squared_v2(mdiff);
140 
141  if (!clip_graph_value_visible(data->sc, value_source)) {
142  return;
143  }
144 
145  if (data->marker == NULL || dist_sq < data->min_dist_sq) {
146  const float co[2] = {scene_framenr, val};
147 
148  data->track = track;
149  data->marker = marker;
150  data->min_dist_sq = dist_sq;
151  data->value_source = value_source;
152  copy_v2_v2(data->min_co, co);
153  }
154 }
155 
156 static void mouse_select_init_data(bContext *C, MouseSelectUserData *userdata, const float co[2])
157 {
159  memset(userdata, 0, sizeof(MouseSelectUserData));
160  userdata->sc = sc;
161  userdata->min_dist_sq = FLT_MAX;
162  copy_v2_v2(userdata->mouse_co, co);
163 }
164 
165 static bool mouse_select_knot(bContext *C, const float co[2], bool extend)
166 {
168  MovieClip *clip = ED_space_clip_get_clip(sc);
169  ARegion *region = CTX_wm_region(C);
170  View2D *v2d = &region->v2d;
171  MovieTracking *tracking = &clip->tracking;
172  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
173  static const int delta = 6;
174 
175  if (act_track) {
176  MouseSelectUserData userdata;
177 
178  mouse_select_init_data(C, &userdata, co);
180  sc, act_track, &userdata, find_nearest_tracking_knot_cb, NULL, NULL);
181 
182  if (userdata.marker) {
183  int x1, y1, x2, y2;
184 
185  if (UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1) &&
186  UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2) &&
187  (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta)) {
188  if (!extend) {
189  SelectUserData selectdata = {SEL_DESELECT};
190 
192  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
193  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
194  &selectdata,
196  }
197 
198  if (userdata.value_source == CLIP_VALUE_SOURCE_SPEED_X) {
199  if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_X) != 0) {
200  userdata.marker->flag &= ~MARKER_GRAPH_SEL_X;
201  }
202  else {
203  userdata.marker->flag |= MARKER_GRAPH_SEL_X;
204  }
205  }
206  else if (userdata.value_source == CLIP_VALUE_SOURCE_SPEED_Y) {
207  if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_Y) != 0) {
208  userdata.marker->flag &= ~MARKER_GRAPH_SEL_Y;
209  }
210  else {
211  userdata.marker->flag |= MARKER_GRAPH_SEL_Y;
212  }
213  }
214 
215  return true;
216  }
217  }
218  }
219 
220  return false;
221 }
222 
223 static bool mouse_select_curve(bContext *C, const float co[2], bool extend)
224 {
226  MovieClip *clip = ED_space_clip_get_clip(sc);
227  MovieTracking *tracking = &clip->tracking;
228  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
229  MouseSelectUserData userdata;
230 
231  mouse_select_init_data(C, &userdata, co);
233  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
234  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
235  &userdata,
237  NULL,
239 
240  if (userdata.track) {
241  if (extend) {
242  if (act_track == userdata.track) {
243  /* currently only single curve can be selected
244  * (selected curve represents active track) */
245  act_track = NULL;
246  }
247  }
248  else if (act_track != userdata.track) {
249  SelectUserData selectdata = {SEL_DESELECT};
251 
252  tracking->act_track = userdata.track;
253  if ((sc->flag & SC_SHOW_GRAPH_SEL_ONLY) == 0) {
254  ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
255  BKE_tracking_track_select(tracksbase, userdata.track, TRACK_AREA_ALL, false);
256  }
257 
258  /* deselect all knots on newly selected curve */
260  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
261  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
262  &selectdata,
264  }
265 
266  return true;
267  }
268 
269  return false;
270 }
271 
272 static int mouse_select(bContext *C, float co[2], bool extend)
273 {
274  bool sel = false;
275 
276  /* first try to select knot on selected curves */
277  sel = mouse_select_knot(C, co, extend);
278 
279  if (!sel) {
280  /* if there's no close enough knot to mouse position, select nearest curve */
281  sel = mouse_select_curve(C, co, extend);
282  }
283 
284  if (sel) {
286  }
287 
288  return OPERATOR_FINISHED;
289 }
290 
291 static int select_exec(bContext *C, wmOperator *op)
292 {
293  float co[2];
294  bool extend = RNA_boolean_get(op->ptr, "extend");
295 
296  RNA_float_get_array(op->ptr, "location", co);
297 
298  return mouse_select(C, co, extend);
299 }
300 
301 static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
302 {
303  ARegion *region = CTX_wm_region(C);
304  float co[2];
305 
306  UI_view2d_region_to_view(&region->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
307  RNA_float_set_array(op->ptr, "location", co);
308 
309  return select_exec(C, op);
310 }
311 
313 {
314  PropertyRNA *prop;
315 
316  /* identifiers */
317  ot->name = "Select";
318  ot->description = "Select graph curves";
319  ot->idname = "CLIP_OT_graph_select";
320 
321  /* api callbacks */
322  ot->exec = select_exec;
325 
326  /* flags */
327  ot->flag = OPTYPE_UNDO;
328 
329  /* properties */
331  "location",
332  2,
333  NULL,
334  -FLT_MAX,
335  FLT_MAX,
336  "Location",
337  "Mouse location to select nearest entity",
338  -100.0f,
339  100.0f);
340  prop = RNA_def_boolean(ot->srna,
341  "extend",
342  0,
343  "Extend",
344  "Extend selection rather than clearing the existing selection");
346 }
347 
348 /********************** box select operator *********************/
349 
350 typedef struct BoxSelectuserData {
354 
355 static void box_select_cb(void *userdata,
356  MovieTrackingTrack *UNUSED(track),
357  MovieTrackingMarker *marker,
358  eClipCurveValueSource value_source,
359  int scene_framenr,
360  float val)
361 {
364  return;
365  }
366 
367  if (BLI_rctf_isect_pt(&data->rect, scene_framenr, val)) {
368  int flag = 0;
369 
370  if (value_source == CLIP_VALUE_SOURCE_SPEED_X) {
371  flag = MARKER_GRAPH_SEL_X;
372  }
373  else {
374  flag = MARKER_GRAPH_SEL_Y;
375  }
376 
377  if (data->select) {
378  marker->flag |= flag;
379  }
380  else {
381  marker->flag &= ~flag;
382  }
383  data->changed = true;
384  }
385  else if (!data->extend) {
386  marker->flag &= ~MARKER_GRAPH_SEL;
387  }
388 }
389 
391 {
393  ARegion *region = CTX_wm_region(C);
394 
395  MovieClip *clip = ED_space_clip_get_clip(sc);
396  MovieTracking *tracking = &clip->tracking;
397  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
398  BoxSelectuserData userdata;
399  rctf rect;
400 
401  if (act_track == NULL) {
402  return OPERATOR_CANCELLED;
403  }
404 
405  /* get rectangle from operator */
407  UI_view2d_region_to_view_rctf(&region->v2d, &rect, &userdata.rect);
408 
409  userdata.changed = false;
410  userdata.select = !RNA_boolean_get(op->ptr, "deselect");
411  userdata.extend = RNA_boolean_get(op->ptr, "extend");
412 
414 
415  if (userdata.changed) {
417 
418  return OPERATOR_FINISHED;
419  }
420 
421  return OPERATOR_CANCELLED;
422 }
423 
425 {
426  /* identifiers */
427  ot->name = "Box Select";
428  ot->description = "Select curve points using box selection";
429  ot->idname = "CLIP_OT_graph_select_box";
430 
431  /* api callbacks */
436 
437  /* flags */
438  ot->flag = OPTYPE_UNDO;
439 
440  /* properties */
442 }
443 
444 /********************** select all operator *********************/
445 
447 {
449  MovieClip *clip = ED_space_clip_get_clip(sc);
450  MovieTracking *tracking = &clip->tracking;
451  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
452  MovieTrackingMarker *marker;
453  int action = RNA_enum_get(op->ptr, "action");
454  int a;
455 
456  if (!act_track) {
457  return OPERATOR_CANCELLED;
458  }
459 
460  if (action == SEL_TOGGLE) {
461  action = SEL_SELECT;
462 
463  for (a = 0; a < act_track->markersnr; a++) {
464  marker = &act_track->markers[a];
465 
466  if (marker->flag & MARKER_GRAPH_SEL) {
467  action = SEL_DESELECT;
468  break;
469  }
470  }
471  }
472 
473  for (a = 0; a < act_track->markersnr; a++) {
474  marker = &act_track->markers[a];
475 
476  switch (action) {
477  case SEL_SELECT:
478  marker->flag |= MARKER_GRAPH_SEL;
479  break;
480  case SEL_DESELECT:
481  marker->flag &= ~MARKER_GRAPH_SEL;
482  break;
483  case SEL_INVERT:
484  marker->flag ^= MARKER_GRAPH_SEL;
485  break;
486  }
487  }
488 
490 
491  return OPERATOR_FINISHED;
492 }
493 
495 {
496  /* identifiers */
497  ot->name = "(De)select All Markers";
498  ot->description = "Change selection of all markers of active track";
499  ot->idname = "CLIP_OT_graph_select_all_markers";
500 
501  /* api callbacks */
504 
505  /* flags */
507 
509 }
510 
511 /******************** delete curve operator ********************/
512 
514 {
516  MovieClip *clip = ED_space_clip_get_clip(sc);
517  MovieTracking *tracking = &clip->tracking;
518  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
519 
520  if (!act_track) {
521  return OPERATOR_CANCELLED;
522  }
523 
524  clip_delete_track(C, clip, act_track);
525 
526  return OPERATOR_FINISHED;
527 }
528 
530 {
531  /* identifiers */
532  ot->name = "Delete Curve";
533  ot->description = "Delete track corresponding to the selected curve";
534  ot->idname = "CLIP_OT_graph_delete_curve";
535 
536  /* api callbacks */
540 
541  /* flags */
543 }
544 
545 /******************** delete knot operator ********************/
546 
548 {
550  MovieClip *clip = ED_space_clip_get_clip(sc);
551  MovieTracking *tracking = &clip->tracking;
552  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
553 
554  if (act_track) {
555  int a = 0;
556 
557  while (a < act_track->markersnr) {
558  MovieTrackingMarker *marker = &act_track->markers[a];
559 
560  if (marker->flag & MARKER_GRAPH_SEL) {
561  clip_delete_marker(C, clip, act_track, marker);
562  }
563  else {
564  a++;
565  }
566  }
567  }
568 
569  return OPERATOR_FINISHED;
570 }
571 
573 {
574  /* identifiers */
575  ot->name = "Delete Knot";
576  ot->description = "Delete curve knots";
577  ot->idname = "CLIP_OT_graph_delete_knot";
578 
579  /* api callbacks */
582 
583  /* flags */
585 }
586 
587 /******************** view all operator ********************/
588 
589 typedef struct {
590  float min, max;
592 
593 static void view_all_cb(void *userdata,
594  MovieTrackingTrack *UNUSED(track),
595  MovieTrackingMarker *UNUSED(marker),
596  eClipCurveValueSource UNUSED(value_source),
597  int UNUSED(scene_framenr),
598  float val)
599 {
600  ViewAllUserData *data = (ViewAllUserData *)userdata;
601 
602  if (val < data->min) {
603  data->min = val;
604  }
605 
606  if (val > data->max) {
607  data->max = val;
608  }
609 }
610 
612 {
614  ARegion *region = CTX_wm_region(C);
616  View2D *v2d = &region->v2d;
617  ViewAllUserData userdata;
618  float extra;
619 
620  userdata.max = -FLT_MAX;
621  userdata.min = FLT_MAX;
622 
624  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
625  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
626  &userdata,
627  view_all_cb,
628  NULL,
629  NULL);
630 
631  /* set extents of view to start/end frames */
632  v2d->cur.xmin = (float)scene->r.sfra;
633  v2d->cur.xmax = (float)scene->r.efra;
634 
635  if (userdata.min < userdata.max) {
636  v2d->cur.ymin = userdata.min;
637  v2d->cur.ymax = userdata.max;
638  }
639  else {
640  v2d->cur.ymin = -10;
641  v2d->cur.ymax = 10;
642  }
643 
644  /* we need an extra "buffer" factor on either side so that the endpoints are visible */
645  extra = 0.01f * BLI_rctf_size_x(&v2d->cur);
646  v2d->cur.xmin -= extra;
647  v2d->cur.xmax += extra;
648 
649  extra = 0.01f * BLI_rctf_size_y(&v2d->cur);
650  v2d->cur.ymin -= extra;
651  v2d->cur.ymax += extra;
652 
653  ED_region_tag_redraw(region);
654 
655  return OPERATOR_FINISHED;
656 }
657 
659 {
660  /* identifiers */
661  ot->name = "Frame All";
662  ot->description = "View all curves in editor";
663  ot->idname = "CLIP_OT_graph_view_all";
664 
665  /* api callbacks */
666  ot->exec = view_all_exec;
668 }
669 
670 /******************** jump to current frame operator ********************/
671 
673 {
674  View2D *v2d = &region->v2d;
675  float extra = BLI_rctf_size_x(&v2d->cur) / 2.0f;
676 
677  /* set extents of view to start/end frames */
678  v2d->cur.xmin = (float)scene->r.cfra - extra;
679  v2d->cur.xmax = (float)scene->r.cfra + extra;
680 }
681 
683 {
685  ARegion *region = CTX_wm_region(C);
686 
688 
689  ED_region_tag_redraw(region);
690 
691  return OPERATOR_FINISHED;
692 }
693 
695 {
696  /* identifiers */
697  ot->name = "Center Current Frame";
698  ot->description = "Scroll view so current frame would be centered";
699  ot->idname = "CLIP_OT_graph_center_current_frame";
700 
701  /* api callbacks */
704 }
705 
706 /********************** disable markers operator *********************/
707 
709 {
711  MovieClip *clip = ED_space_clip_get_clip(sc);
712  MovieTracking *tracking = &clip->tracking;
713  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
714  MovieTrackingMarker *marker;
715  int action = RNA_enum_get(op->ptr, "action");
716  int a;
717 
718  if (!act_track || (act_track->flag & TRACK_LOCKED)) {
719  return OPERATOR_CANCELLED;
720  }
721 
722  for (a = 0; a < act_track->markersnr; a++) {
723  marker = &act_track->markers[a];
724 
725  if (marker->flag & MARKER_GRAPH_SEL) {
726  if (action == 0) {
727  marker->flag |= MARKER_DISABLED;
728  }
729  else if (action == 1) {
730  marker->flag &= ~MARKER_DISABLED;
731  }
732  else {
733  marker->flag ^= MARKER_DISABLED;
734  }
735  }
736  }
737 
738  DEG_id_tag_update(&clip->id, 0);
739 
741 
742  return OPERATOR_FINISHED;
743 }
744 
746 {
747  static const EnumPropertyItem actions_items[] = {
748  {0, "DISABLE", 0, "Disable", "Disable selected markers"},
749  {1, "ENABLE", 0, "Enable", "Enable selected markers"},
750  {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
751  {0, NULL, 0, NULL, NULL},
752  };
753 
754  /* identifiers */
755  ot->name = "Disable Markers";
756  ot->description = "Disable/enable selected markers";
757  ot->idname = "CLIP_OT_graph_disable_markers";
758 
759  /* api callbacks */
762 
763  /* flags */
765 
766  /* properties */
767  RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Disable action to execute");
768 }
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
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
@ TRACK_AREA_ALL
Definition: BKE_tracking.h:43
struct MovieTrackingTrack * BKE_tracking_track_get_active(struct MovieTracking *tracking)
Definition: tracking.c:1089
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend)
Definition: tracking.c:1257
struct ListBase * BKE_tracking_object_get_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object)
Definition: tracking.c:2112
struct MovieTrackingObject * BKE_tracking_object_get_active(struct MovieTracking *tracking)
Definition: tracking.c:2092
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
Definition: math_geom.c:283
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
bool BLI_rctf_isect_pt(const struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
#define UNUSED(x)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
@ SC_VIEW_GRAPH
@ SC_SHOW_GRAPH_HIDDEN
@ SC_SHOW_GRAPH_SEL_ONLY
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ SC_SHOW_GRAPH_TRACKS_ERROR
@ MARKER_GRAPH_SEL_X
@ MARKER_GRAPH_SEL_Y
@ MARKER_DISABLED
@ MARKER_GRAPH_SEL
@ TRACK_LOCKED
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
bool ED_space_clip_tracking_poll(struct bContext *C)
Definition: clip_editor.c:83
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:570
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
@ SEL_SELECT
@ SEL_INVERT
@ SEL_DESELECT
@ SEL_TOGGLE
_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 y1
_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 x2
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
#define C
Definition: RandGen.cpp:25
void UI_view2d_region_to_view_rctf(const struct View2D *v2d, const struct rctf *rect_src, struct rctf *rect_dst) ATTR_NONNULL()
bool UI_view2d_view_to_region_clip(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_GEOM
Definition: WM_types.h:343
#define NA_EVALUATED
Definition: WM_types.h:524
#define NC_MOVIECLIP
Definition: WM_types.h:347
#define ND_SELECT
Definition: WM_types.h:455
static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int select_exec(bContext *C, wmOperator *op)
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
static int delete_curve_exec(bContext *C, wmOperator *UNUSED(op))
static void find_nearest_tracking_segment_cb(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *UNUSED(marker), eClipCurveValueSource value_source, int scene_framenr, float val)
static bool mouse_select_curve(bContext *C, const float co[2], bool extend)
static bool mouse_select_knot(bContext *C, const float co[2], bool extend)
static void find_nearest_tracking_knot_cb(void *userdata, MovieTrackingTrack *track, MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val)
static int delete_knot_exec(bContext *C, wmOperator *UNUSED(op))
static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
static bool ED_space_clip_graph_poll(bContext *C)
void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
static int box_select_graph_exec(bContext *C, wmOperator *op)
static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
static int mouse_select(bContext *C, float co[2], bool extend)
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
static void box_select_cb(void *userdata, MovieTrackingTrack *UNUSED(track), MovieTrackingMarker *marker, eClipCurveValueSource value_source, int scene_framenr, float val)
static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
static void view_all_cb(void *userdata, MovieTrackingTrack *UNUSED(track), MovieTrackingMarker *UNUSED(marker), eClipCurveValueSource UNUSED(value_source), int UNUSED(scene_framenr), float val)
void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
static int graph_disable_markers_exec(bContext *C, wmOperator *op)
void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
void CLIP_OT_graph_select(wmOperatorType *ot)
static void find_nearest_tracking_segment_end_cb(void *userdata, eClipCurveValueSource UNUSED(source_value))
static int graph_select_all_markers_exec(bContext *C, wmOperator *op)
void CLIP_OT_graph_select_box(wmOperatorType *ot)
static void mouse_select_init_data(bContext *C, MouseSelectUserData *userdata, const float co[2])
static bool clip_graph_knots_poll(bContext *C)
void CLIP_OT_graph_view_all(wmOperatorType *ot)
void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
struct BoxSelectuserData BoxSelectuserData
void clip_graph_tracking_values_iterate_track(struct SpaceClip *sc, struct MovieTrackingTrack *track, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:237
void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker)
Definition: clip_utils.c:350
void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track)
Definition: clip_utils.c:311
void clip_graph_tracking_values_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, ClipTrackValueCallback func, ClipTrackValueSegmentStartCallback segment_start, ClipTrackValueSegmentEndCallback segment_end)
Definition: clip_utils.c:251
bool clip_graph_value_visible(struct SpaceClip *sc, eClipCurveValueSource value_source)
Definition: clip_utils.c:42
void clip_graph_tracking_iterate(struct SpaceClip *sc, bool selected_only, bool include_hidden, void *userdata, void(*func)(void *userdata, struct MovieTrackingMarker *marker))
eClipCurveValueSource
Definition: clip_intern.h:114
@ CLIP_VALUE_SOURCE_SPEED_Y
Definition: clip_intern.h:116
@ CLIP_VALUE_SOURCE_SPEED_X
Definition: clip_intern.h:115
Scene scene
static unsigned a[3]
Definition: RandGen.cpp:78
T abs(const T &a)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:4980
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:4992
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3862
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
#define min(a, b)
Definition: sort.c:35
eClipCurveValueSource value_source
MovieTrackingTrack * track
MovieTrackingMarker * marker
struct MovieTracking tracking
MovieTrackingMarker * markers
MovieTrackingTrack * act_track
struct RenderData r
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
int mval[2]
Definition: WM_types.h:684
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3479
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_gesture_box_select(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect)
int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))