Blender  V3.3
tracking_select.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 "MEM_guardedalloc.h"
9 
10 #include "DNA_movieclip_types.h"
11 #include "DNA_scene_types.h"
12 
13 #include "BLI_lasso_2d.h"
14 #include "BLI_math.h"
15 #include "BLI_rect.h"
16 #include "BLI_utildefines.h"
17 
18 #include "BKE_context.h"
19 #include "BKE_tracking.h"
20 
21 #include "WM_api.h"
22 #include "WM_types.h"
23 
24 #include "ED_clip.h"
25 #include "ED_mask.h"
26 #include "ED_screen.h"
27 #include "ED_select_utils.h"
28 
29 #include "RNA_access.h"
30 #include "RNA_define.h"
31 
32 #include "UI_view2d.h"
33 
34 #include "DEG_depsgraph.h"
35 
36 #include "clip_intern.h" /* own include */
37 #include "tracking_ops_intern.h" /* own include */
38 
39 static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2]);
40 
41 /********************** mouse select operator *********************/
42 
43 static int mouse_on_side(
44  const float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy)
45 {
46  if (x1 > x2) {
47  SWAP(float, x1, x2);
48  }
49 
50  if (y1 > y2) {
51  SWAP(float, y1, y2);
52  }
53 
54  return (co[0] >= x1 - epsx && co[0] <= x2 + epsx) && (co[1] >= y1 - epsy && co[1] <= y2 + epsy);
55 }
56 
57 static int mouse_on_rect(const float co[2],
58  const float pos[2],
59  const float min[2],
60  const float max[2],
61  float epsx,
62  float epsy)
63 {
64  return mouse_on_side(
65  co, pos[0] + min[0], pos[1] + min[1], pos[0] + max[0], pos[1] + min[1], epsx, epsy) ||
67  co, pos[0] + min[0], pos[1] + min[1], pos[0] + min[0], pos[1] + max[1], epsx, epsy) ||
69  co, pos[0] + min[0], pos[1] + max[1], pos[0] + max[0], pos[1] + max[1], epsx, epsy) ||
71  co, pos[0] + max[0], pos[1] + min[1], pos[0] + max[0], pos[1] + max[1], epsx, epsy);
72 }
73 
74 static int mouse_on_crns(
75  const float co[2], const float pos[2], const float crns[4][2], float epsx, float epsy)
76 {
77  float dist = dist_to_crns(co, pos, crns);
78 
79  return dist < max_ff(epsx, epsy);
80 }
81 
82 static int track_mouse_area(const bContext *C, const float co[2], MovieTrackingTrack *track)
83 {
85  int framenr = ED_space_clip_get_clip_frame_number(sc);
86  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
87  float pat_min[2], pat_max[2];
88  float epsx, epsy;
89  int width, height;
90 
92 
93  BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
94 
95  epsx = min_ffff(pat_min[0] - marker->search_min[0],
96  marker->search_max[0] - pat_max[0],
97  fabsf(pat_min[0]),
98  fabsf(pat_max[0])) /
99  2;
100  epsy = min_ffff(pat_min[1] - marker->search_min[1],
101  marker->search_max[1] - pat_max[1],
102  fabsf(pat_min[1]),
103  fabsf(pat_max[1])) /
104  2;
105 
106  epsx = max_ff(epsx, 2.0f / width);
107  epsy = max_ff(epsy, 2.0f / height);
108 
109  if (sc->flag & SC_SHOW_MARKER_SEARCH) {
110  if (mouse_on_rect(co, marker->pos, marker->search_min, marker->search_max, epsx, epsy)) {
111  return TRACK_AREA_SEARCH;
112  }
113  }
114 
115  if ((marker->flag & MARKER_DISABLED) == 0) {
116  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
117  if (mouse_on_crns(co, marker->pos, marker->pattern_corners, epsx, epsy)) {
118  return TRACK_AREA_PAT;
119  }
120  }
121 
122  epsx = 12.0f / width;
123  epsy = 12.0f / height;
124 
125  if (fabsf(co[0] - marker->pos[0] - track->offset[0]) < epsx &&
126  fabsf(co[1] - marker->pos[1] - track->offset[1]) <= epsy) {
127  return TRACK_AREA_POINT;
128  }
129  }
130 
131  return TRACK_AREA_NONE;
132 }
133 
134 static float dist_to_rect(const float co[2],
135  const float pos[2],
136  const float min[2],
137  const float max[2])
138 {
139  float d1, d2, d3, d4;
140  const float p[2] = {co[0] - pos[0], co[1] - pos[1]};
141  const float v1[2] = {min[0], min[1]}, v2[2] = {max[0], min[1]};
142  const float v3[2] = {max[0], max[1]}, v4[2] = {min[0], max[1]};
143 
145  d2 = dist_squared_to_line_segment_v2(p, v2, v3);
146  d3 = dist_squared_to_line_segment_v2(p, v3, v4);
147  d4 = dist_squared_to_line_segment_v2(p, v4, v1);
148 
149  return sqrtf(min_ffff(d1, d2, d3, d4));
150 }
151 
152 /* Distance to quad defined by its corners, corners are relative to pos */
153 static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2])
154 {
155  float d1, d2, d3, d4;
156  const float p[2] = {co[0] - pos[0], co[1] - pos[1]};
157  const float *v1 = crns[0], *v2 = crns[1];
158  const float *v3 = crns[2], *v4 = crns[3];
159 
161  d2 = dist_squared_to_line_segment_v2(p, v2, v3);
162  d3 = dist_squared_to_line_segment_v2(p, v3, v4);
163  d4 = dist_squared_to_line_segment_v2(p, v4, v1);
164 
165  return sqrtf(min_ffff(d1, d2, d3, d4));
166 }
167 
168 /* Same as above, but all the coordinates are absolute */
169 static float dist_to_crns_abs(const float co[2], const float corners[4][2])
170 {
171  float d1, d2, d3, d4;
172  const float *v1 = corners[0], *v2 = corners[1];
173  const float *v3 = corners[2], *v4 = corners[3];
174 
176  d2 = dist_squared_to_line_segment_v2(co, v2, v3);
177  d3 = dist_squared_to_line_segment_v2(co, v3, v4);
178  d4 = dist_squared_to_line_segment_v2(co, v4, v1);
179 
180  return sqrtf(min_ffff(d1, d2, d3, d4));
181 }
182 
184  ListBase *tracksbase,
185  const float co[2],
186  float *r_distance)
187 {
188  MovieTrackingTrack *track = NULL, *cur;
189  float mindist = 0.0f;
190  int framenr = ED_space_clip_get_clip_frame_number(sc);
191 
192  cur = tracksbase->first;
193  while (cur) {
194  MovieTrackingMarker *marker = BKE_tracking_marker_get(cur, framenr);
195 
196  if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, cur, marker)) {
197  float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
198 
199  /* distance to marker point */
200  d1 = sqrtf(
201  (co[0] - marker->pos[0] - cur->offset[0]) * (co[0] - marker->pos[0] - cur->offset[0]) +
202  (co[1] - marker->pos[1] - cur->offset[1]) * (co[1] - marker->pos[1] - cur->offset[1]));
203 
204  /* distance to pattern boundbox */
205  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
206  d2 = dist_to_crns(co, marker->pos, marker->pattern_corners);
207  }
208 
209  /* distance to search boundbox */
210  if (sc->flag & SC_SHOW_MARKER_SEARCH && TRACK_VIEW_SELECTED(sc, cur)) {
211  d3 = dist_to_rect(co, marker->pos, marker->search_min, marker->search_max);
212  }
213 
214  /* choose minimal distance. useful for cases of overlapped markers. */
215  dist = min_fff(d1, d2, d3);
216 
217  if (track == NULL || dist < mindist) {
218  track = cur;
219  mindist = dist;
220  }
221  }
222 
223  cur = cur->next;
224  }
225 
226  *r_distance = mindist;
227 
228  return track;
229 }
230 
232  ListBase *plane_tracks_base,
233  const float co[2],
234  float *r_distance)
235 {
236  MovieTrackingPlaneTrack *plane_track = NULL, *current_plane_track;
237  float min_distance = 0.0f;
238  int framenr = ED_space_clip_get_clip_frame_number(sc);
239 
240  for (current_plane_track = plane_tracks_base->first; current_plane_track;
241  current_plane_track = current_plane_track->next) {
242  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(current_plane_track,
243  framenr);
244 
245  if ((current_plane_track->flag & TRACK_HIDDEN) == 0) {
246  float distance = dist_to_crns_abs(co, plane_marker->corners);
247  if (plane_track == NULL || distance < min_distance) {
248  plane_track = current_plane_track;
249  min_distance = distance;
250  }
251  }
252  }
253 
254  *r_distance = min_distance;
255 
256  return plane_track;
257 }
258 
260 {
261  MovieTrackingTrack *track;
262  for (track = tracks_base->first; track != NULL; track = track->next) {
264  }
265 }
266 
268 {
269  MovieTrackingPlaneTrack *plane_track;
270  for (plane_track = plane_tracks_base->first; plane_track != NULL;
271  plane_track = plane_track->next) {
272  plane_track->flag &= ~SELECT;
273  }
274 }
275 
276 static bool select_poll(bContext *C)
277 {
279 
280  if (sc) {
281  return sc->clip && sc->view == SC_VIEW_CLIP;
282  }
283 
284  return false;
285 }
286 
287 static int select_exec(bContext *C, wmOperator *op)
288 {
290  MovieClip *clip = ED_space_clip_get_clip(sc);
291  MovieTracking *tracking = &clip->tracking;
292  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
293  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
294  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
295  const bool extend = RNA_boolean_get(op->ptr, "extend");
296  const bool deselect_all = RNA_boolean_get(op->ptr, "deselect_all");
297 
298  float co[2];
299  RNA_float_get_array(op->ptr, "location", co);
300 
301  /* Special code which allows to slide a marker which belongs to currently selected but not yet
302  * active track. If such track is found activate it and return pass-though so that marker slide
303  * operator can be used immediately after.
304  * This logic makes it convenient to slide markers when left mouse selection is used. */
305  if (!extend) {
307  if (track != NULL) {
308  MovieClip *clip_iter = ED_space_clip_get_clip(sc);
309 
310  clip_iter->tracking.act_track = track;
311 
313  DEG_id_tag_update(&clip_iter->id, ID_RECALC_SELECT);
314 
315  return OPERATOR_PASS_THROUGH;
316  }
317  }
318 
319  float distance_to_track, distance_to_plane_track;
320 
321  MovieTrackingTrack *track = find_nearest_track(sc, tracksbase, co, &distance_to_track);
323  sc, plane_tracks_base, co, &distance_to_plane_track);
324 
325  ClipViewLockState lock_state;
326  ED_clip_view_lock_state_store(C, &lock_state);
327 
328  /* Do not select beyond some reasonable distance, that is useless and
329  * prevents the 'deselect on nothing' behavior. */
330  if (distance_to_track > 0.05f) {
331  track = NULL;
332  }
333  if (distance_to_plane_track > 0.05f) {
334  plane_track = NULL;
335  }
336 
337  /* Between track and plane we choose closest to the mouse for selection here. */
338  if (track && plane_track) {
339  if (distance_to_track < distance_to_plane_track) {
340  plane_track = NULL;
341  }
342  else {
343  track = NULL;
344  }
345  }
346 
347  if (track) {
348  if (!extend) {
349  ed_tracking_deselect_all_plane_tracks(plane_tracks_base);
350  }
351 
352  int area = track_mouse_area(C, co, track);
353 
354  if (!extend || !TRACK_VIEW_SELECTED(sc, track)) {
356  }
357 
358  if (extend && TRACK_AREA_SELECTED(track, area)) {
359  if (track == act_track) {
361  }
362  else {
363  clip->tracking.act_track = track;
364  clip->tracking.act_plane_track = NULL;
365  }
366  }
367  else {
368  if (area == TRACK_AREA_POINT) {
370  }
371 
372  BKE_tracking_track_select(tracksbase, track, area, extend);
373  clip->tracking.act_track = track;
374  clip->tracking.act_plane_track = NULL;
375  }
376  }
377  else if (plane_track) {
378  if (!extend) {
380  }
381 
382  if (PLANE_TRACK_VIEW_SELECTED(plane_track)) {
383  if (extend) {
384  plane_track->flag &= ~SELECT;
385  }
386  }
387  else {
388  plane_track->flag |= SELECT;
389  }
390 
391  clip->tracking.act_track = NULL;
392  clip->tracking.act_plane_track = plane_track;
393  }
394  else if (deselect_all) {
396  ed_tracking_deselect_all_plane_tracks(plane_tracks_base);
397  }
398 
400 
402 
405 
406  /* Pass-through + finished to allow tweak to transform. */
408 }
409 
410 static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
411 {
413  ARegion *region = CTX_wm_region(C);
414 
415  float co[2];
416  ED_clip_mouse_pos(sc, region, event->mval, co);
417  RNA_float_set_array(op->ptr, "location", co);
418 
419  return select_exec(C, op);
420 }
421 
423 {
424  /* identifiers */
425  ot->name = "Select";
426  ot->description = "Select tracking markers";
427  ot->idname = "CLIP_OT_select";
428 
429  /* api callbacks */
430  ot->exec = select_exec;
432  ot->poll = select_poll;
433 
434  /* flags */
435  ot->flag = OPTYPE_UNDO;
436 
437  /* properties */
438  PropertyRNA *prop;
439  prop = RNA_def_boolean(ot->srna,
440  "extend",
441  0,
442  "Extend",
443  "Extend selection rather than clearing the existing selection");
445  prop = RNA_def_boolean(ot->srna,
446  "deselect_all",
447  false,
448  "Deselect On Nothing",
449  "Deselect all when nothing under the cursor");
451 
453  ot->srna,
454  "location",
455  2,
456  NULL,
457  -FLT_MAX,
458  FLT_MAX,
459  "Location",
460  "Mouse location in normalized coordinates, 0.0 to 1.0 is within the image bounds",
461  -100.0f,
462  100.0f);
463 }
464 
466 {
467  /* To avoid conflicts with mask select deselect all in empty space. */
468  return select_poll(C);
469 }
470 
471 /********************** box select operator *********************/
472 
474 {
476  ARegion *region = CTX_wm_region(C);
477 
478  MovieClip *clip = ED_space_clip_get_clip(sc);
479  MovieTracking *tracking = &clip->tracking;
480  MovieTrackingTrack *track;
481  MovieTrackingPlaneTrack *plane_track;
482  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
483  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
484  rcti rect;
485  rctf rectf;
486  bool changed = false;
487  int framenr = ED_space_clip_get_clip_frame_number(sc);
488 
489  /* get rectangle from operator */
491 
492  ED_clip_point_stable_pos(sc, region, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
493  ED_clip_point_stable_pos(sc, region, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
494 
495  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
496  const bool select = (sel_op != SEL_OP_SUB);
497  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
499  changed = true;
500  }
501 
502  /* do actual selection */
503  track = tracksbase->first;
504  while (track) {
505  if ((track->flag & TRACK_HIDDEN) == 0) {
506  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
507 
508  if (MARKER_VISIBLE(sc, track, marker)) {
509  if (BLI_rctf_isect_pt_v(&rectf, marker->pos)) {
510  if (select) {
512  }
513  else {
515  }
516  }
517  changed = true;
518  }
519  }
520 
521  track = track->next;
522  }
523 
524  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
525  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
526  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
527 
528  for (int i = 0; i < 4; i++) {
529  if (BLI_rctf_isect_pt_v(&rectf, plane_marker->corners[i])) {
530  if (select) {
531  plane_track->flag |= SELECT;
532  }
533  else {
534  plane_track->flag &= ~SELECT;
535  }
536  }
537  }
538  changed = true;
539  }
540  }
541 
542  if (changed) {
544 
547 
548  return OPERATOR_FINISHED;
549  }
550 
551  return OPERATOR_CANCELLED;
552 }
553 
555 {
556  /* identifiers */
557  ot->name = "Box Select";
558  ot->description = "Select markers using box selection";
559  ot->idname = "CLIP_OT_select_box";
560 
561  /* api callbacks */
566 
567  /* flags */
568  ot->flag = OPTYPE_UNDO;
569 
570  /* properties */
573 }
574 
575 /********************** lasso select operator *********************/
576 
578  const int mcoords[][2],
579  const int mcoords_len,
580  bool select)
581 {
583  ARegion *region = CTX_wm_region(C);
584 
585  MovieClip *clip = ED_space_clip_get_clip(sc);
586  MovieTracking *tracking = &clip->tracking;
587  MovieTrackingTrack *track;
588  MovieTrackingPlaneTrack *plane_track;
589  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
590  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
591  rcti rect;
592  bool changed = false;
593  int framenr = ED_space_clip_get_clip_frame_number(sc);
594 
595  /* get rectangle from operator */
596  BLI_lasso_boundbox(&rect, mcoords, mcoords_len);
597 
598  /* do actual selection */
599  track = tracksbase->first;
600  while (track) {
601  if ((track->flag & TRACK_HIDDEN) == 0) {
602  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
603 
604  if (MARKER_VISIBLE(sc, track, marker)) {
605  float screen_co[2];
606 
607  /* marker in screen coords */
608  ED_clip_point_stable_pos__reverse(sc, region, marker->pos, screen_co);
609 
610  if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
612  mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) {
613  if (select) {
615  }
616  else {
618  }
619  }
620 
621  changed = true;
622  }
623  }
624 
625  track = track->next;
626  }
627 
628  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
629  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
630  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
631 
632  for (int i = 0; i < 4; i++) {
633  float screen_co[2];
634 
635  /* marker in screen coords */
636  ED_clip_point_stable_pos__reverse(sc, region, plane_marker->corners[i], screen_co);
637 
638  if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) &&
640  mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) {
641  if (select) {
642  plane_track->flag |= SELECT;
643  }
644  else {
645  plane_track->flag &= ~SELECT;
646  }
647  }
648  }
649 
650  changed = true;
651  }
652  }
653 
654  if (changed) {
656 
659  }
660 
661  return changed;
662 }
663 
665 {
666  int mcoords_len;
667  const int(*mcoords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcoords_len);
668 
669  if (mcoords) {
670  const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
671  const bool select = (sel_op != SEL_OP_SUB);
672  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
675  }
676 
677  do_lasso_select_marker(C, mcoords, mcoords_len, select);
678 
679  MEM_freeN((void *)mcoords);
680 
681  return OPERATOR_FINISHED;
682  }
683  return OPERATOR_PASS_THROUGH;
684 }
685 
687 {
688  /* identifiers */
689  ot->name = "Lasso Select";
690  ot->description = "Select markers using lasso selection";
691  ot->idname = "CLIP_OT_select_lasso";
692 
693  /* api callbacks */
699 
700  /* flags */
702 
703  /* properties */
706 }
707 
708 /********************** circle select operator *********************/
709 
710 static int point_inside_ellipse(const float point[2],
711  const float offset[2],
712  const float ellipse[2])
713 {
714  /* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
715  float x, y;
716 
717  x = (point[0] - offset[0]) * ellipse[0];
718  y = (point[1] - offset[1]) * ellipse[1];
719 
720  return x * x + y * y < 1.0f;
721 }
722 
724  const float offset[2],
725  const float ellipse[2])
726 {
727  return point_inside_ellipse(marker->pos, offset, ellipse);
728 }
729 
731 {
733  ARegion *region = CTX_wm_region(C);
734 
735  MovieClip *clip = ED_space_clip_get_clip(sc);
736  MovieTracking *tracking = &clip->tracking;
737  MovieTrackingTrack *track;
738  MovieTrackingPlaneTrack *plane_track;
739  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
740  ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking);
741  int width, height;
742  bool changed = false;
743  float zoomx, zoomy, offset[2], ellipse[2];
744  int framenr = ED_space_clip_get_clip_frame_number(sc);
745 
746  /* get operator properties */
747  const int x = RNA_int_get(op->ptr, "x");
748  const int y = RNA_int_get(op->ptr, "y");
749  const int radius = RNA_int_get(op->ptr, "radius");
750 
751  const eSelectOp sel_op = ED_select_op_modal(RNA_enum_get(op->ptr, "mode"),
753  const bool select = (sel_op != SEL_OP_SUB);
754  if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
756  changed = true;
757  }
758 
759  /* compute ellipse and position in unified coordinates */
761  ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
762 
763  ellipse[0] = width * zoomx / radius;
764  ellipse[1] = height * zoomy / radius;
765 
766  ED_clip_point_stable_pos(sc, region, x, y, &offset[0], &offset[1]);
767 
768  /* do selection */
769  track = tracksbase->first;
770  while (track) {
771  if ((track->flag & TRACK_HIDDEN) == 0) {
772  MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
773 
774  if (MARKER_VISIBLE(sc, track, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
775  if (select) {
777  }
778  else {
780  }
781  changed = true;
782  }
783  }
784 
785  track = track->next;
786  }
787 
788  for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
789  if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) {
790  MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr);
791 
792  for (int i = 0; i < 4; i++) {
793  if (point_inside_ellipse(plane_marker->corners[i], offset, ellipse)) {
794  if (select) {
795  plane_track->flag |= SELECT;
796  }
797  else {
798  plane_track->flag &= ~SELECT;
799  }
800  }
801  }
802 
803  changed = true;
804  }
805  }
806 
807  if (changed) {
809 
812 
813  return OPERATOR_FINISHED;
814  }
815 
816  return OPERATOR_CANCELLED;
817 }
818 
820 {
821  /* identifiers */
822  ot->name = "Circle Select";
823  ot->description = "Select markers using circle selection";
824  ot->idname = "CLIP_OT_select_circle";
825 
826  /* api callbacks */
832 
833  /* flags */
835 
836  /* properties */
839 }
840 
841 /********************** select all operator *********************/
842 
844 {
846  MovieClip *clip = ED_space_clip_get_clip(sc);
847  MovieTracking *tracking = &clip->tracking;
848 
849  const int action = RNA_enum_get(op->ptr, "action");
850 
851  ClipViewLockState lock_state;
852  ED_clip_view_lock_state_store(C, &lock_state);
853 
854  bool has_selection = false;
855  ED_clip_select_all(sc, action, &has_selection);
856 
857  if (has_selection) {
859  }
860 
862 
865 
866  return OPERATOR_FINISHED;
867 }
868 
870 {
871  /* identifiers */
872  ot->name = "(De)select All";
873  ot->description = "Change selection of all tracking markers";
874  ot->idname = "CLIP_OT_select_all";
875 
876  /* api callbacks */
879 
880  /* flags */
882 
884 }
885 
886 /********************** select grouped operator *********************/
887 
889 {
891  MovieClip *clip = ED_space_clip_get_clip(sc);
892  MovieTrackingTrack *track;
893  MovieTrackingMarker *marker;
894  MovieTracking *tracking = &clip->tracking;
895  ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking);
896  int group = RNA_enum_get(op->ptr, "group");
897  int framenr = ED_space_clip_get_clip_frame_number(sc);
898 
899  track = tracksbase->first;
900  while (track) {
901  bool ok = false;
902 
903  marker = BKE_tracking_marker_get(track, framenr);
904 
905  if (group == 0) { /* Keyframed */
906  ok = marker->framenr == framenr && (marker->flag & MARKER_TRACKED) == 0;
907  }
908  else if (group == 1) { /* Estimated */
909  ok = marker->framenr != framenr;
910  }
911  else if (group == 2) { /* tracked */
912  ok = marker->framenr == framenr && (marker->flag & MARKER_TRACKED);
913  }
914  else if (group == 3) { /* locked */
915  ok = track->flag & TRACK_LOCKED;
916  }
917  else if (group == 4) { /* disabled */
918  ok = marker->flag & MARKER_DISABLED;
919  }
920  else if (group == 5) { /* color */
921  MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking);
922 
923  if (act_track) {
924  ok = (track->flag & TRACK_CUSTOMCOLOR) == (act_track->flag & TRACK_CUSTOMCOLOR);
925 
926  if (ok && track->flag & TRACK_CUSTOMCOLOR) {
927  ok = equals_v3v3(track->color, act_track->color);
928  }
929  }
930  }
931  else if (group == 6) { /* failed */
932  ok = (track->flag & TRACK_HAS_BUNDLE) == 0;
933  }
934 
935  if (ok) {
936  track->flag |= SELECT;
937  if (sc->flag & SC_SHOW_MARKER_PATTERN) {
938  track->pat_flag |= SELECT;
939  }
940  if (sc->flag & SC_SHOW_MARKER_SEARCH) {
941  track->search_flag |= SELECT;
942  }
943  }
944 
945  track = track->next;
946  }
947 
949 
952 
953  return OPERATOR_FINISHED;
954 }
955 
957 {
958  static const EnumPropertyItem select_group_items[] = {
959  {0, "KEYFRAMED", 0, "Keyframed Tracks", "Select all keyframed tracks"},
960  {1, "ESTIMATED", 0, "Estimated Tracks", "Select all estimated tracks"},
961  {2, "TRACKED", 0, "Tracked Tracks", "Select all tracked tracks"},
962  {3, "LOCKED", 0, "Locked Tracks", "Select all locked tracks"},
963  {4, "DISABLED", 0, "Disabled Tracks", "Select all disabled tracks"},
964  {5,
965  "COLOR",
966  0,
967  "Tracks with Same Color",
968  "Select all tracks with same color as active track"},
969  {6, "FAILED", 0, "Failed Tracks", "Select all tracks which failed to be reconstructed"},
970  {0, NULL, 0, NULL, NULL},
971  };
972 
973  /* identifiers */
974  ot->name = "Select Grouped";
975  ot->description = "Select all tracks from specified group";
976  ot->idname = "CLIP_OT_select_grouped";
977 
978  /* api callbacks */
981 
982  /* flags */
984 
985  /* properties */
987  "group",
988  select_group_items,
990  "Action",
991  "Clear action to execute");
992 }
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
void BKE_tracking_track_deselect(struct MovieTrackingTrack *track, int area)
Definition: tracking.c:1284
struct ListBase * BKE_tracking_get_active_tracks(struct MovieTracking *tracking)
Definition: tracking.c:346
void BKE_tracking_track_flag_clear(struct MovieTrackingTrack *track, int area, int flag)
Definition: tracking.c:705
#define PLANE_TRACK_VIEW_SELECTED(plane_track)
Definition: BKE_tracking.h:837
#define MARKER_VISIBLE(sc, track, marker)
Definition: BKE_tracking.h:840
@ TRACK_AREA_POINT
Definition: BKE_tracking.h:38
@ TRACK_AREA_ALL
Definition: BKE_tracking.h:43
@ TRACK_AREA_PAT
Definition: BKE_tracking.h:39
@ TRACK_AREA_SEARCH
Definition: BKE_tracking.h:40
@ TRACK_AREA_NONE
Definition: BKE_tracking.h:42
void BKE_tracking_track_flag_set(struct MovieTrackingTrack *track, int area, int flag)
Definition: tracking.c:688
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition: tracking.c:1890
struct MovieTrackingTrack * BKE_tracking_track_get_active(struct MovieTracking *tracking)
Definition: tracking.c:1089
void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking)
Definition: tracking.c:3411
void BKE_tracking_track_select(struct ListBase *tracksbase, struct MovieTrackingTrack *track, int area, bool extend)
Definition: tracking.c:1257
@ TRACK_CLEAR_REMAINED
Definition: BKE_tracking.h:235
struct ListBase * BKE_tracking_get_active_plane_tracks(struct MovieTracking *tracking)
Definition: tracking.c:357
#define TRACK_VIEW_SELECTED(sc, track)
Definition: BKE_tracking.h:831
void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2])
#define TRACK_AREA_SELECTED(track, area)
Definition: BKE_tracking.h:826
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition: tracking.c:1424
bool BLI_lasso_is_point_inside(const int mcoords[][2], unsigned int mcoords_len, int sx, int sy, int error_value)
Definition: lasso_2d.c:38
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], unsigned int mcoords_len)
Definition: lasso_2d.c:15
MINLINE float max_ff(float a, float b)
MINLINE float min_ffff(float a, float b, float c, float d)
MINLINE float min_fff(float a, float b, float c)
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 bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
#define SWAP(type, a, b)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:818
@ SC_VIEW_CLIP
@ SC_SHOW_MARKER_SEARCH
@ SC_SHOW_MARKER_PATTERN
@ PLANE_TRACK_HIDDEN
@ MARKER_TRACKED
@ MARKER_DISABLED
@ TRACK_CUSTOMCOLOR
@ TRACK_HIDDEN
@ TRACK_LOCKED
@ TRACK_HAS_BUNDLE
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_PASS_THROUGH
void ED_clip_point_stable_pos__reverse(struct SpaceClip *sc, struct ARegion *region, const float co[2], float r_co[2])
the reverse of ED_clip_point_stable_pos(), gets the marker region coords. better name here?...
Definition: clip_editor.c:517
int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc)
Definition: clip_editor.c:231
void ED_clip_view_lock_state_restore_no_jump(const struct bContext *C, const ClipViewLockState *state)
void ED_space_clip_get_zoom(struct SpaceClip *sc, struct ARegion *region, float *zoomx, float *zoomy)
Definition: clip_editor.c:164
void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height)
Definition: clip_editor.c:146
void ED_clip_mouse_pos(struct SpaceClip *sc, struct ARegion *region, const int mval[2], float co[2])
Definition: clip_editor.c:541
bool ED_space_clip_tracking_poll(struct bContext *C)
Definition: clip_editor.c:83
void ED_clip_point_stable_pos(struct SpaceClip *sc, struct ARegion *region, float x, float y, float *xr, float *yr)
Definition: clip_editor.c:483
void ED_clip_select_all(struct SpaceClip *sc, int action, bool *r_has_selection)
Definition: clip_editor.c:374
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:570
void ED_clip_view_lock_state_store(const struct bContext *C, ClipViewLockState *state)
eSelectOp ED_select_op_modal(eSelectOp sel_op, bool is_first)
Definition: select_utils.c:59
#define SEL_OP_USE_PRE_DESELECT(sel_op)
const char * ED_select_circle_get_name(struct wmOperatorType *ot, PointerRNA *ptr)
@ SEL_DESELECT
eSelectOp
@ SEL_OP_SUB
_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 height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei 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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
#define C
Definition: RandGen.cpp:25
#define V2D_IS_CLIPPED
Definition: UI_view2d.h:25
@ OPTYPE_DEPENDS_ON_CURSOR
Definition: WM_types.h:184
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DISPLAY
Definition: WM_types.h:439
#define NC_MOVIECLIP
Definition: WM_types.h:347
#define ND_SELECT
Definition: WM_types.h:455
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: avxb.h:154
ATTR_WARN_UNUSED_RESULT const BMVert * v2
struct MovieTrackingTrack * tracking_find_slidable_track_in_proximity(struct bContext *C, const float co[2])
Definition: tracking_ops.c:642
#define SELECT
uint pos
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
#define fabsf(x)
Definition: metal/compat.h:219
#define sqrtf(x)
Definition: metal/compat.h:243
static void area(int d1, int d2, int e1, int e2, float weights[2])
T distance(const T &a, const T &b)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
Definition: rna_access.c:4980
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4910
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
void * first
Definition: DNA_listBase.h:31
struct MovieTracking tracking
struct MovieTrackingPlaneTrack * next
struct MovieTrackingTrack * next
MovieTrackingPlaneTrack * act_plane_track
MovieTrackingTrack * act_track
struct MovieClip * clip
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
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
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
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
const char *(* get_name)(struct wmOperatorType *, struct PointerRNA *)
Definition: WM_types.h:960
struct PointerRNA * ptr
static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int mouse_on_side(const float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy)
static int select_exec(bContext *C, wmOperator *op)
static int select_all_exec(bContext *C, wmOperator *op)
void CLIP_OT_select_circle(wmOperatorType *ot)
void ed_tracking_deselect_all_tracks(ListBase *tracks_base)
static int box_select_exec(bContext *C, wmOperator *op)
static int clip_lasso_select_exec(bContext *C, wmOperator *op)
static MovieTrackingTrack * find_nearest_track(SpaceClip *sc, ListBase *tracksbase, const float co[2], float *r_distance)
void CLIP_OT_select_lasso(wmOperatorType *ot)
static int mouse_on_rect(const float co[2], const float pos[2], const float min[2], const float max[2], float epsx, float epsy)
static float dist_to_rect(const float co[2], const float pos[2], const float min[2], const float max[2])
void CLIP_OT_select_all(wmOperatorType *ot)
static int circle_select_exec(bContext *C, wmOperator *op)
bool ED_clip_can_select(bContext *C)
void CLIP_OT_select_box(wmOperatorType *ot)
static float dist_to_crns(const float co[2], const float pos[2], const float crns[4][2])
static int do_lasso_select_marker(bContext *C, const int mcoords[][2], const int mcoords_len, bool select)
static int point_inside_ellipse(const float point[2], const float offset[2], const float ellipse[2])
void CLIP_OT_select_grouped(wmOperatorType *ot)
static MovieTrackingPlaneTrack * find_nearest_plane_track(SpaceClip *sc, ListBase *plane_tracks_base, const float co[2], float *r_distance)
static int select_grouped_exec(bContext *C, wmOperator *op)
void CLIP_OT_select(wmOperatorType *ot)
static int mouse_on_crns(const float co[2], const float pos[2], const float crns[4][2], float epsx, float epsy)
static float dist_to_crns_abs(const float co[2], const float corners[4][2])
static int marker_inside_ellipse(MovieTrackingMarker *marker, const float offset[2], const float ellipse[2])
void ed_tracking_deselect_all_plane_tracks(ListBase *plane_tracks_base)
static int track_mouse_area(const bContext *C, const float co[2], MovieTrackingTrack *track)
static bool select_poll(bContext *C)
float max
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3479
bool WM_gesture_is_modal_first(const wmGesture *gesture)
Definition: wm_gesture.c:108
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)