Blender  V2.93
clip_graph_ops.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) 2011 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "DNA_scene_types.h"
25 
26 #include "BLI_math.h"
27 #include "BLI_rect.h"
28 #include "BLI_utildefines.h"
29 
30 #include "BKE_context.h"
31 #include "BKE_tracking.h"
32 
33 #include "DEG_depsgraph.h"
34 
35 #include "WM_api.h"
36 #include "WM_types.h"
37 
38 #include "ED_clip.h"
39 #include "ED_screen.h"
40 #include "ED_select_utils.h"
41 
42 #include "RNA_access.h"
43 #include "RNA_define.h"
44 
45 #include "UI_view2d.h"
46 
47 #include "clip_intern.h" /* own include */
48 
49 /******************** common graph-editing utilities ********************/
50 
52 {
55 
56  return sc->view == SC_VIEW_GRAPH;
57  }
58 
59  return false;
60 }
61 
63 {
66 
68  }
69  return false;
70 }
71 
72 typedef struct {
73  int action;
75 
76 static void toggle_selection_cb(void *userdata, MovieTrackingMarker *marker)
77 {
78  SelectUserData *data = (SelectUserData *)userdata;
79 
80  switch (data->action) {
81  case SEL_SELECT:
82  marker->flag |= MARKER_GRAPH_SEL;
83  break;
84  case SEL_DESELECT:
85  marker->flag &= ~MARKER_GRAPH_SEL;
86  break;
87  case SEL_INVERT:
88  marker->flag ^= MARKER_GRAPH_SEL;
89  break;
90  }
91 }
92 
93 /******************** mouse select operator ********************/
94 
95 typedef struct {
98  bool has_prev; /* if there's valid coordinate of previous point of curve segment */
99 
100  float min_dist_sq; /* minimal distance between mouse and currently found entity */
101  float mouse_co[2]; /* mouse coordinate */
102  float prev_co[2]; /* coordinate of previous point of segment */
103  float min_co[2]; /* coordinate of entity with minimal distance */
104 
105  MovieTrackingTrack *track; /* nearest found track */
106  MovieTrackingMarker *marker; /* nearest found marker */
108 
109 static void find_nearest_tracking_segment_cb(void *userdata,
110  MovieTrackingTrack *track,
111  MovieTrackingMarker *UNUSED(marker),
112  eClipCurveValueSource value_source,
113  int scene_framenr,
114  float val)
115 {
116  MouseSelectUserData *data = userdata;
117  const float co[2] = {scene_framenr, val};
118 
119  if (!clip_graph_value_visible(data->sc, value_source)) {
120  return;
121  }
122 
123  if (data->has_prev) {
124  float dist_sq = dist_squared_to_line_segment_v2(data->mouse_co, data->prev_co, co);
125 
126  if (data->track == NULL || dist_sq < data->min_dist_sq) {
127  data->track = track;
128  data->min_dist_sq = dist_sq;
129  data->value_source = value_source;
130  copy_v2_v2(data->min_co, co);
131  }
132  }
133 
134  data->has_prev = true;
135  copy_v2_v2(data->prev_co, co);
136 }
137 
138 static void find_nearest_tracking_segment_end_cb(void *userdata,
139  eClipCurveValueSource UNUSED(source_value))
140 {
141  MouseSelectUserData *data = userdata;
142 
143  data->has_prev = false;
144 }
145 
146 static void find_nearest_tracking_knot_cb(void *userdata,
147  MovieTrackingTrack *track,
148  MovieTrackingMarker *marker,
149  eClipCurveValueSource value_source,
150  int scene_framenr,
151  float val)
152 {
153  MouseSelectUserData *data = userdata;
154  const float mdiff[2] = {scene_framenr - data->mouse_co[0], val - data->mouse_co[1]};
155  float dist_sq = len_squared_v2(mdiff);
156 
157  if (!clip_graph_value_visible(data->sc, value_source)) {
158  return;
159  }
160 
161  if (data->marker == NULL || dist_sq < data->min_dist_sq) {
162  const float co[2] = {scene_framenr, val};
163 
164  data->track = track;
165  data->marker = marker;
166  data->min_dist_sq = dist_sq;
167  data->value_source = value_source;
168  copy_v2_v2(data->min_co, co);
169  }
170 }
171 
172 static void mouse_select_init_data(bContext *C, MouseSelectUserData *userdata, const float co[2])
173 {
175  memset(userdata, 0, sizeof(MouseSelectUserData));
176  userdata->sc = sc;
177  userdata->min_dist_sq = FLT_MAX;
178  copy_v2_v2(userdata->mouse_co, co);
179 }
180 
181 static bool mouse_select_knot(bContext *C, const float co[2], bool extend)
182 {
184  MovieClip *clip = ED_space_clip_get_clip(sc);
185  ARegion *region = CTX_wm_region(C);
186  View2D *v2d = &region->v2d;
187  MovieTracking *tracking = &clip->tracking;
188  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
189  static const int delta = 6;
190 
191  if (act_track) {
192  MouseSelectUserData userdata;
193 
194  mouse_select_init_data(C, &userdata, co);
196  sc, act_track, &userdata, find_nearest_tracking_knot_cb, NULL, NULL);
197 
198  if (userdata.marker) {
199  int x1, y1, x2, y2;
200 
201  if (UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1) &&
202  UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2) &&
203  (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta)) {
204  if (!extend) {
205  SelectUserData selectdata = {SEL_DESELECT};
206 
208  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
209  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
210  &selectdata,
212  }
213 
214  if (userdata.value_source == CLIP_VALUE_SOURCE_SPEED_X) {
215  if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_X) != 0) {
216  userdata.marker->flag &= ~MARKER_GRAPH_SEL_X;
217  }
218  else {
219  userdata.marker->flag |= MARKER_GRAPH_SEL_X;
220  }
221  }
222  else if (userdata.value_source == CLIP_VALUE_SOURCE_SPEED_Y) {
223  if (extend && (userdata.marker->flag & MARKER_GRAPH_SEL_Y) != 0) {
224  userdata.marker->flag &= ~MARKER_GRAPH_SEL_Y;
225  }
226  else {
227  userdata.marker->flag |= MARKER_GRAPH_SEL_Y;
228  }
229  }
230 
231  return true;
232  }
233  }
234  }
235 
236  return false;
237 }
238 
239 static bool mouse_select_curve(bContext *C, const float co[2], bool extend)
240 {
242  MovieClip *clip = ED_space_clip_get_clip(sc);
243  MovieTracking *tracking = &clip->tracking;
244  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
245  MouseSelectUserData userdata;
246 
247  mouse_select_init_data(C, &userdata, co);
249  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
250  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
251  &userdata,
253  NULL,
255 
256  if (userdata.track) {
257  if (extend) {
258  if (act_track == userdata.track) {
259  /* currently only single curve can be selected
260  * (selected curve represents active track) */
261  act_track = NULL;
262  }
263  }
264  else if (act_track != userdata.track) {
265  SelectUserData selectdata = {SEL_DESELECT};
267 
268  tracking->act_track = userdata.track;
269  if ((sc->flag & SC_SHOW_GRAPH_SEL_ONLY) == 0) {
270  ListBase *tracksbase = BKE_tracking_object_get_tracks(tracking, object);
271  BKE_tracking_track_select(tracksbase, userdata.track, TRACK_AREA_ALL, false);
272  }
273 
274  /* deselect all knots on newly selected curve */
276  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
277  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
278  &selectdata,
280  }
281 
282  return true;
283  }
284 
285  return false;
286 }
287 
288 static int mouse_select(bContext *C, float co[2], bool extend)
289 {
290  bool sel = false;
291 
292  /* first try to select knot on selected curves */
293  sel = mouse_select_knot(C, co, extend);
294 
295  if (!sel) {
296  /* if there's no close enough knot to mouse position, select nearest curve */
297  sel = mouse_select_curve(C, co, extend);
298  }
299 
300  if (sel) {
302  }
303 
304  return OPERATOR_FINISHED;
305 }
306 
307 static int select_exec(bContext *C, wmOperator *op)
308 {
309  float co[2];
310  bool extend = RNA_boolean_get(op->ptr, "extend");
311 
312  RNA_float_get_array(op->ptr, "location", co);
313 
314  return mouse_select(C, co, extend);
315 }
316 
317 static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
318 {
319  ARegion *region = CTX_wm_region(C);
320  float co[2];
321 
322  UI_view2d_region_to_view(&region->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
323  RNA_float_set_array(op->ptr, "location", co);
324 
325  return select_exec(C, op);
326 }
327 
329 {
330  /* identifiers */
331  ot->name = "Select";
332  ot->description = "Select graph curves";
333  ot->idname = "CLIP_OT_graph_select";
334 
335  /* api callbacks */
336  ot->exec = select_exec;
339 
340  /* flags */
341  ot->flag = OPTYPE_UNDO;
342 
343  /* properties */
345  "location",
346  2,
347  NULL,
348  -FLT_MAX,
349  FLT_MAX,
350  "Location",
351  "Mouse location to select nearest entity",
352  -100.0f,
353  100.0f);
355  "extend",
356  0,
357  "Extend",
358  "Extend selection rather than clearing the existing selection");
359 }
360 
361 /********************** box select operator *********************/
362 
363 typedef struct BoxSelectuserData {
367 
368 static void box_select_cb(void *userdata,
369  MovieTrackingTrack *UNUSED(track),
370  MovieTrackingMarker *marker,
371  eClipCurveValueSource value_source,
372  int scene_framenr,
373  float val)
374 {
377  return;
378  }
379 
380  if (BLI_rctf_isect_pt(&data->rect, scene_framenr, val)) {
381  int flag = 0;
382 
383  if (value_source == CLIP_VALUE_SOURCE_SPEED_X) {
384  flag = MARKER_GRAPH_SEL_X;
385  }
386  else {
387  flag = MARKER_GRAPH_SEL_Y;
388  }
389 
390  if (data->select) {
391  marker->flag |= flag;
392  }
393  else {
394  marker->flag &= ~flag;
395  }
396  data->changed = true;
397  }
398  else if (!data->extend) {
399  marker->flag &= ~MARKER_GRAPH_SEL;
400  }
401 }
402 
404 {
406  ARegion *region = CTX_wm_region(C);
407 
408  MovieClip *clip = ED_space_clip_get_clip(sc);
409  MovieTracking *tracking = &clip->tracking;
410  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
411  BoxSelectuserData userdata;
412  rctf rect;
413 
414  if (act_track == NULL) {
415  return OPERATOR_CANCELLED;
416  }
417 
418  /* get rectangle from operator */
420  UI_view2d_region_to_view_rctf(&region->v2d, &rect, &userdata.rect);
421 
422  userdata.changed = false;
423  userdata.select = !RNA_boolean_get(op->ptr, "deselect");
424  userdata.extend = RNA_boolean_get(op->ptr, "extend");
425 
427 
428  if (userdata.changed) {
430 
431  return OPERATOR_FINISHED;
432  }
433 
434  return OPERATOR_CANCELLED;
435 }
436 
438 {
439  /* identifiers */
440  ot->name = "Box Select";
441  ot->description = "Select curve points using box selection";
442  ot->idname = "CLIP_OT_graph_select_box";
443 
444  /* api callbacks */
449 
450  /* flags */
451  ot->flag = OPTYPE_UNDO;
452 
453  /* properties */
455 }
456 
457 /********************** select all operator *********************/
458 
460 {
462  MovieClip *clip = ED_space_clip_get_clip(sc);
463  MovieTracking *tracking = &clip->tracking;
464  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
465  MovieTrackingMarker *marker;
466  int action = RNA_enum_get(op->ptr, "action");
467  int a;
468 
469  if (!act_track) {
470  return OPERATOR_CANCELLED;
471  }
472 
473  if (action == SEL_TOGGLE) {
474  action = SEL_SELECT;
475 
476  for (a = 0; a < act_track->markersnr; a++) {
477  marker = &act_track->markers[a];
478 
479  if (marker->flag & MARKER_GRAPH_SEL) {
480  action = SEL_DESELECT;
481  break;
482  }
483  }
484  }
485 
486  for (a = 0; a < act_track->markersnr; a++) {
487  marker = &act_track->markers[a];
488 
489  switch (action) {
490  case SEL_SELECT:
491  marker->flag |= MARKER_GRAPH_SEL;
492  break;
493  case SEL_DESELECT:
494  marker->flag &= ~MARKER_GRAPH_SEL;
495  break;
496  case SEL_INVERT:
497  marker->flag ^= MARKER_GRAPH_SEL;
498  break;
499  }
500  }
501 
503 
504  return OPERATOR_FINISHED;
505 }
506 
508 {
509  /* identifiers */
510  ot->name = "(De)select All Markers";
511  ot->description = "Change selection of all markers of active track";
512  ot->idname = "CLIP_OT_graph_select_all_markers";
513 
514  /* api callbacks */
517 
518  /* flags */
520 
522 }
523 
524 /******************** delete curve operator ********************/
525 
527 {
529  MovieClip *clip = ED_space_clip_get_clip(sc);
530  MovieTracking *tracking = &clip->tracking;
531  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
532 
533  if (!act_track) {
534  return OPERATOR_CANCELLED;
535  }
536 
537  clip_delete_track(C, clip, act_track);
538 
539  return OPERATOR_FINISHED;
540 }
541 
543 {
544  /* identifiers */
545  ot->name = "Delete Curve";
546  ot->description = "Delete track corresponding to the selected curve";
547  ot->idname = "CLIP_OT_graph_delete_curve";
548 
549  /* api callbacks */
553 
554  /* flags */
556 }
557 
558 /******************** delete knot operator ********************/
559 
561 {
563  MovieClip *clip = ED_space_clip_get_clip(sc);
564  MovieTracking *tracking = &clip->tracking;
565  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
566 
567  if (act_track) {
568  int a = 0;
569 
570  while (a < act_track->markersnr) {
571  MovieTrackingMarker *marker = &act_track->markers[a];
572 
573  if (marker->flag & MARKER_GRAPH_SEL) {
574  clip_delete_marker(C, clip, act_track, marker);
575  }
576  else {
577  a++;
578  }
579  }
580  }
581 
582  return OPERATOR_FINISHED;
583 }
584 
586 {
587  /* identifiers */
588  ot->name = "Delete Knot";
589  ot->description = "Delete curve knots";
590  ot->idname = "CLIP_OT_graph_delete_knot";
591 
592  /* api callbacks */
595 
596  /* flags */
598 }
599 
600 /******************** view all operator ********************/
601 
602 typedef struct {
603  float min, max;
605 
606 static void view_all_cb(void *userdata,
607  MovieTrackingTrack *UNUSED(track),
608  MovieTrackingMarker *UNUSED(marker),
609  eClipCurveValueSource UNUSED(value_source),
610  int UNUSED(scene_framenr),
611  float val)
612 {
613  ViewAllUserData *data = (ViewAllUserData *)userdata;
614 
615  if (val < data->min) {
616  data->min = val;
617  }
618 
619  if (val > data->max) {
620  data->max = val;
621  }
622 }
623 
625 {
627  ARegion *region = CTX_wm_region(C);
629  View2D *v2d = &region->v2d;
630  ViewAllUserData userdata;
631  float extra;
632 
633  userdata.max = -FLT_MAX;
634  userdata.min = FLT_MAX;
635 
637  (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0,
638  (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0,
639  &userdata,
640  view_all_cb,
641  NULL,
642  NULL);
643 
644  /* set extents of view to start/end frames */
645  v2d->cur.xmin = (float)SFRA;
646  v2d->cur.xmax = (float)EFRA;
647 
648  if (userdata.min < userdata.max) {
649  v2d->cur.ymin = userdata.min;
650  v2d->cur.ymax = userdata.max;
651  }
652  else {
653  v2d->cur.ymin = -10;
654  v2d->cur.ymax = 10;
655  }
656 
657  /* we need an extra "buffer" factor on either side so that the endpoints are visible */
658  extra = 0.01f * BLI_rctf_size_x(&v2d->cur);
659  v2d->cur.xmin -= extra;
660  v2d->cur.xmax += extra;
661 
662  extra = 0.01f * BLI_rctf_size_y(&v2d->cur);
663  v2d->cur.ymin -= extra;
664  v2d->cur.ymax += extra;
665 
666  ED_region_tag_redraw(region);
667 
668  return OPERATOR_FINISHED;
669 }
670 
672 {
673  /* identifiers */
674  ot->name = "Frame All";
675  ot->description = "View all curves in editor";
676  ot->idname = "CLIP_OT_graph_view_all";
677 
678  /* api callbacks */
679  ot->exec = view_all_exec;
681 }
682 
683 /******************** jump to current frame operator ********************/
684 
686 {
687  View2D *v2d = &region->v2d;
688  float extra = BLI_rctf_size_x(&v2d->cur) / 2.0f;
689 
690  /* set extents of view to start/end frames */
691  v2d->cur.xmin = (float)CFRA - extra;
692  v2d->cur.xmax = (float)CFRA + extra;
693 }
694 
696 {
698  ARegion *region = CTX_wm_region(C);
699 
701 
702  ED_region_tag_redraw(region);
703 
704  return OPERATOR_FINISHED;
705 }
706 
708 {
709  /* identifiers */
710  ot->name = "Center Current Frame";
711  ot->description = "Scroll view so current frame would be centered";
712  ot->idname = "CLIP_OT_graph_center_current_frame";
713 
714  /* api callbacks */
717 }
718 
719 /********************** disable markers operator *********************/
720 
722 {
724  MovieClip *clip = ED_space_clip_get_clip(sc);
725  MovieTracking *tracking = &clip->tracking;
726  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
727  MovieTrackingMarker *marker;
728  int action = RNA_enum_get(op->ptr, "action");
729  int a;
730 
731  if (!act_track || (act_track->flag & TRACK_LOCKED)) {
732  return OPERATOR_CANCELLED;
733  }
734 
735  for (a = 0; a < act_track->markersnr; a++) {
736  marker = &act_track->markers[a];
737 
738  if (marker->flag & MARKER_GRAPH_SEL) {
739  if (action == 0) {
740  marker->flag |= MARKER_DISABLED;
741  }
742  else if (action == 1) {
743  marker->flag &= ~MARKER_DISABLED;
744  }
745  else {
746  marker->flag ^= MARKER_DISABLED;
747  }
748  }
749  }
750 
751  DEG_id_tag_update(&clip->id, 0);
752 
754 
755  return OPERATOR_FINISHED;
756 }
757 
759 {
760  static const EnumPropertyItem actions_items[] = {
761  {0, "DISABLE", 0, "Disable", "Disable selected markers"},
762  {1, "ENABLE", 0, "Enable", "Enable selected markers"},
763  {2, "TOGGLE", 0, "Toggle", "Toggle disabled flag for selected markers"},
764  {0, NULL, 0, NULL, NULL},
765  };
766 
767  /* identifiers */
768  ot->name = "Disable Markers";
769  ot->description = "Disable/enable selected markers";
770  ot->idname = "CLIP_OT_graph_disable_markers";
771 
772  /* api callbacks */
775 
776  /* flags */
778 
779  /* properties */
780  RNA_def_enum(ot->srna, "action", actions_items, 0, "Action", "Disable action to execute");
781 }
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
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
#define TRACK_AREA_ALL
Definition: BKE_tracking.h:524
struct MovieTrackingTrack * BKE_tracking_track_get_active(struct MovieTracking *tracking)
Definition: tracking.c:1170
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend)
Definition: tracking.c:1340
struct ListBase * BKE_tracking_object_get_tracks(struct MovieTracking *tracking, struct MovieTrackingObject *object)
Definition: tracking.c:2218
struct MovieTrackingObject * BKE_tracking_object_get_active(struct MovieTracking *tracking)
Definition: tracking.c:2198
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
Definition: math_geom.c:338
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, const float x, const float y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:161
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:165
#define UNUSED(x)
#define ELEM(...)
void DEG_id_tag_update(struct ID *id, int flag)
#define CFRA
#define SFRA
#define EFRA
@ SC_VIEW_GRAPH
@ SC_SHOW_GRAPH_HIDDEN
@ SC_SHOW_GRAPH_SEL_ONLY
@ SC_SHOW_GRAPH_TRACKS_MOTION
@ SC_SHOW_GRAPH_TRACKS_ERROR
@ TRACK_LOCKED
@ MARKER_GRAPH_SEL_X
@ MARKER_GRAPH_SEL_Y
@ MARKER_DISABLED
@ MARKER_GRAPH_SEL
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
bool ED_space_clip_tracking_poll(struct bContext *C)
Definition: clip_editor.c:98
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:572
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:667
@ 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
#define C
Definition: RandGen.cpp:39
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()
#define NC_GEOM
Definition: WM_types.h:294
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define NA_EVALUATED
Definition: WM_types.h:463
#define NC_MOVIECLIP
Definition: WM_types.h:298
#define ND_SELECT
Definition: WM_types.h:407
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:253
void clip_delete_marker(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track, struct MovieTrackingMarker *marker)
Definition: clip_utils.c:366
void clip_delete_track(struct bContext *C, struct MovieClip *clip, struct MovieTrackingTrack *track)
Definition: clip_utils.c:327
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:267
bool clip_graph_value_visible(struct SpaceClip *sc, eClipCurveValueSource value_source)
Definition: clip_utils.c:58
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:118
@ CLIP_VALUE_SOURCE_SPEED_Y
Definition: clip_intern.h:120
@ CLIP_VALUE_SOURCE_SPEED_X
Definition: clip_intern.h:119
Scene scene
static unsigned a[3]
Definition: RandGen.cpp:92
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:6378
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
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:3851
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:3771
#define min(a, b)
Definition: sort.c:51
eClipCurveValueSource value_source
MovieTrackingTrack * track
MovieTrackingMarker * marker
struct MovieTracking tracking
MovieTrackingMarker * markers
MovieTrackingTrack * act_track
float xmax
Definition: DNA_vec_types.h:85
float xmin
Definition: DNA_vec_types.h:85
float ymax
Definition: DNA_vec_types.h:86
float ymin
Definition: DNA_vec_types.h:86
int mval[2]
Definition: WM_types.h:583
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
struct PointerRNA * ptr
__forceinline const avxi abs(const avxi &a)
Definition: util_avxi.h:186
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3156
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))