Blender  V3.3
space_clip.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 <stdio.h>
9 #include <string.h>
10 
11 #include "DNA_defaults.h"
12 
13 #include "DNA_mask_types.h"
14 #include "DNA_movieclip_types.h"
15 #include "DNA_scene_types.h"
16 #include "DNA_view3d_types.h" /* for pivot point */
17 
18 #include "MEM_guardedalloc.h"
19 
20 #include "BLI_blenlib.h"
21 #include "BLI_math.h"
22 #include "BLI_utildefines.h"
23 
24 #include "BKE_context.h"
25 #include "BKE_lib_id.h"
26 #include "BKE_lib_remap.h"
27 #include "BKE_movieclip.h"
28 #include "BKE_screen.h"
29 #include "BKE_tracking.h"
30 
31 #include "IMB_imbuf_types.h"
32 
33 #include "ED_anim_api.h" /* for timeline cursor drawing */
34 #include "ED_clip.h"
35 #include "ED_mask.h"
36 #include "ED_screen.h"
37 #include "ED_space_api.h"
38 #include "ED_time_scrub_ui.h"
39 #include "ED_uvedit.h" /* just for ED_image_draw_cursor */
40 
41 #include "IMB_imbuf.h"
42 
43 #include "GPU_matrix.h"
44 
45 #include "WM_api.h"
46 #include "WM_types.h"
47 
48 #include "UI_interface.h"
49 #include "UI_resources.h"
50 #include "UI_view2d.h"
51 
52 #include "RNA_access.h"
53 
54 #include "clip_intern.h" /* own include */
55 
56 static void init_preview_region(const Scene *scene,
57  const ScrArea *area,
58  const SpaceClip *sc,
59  ARegion *region)
60 {
61  region->regiontype = RGN_TYPE_PREVIEW;
62  region->alignment = RGN_ALIGN_TOP;
63  region->flag |= RGN_FLAG_HIDDEN;
64 
65  if (sc->view == SC_VIEW_DOPESHEET) {
66  region->v2d.tot.xmin = -10.0f;
67  region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
68  region->v2d.tot.xmax = (float)(area->winx);
69  region->v2d.tot.ymax = 0.0f;
70 
71  region->v2d.cur = region->v2d.tot;
72 
73  region->v2d.min[0] = 0.0f;
74  region->v2d.min[1] = 0.0f;
75 
76  region->v2d.max[0] = MAXFRAMEF;
77  region->v2d.max[1] = FLT_MAX;
78 
79  region->v2d.minzoom = 0.01f;
80  region->v2d.maxzoom = 50;
82  region->v2d.scroll |= V2D_SCROLL_RIGHT;
83  region->v2d.keepzoom = V2D_LOCKZOOM_Y;
84  region->v2d.keepofs = V2D_KEEPOFS_Y;
85  region->v2d.align = V2D_ALIGN_NO_POS_Y;
87  }
88  else {
89  region->v2d.tot.xmin = 0.0f;
90  region->v2d.tot.ymin = -10.0f;
91  region->v2d.tot.xmax = (float)scene->r.efra;
92  region->v2d.tot.ymax = 10.0f;
93 
94  region->v2d.cur = region->v2d.tot;
95 
96  region->v2d.min[0] = FLT_MIN;
97  region->v2d.min[1] = FLT_MIN;
98 
99  region->v2d.max[0] = MAXFRAMEF;
100  region->v2d.max[1] = FLT_MAX;
101 
104 
105  region->v2d.minzoom = 0.0f;
106  region->v2d.maxzoom = 0.0f;
107  region->v2d.keepzoom = 0;
108  region->v2d.keepofs = 0;
109  region->v2d.align = 0;
110  region->v2d.flag = 0;
111 
112  region->v2d.keeptot = 0;
113  }
114 }
115 
116 static void reinit_preview_region(const bContext *C, ARegion *region)
117 {
121 
122  if (sc->view == SC_VIEW_DOPESHEET) {
123  if ((region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
124  init_preview_region(scene, area, sc, region);
125  }
126  }
127  else {
128  if (region->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
129  init_preview_region(scene, area, sc, region);
130  }
131  }
132 }
133 
135 {
136  ARegion *region, *arnew;
137 
139  if (region) {
140  return region;
141  }
142 
143  /* add subdiv level; after header */
145 
146  /* is error! */
147  if (region == NULL) {
148  return NULL;
149  }
150 
151  arnew = MEM_callocN(sizeof(ARegion), "clip preview region");
152 
153  BLI_insertlinkbefore(&area->regionbase, region, arnew);
155 
156  return arnew;
157 }
158 
160 {
161  ARegion *region, *arnew;
162 
164  if (region) {
165  return region;
166  }
167 
168  /* add subdiv level; after header */
170 
171  /* is error! */
172  if (region == NULL) {
173  return NULL;
174  }
175 
176  arnew = MEM_callocN(sizeof(ARegion), "clip channels region");
177 
178  BLI_insertlinkbefore(&area->regionbase, region, arnew);
179  arnew->regiontype = RGN_TYPE_CHANNELS;
180  arnew->alignment = RGN_ALIGN_LEFT;
181 
182  arnew->v2d.scroll = V2D_SCROLL_BOTTOM;
184 
185  return arnew;
186 }
187 
189 {
190  SpaceClip *sc = (SpaceClip *)area->spacedata.first;
191  ARegion *region;
192 
193  if (sc->mode != SC_MODE_TRACKING) {
194  return;
195  }
196 
197  /* only while properties are visible */
198  for (region = area->regionbase.first; region; region = region->next) {
199  if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) {
200  return;
201  }
202  }
203 
204  sc->scopes.ok = false;
205 }
206 
208 {
209  SpaceClip *sc = (SpaceClip *)area->spacedata.first;
210 
213  }
214 }
215 
217 {
218  SpaceClip *space_clip = (SpaceClip *)area->spacedata.first;
219  BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra);
220 }
221 
222 /* ******************** default callbacks for clip space ***************** */
223 
224 static SpaceLink *clip_create(const ScrArea *area, const Scene *scene)
225 {
226  ARegion *region;
227  SpaceClip *sc;
228 
230 
231  /* header */
232  region = MEM_callocN(sizeof(ARegion), "header for clip");
233 
234  BLI_addtail(&sc->regionbase, region);
235  region->regiontype = RGN_TYPE_HEADER;
237 
238  /* tools view */
239  region = MEM_callocN(sizeof(ARegion), "tools for clip");
240 
241  BLI_addtail(&sc->regionbase, region);
242  region->regiontype = RGN_TYPE_TOOLS;
243  region->alignment = RGN_ALIGN_LEFT;
244 
245  /* properties view */
246  region = MEM_callocN(sizeof(ARegion), "properties for clip");
247 
248  BLI_addtail(&sc->regionbase, region);
249  region->regiontype = RGN_TYPE_UI;
250  region->alignment = RGN_ALIGN_RIGHT;
251 
252  /* channels view */
253  region = MEM_callocN(sizeof(ARegion), "channels for clip");
254 
255  BLI_addtail(&sc->regionbase, region);
256  region->regiontype = RGN_TYPE_CHANNELS;
257  region->alignment = RGN_ALIGN_LEFT;
258 
259  region->v2d.scroll = V2D_SCROLL_BOTTOM;
261 
262  /* preview view */
263  region = MEM_callocN(sizeof(ARegion), "preview for clip");
264 
265  BLI_addtail(&sc->regionbase, region);
266  init_preview_region(scene, area, sc, region);
267 
268  /* main region */
269  region = MEM_callocN(sizeof(ARegion), "main region for clip");
270 
271  BLI_addtail(&sc->regionbase, region);
272  region->regiontype = RGN_TYPE_WINDOW;
273 
274  return (SpaceLink *)sc;
275 }
276 
277 /* not spacelink itself */
278 static void clip_free(SpaceLink *sl)
279 {
280  SpaceClip *sc = (SpaceClip *)sl;
281 
282  sc->clip = NULL;
283 
284  if (sc->scopes.track_preview) {
286  }
287 
288  if (sc->scopes.track_search) {
290  }
291 }
292 
293 /* spacetype; init callback */
294 static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
295 {
296  ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0);
297 
298  /* add drop boxes */
299  WM_event_add_dropbox_handler(&area->handlers, lb);
300 }
301 
303 {
304  SpaceClip *scn = MEM_dupallocN(sl);
305 
306  /* clear or remove stuff from old */
307  scn->scopes.track_search = NULL;
308  scn->scopes.track_preview = NULL;
309  scn->scopes.ok = false;
310 
311  return (SpaceLink *)scn;
312 }
313 
315 {
316  ScrArea *area = params->area;
317  wmNotifier *wmn = params->notifier;
318  const Scene *scene = params->scene;
319 
320  /* context changes */
321  switch (wmn->category) {
322  case NC_SCENE:
323  switch (wmn->data) {
324  case ND_FRAME:
327 
328  case ND_FRAME_RANGE:
330  break;
331  }
332  break;
333  case NC_MOVIECLIP:
334  switch (wmn->data) {
335  case ND_DISPLAY:
336  case ND_SELECT:
339  break;
340  }
341  switch (wmn->action) {
342  case NA_REMOVED:
343  case NA_EDITED:
344  case NA_EVALUATED:
345  /* fall-through */
346 
347  case NA_SELECTED:
350  break;
351  }
352  break;
353  case NC_MASK:
354  switch (wmn->data) {
355  case ND_SELECT:
356  case ND_DATA:
357  case ND_DRAW:
359  break;
360  }
361  switch (wmn->action) {
362  case NA_SELECTED:
364  break;
365  case NA_EDITED:
367  break;
368  }
369  break;
370  case NC_GEOM:
371  switch (wmn->data) {
372  case ND_SELECT:
375  break;
376  }
377  break;
378  case NC_SCREEN:
379  switch (wmn->data) {
380  case ND_ANIMPLAY:
382  break;
383  case ND_LAYOUTSET:
385  break;
386  }
387  break;
388  case NC_SPACE:
389  if (wmn->data == ND_SPACE_CLIP) {
392  }
393  break;
394  case NC_GPENCIL:
395  if (wmn->action == NA_EDITED) {
398  }
399  else if (wmn->data & ND_GPENCIL_EDITMODE) {
401  }
402  break;
403  case NC_WM:
404  switch (wmn->data) {
405  case ND_FILEREAD:
406  case ND_UNDO:
408  break;
409  }
410  break;
411  }
412 }
413 
414 static void clip_operatortypes(void)
415 {
416  /* ** clip_ops.c ** */
430 #ifdef WITH_INPUT_NDOF
431  WM_operatortype_append(CLIP_OT_view_ndof);
432 #endif
437 
438  /* ** tracking_ops.c ** */
439 
440  /* navigation */
442 
443  /* set optical center to frame center */
445 
446  /* selection */
453 
454  /* markers */
460 
461  /* track */
464 
465  /* solving */
468 
473 
475 
476  /* orientation */
483 
484  /* detect */
486 
487  /* stabilization */
494 
495  /* clean-up */
500 
502 
503  /* object tracking */
506 
507  /* clipboard */
510 
511  /* Plane tracker */
514 
517 
520 
521  /* ** clip_graph_ops.c ** */
522 
523  /* graph editing */
524 
525  /* selection */
529 
534 
536 
537  /* ** clip_dopesheet_ops.c ** */
538 
541 }
542 
543 static void clip_keymap(struct wmKeyConfig *keyconf)
544 {
545  /* ******** Global hotkeys available for all regions ******** */
546  WM_keymap_ensure(keyconf, "Clip", SPACE_CLIP, 0);
547 
548  /* ******** Hotkeys available for main region only ******** */
549  WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, 0);
550  // keymap->poll = ED_space_clip_tracking_poll;
551 
552  /* ******** Hotkeys available for preview region only ******** */
553  WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
554 
555  /* ******** Hotkeys available for channels region only ******** */
556  WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
557 }
558 
559 /* DO NOT make this static, this hides the symbol and breaks API generation script. */
560 extern const char *clip_context_dir[]; /* quiet warning. */
561 const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", NULL};
562 
563 static int /*eContextResult*/ clip_context(const bContext *C,
564  const char *member,
566 {
568 
569  if (CTX_data_dir(member)) {
571 
572  return CTX_RESULT_OK;
573  }
574  if (CTX_data_equals(member, "edit_movieclip")) {
575  if (sc->clip) {
577  }
578  return CTX_RESULT_OK;
579  }
580  if (CTX_data_equals(member, "edit_mask")) {
581  if (sc->mask_info.mask) {
583  }
584  return CTX_RESULT_OK;
585  }
586 
588 }
589 
590 /* dropboxes */
591 static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
592 {
593  if (drag->type == WM_DRAG_PATH) {
594  /* rule might not work? */
595  if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) {
596  return true;
597  }
598  }
599 
600  return false;
601 }
602 
603 static void clip_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
604 {
605  PointerRNA itemptr;
606  char dir[FILE_MAX], file[FILE_MAX];
607 
608  BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file));
609 
610  RNA_string_set(drop->ptr, "directory", dir);
611 
612  RNA_collection_clear(drop->ptr, "files");
613  RNA_collection_add(drop->ptr, "files", &itemptr);
614  RNA_string_set(&itemptr, "name", file);
615 }
616 
617 /* area+region dropbox definition */
618 static void clip_dropboxes(void)
619 {
620  ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0);
621 
622  WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, NULL, NULL);
623 }
624 
625 static bool clip_set_region_visible(const bContext *C,
626  ARegion *region,
627  const bool is_visible,
628  const short alignment,
629  const bool view_all_on_show)
630 {
631  bool view_changed = false;
632 
633  if (is_visible) {
634  if (region && (region->flag & RGN_FLAG_HIDDEN)) {
635  region->flag &= ~RGN_FLAG_HIDDEN;
636  region->v2d.flag &= ~V2D_IS_INIT;
637  if (view_all_on_show) {
638  region->v2d.cur = region->v2d.tot;
639  }
640  view_changed = true;
641  }
642  if (region && region->alignment != alignment) {
643  region->alignment = alignment;
644  view_changed = true;
645  }
646  }
647  else {
648  if (region && !(region->flag & RGN_FLAG_HIDDEN)) {
649  region->flag |= RGN_FLAG_HIDDEN;
650  region->v2d.flag &= ~V2D_IS_INIT;
652  view_changed = true;
653  }
654  if (region && region->alignment != RGN_ALIGN_NONE) {
655  region->alignment = RGN_ALIGN_NONE;
656  view_changed = true;
657  }
658  }
659 
660  return view_changed;
661 }
662 
663 static void clip_refresh(const bContext *C, ScrArea *area)
664 {
666  wmWindow *window = CTX_wm_window(C);
668  SpaceClip *sc = (SpaceClip *)area->spacedata.first;
671  ARegion *region_preview = ED_clip_has_preview_region(C, area);
672  ARegion *region_properties = ED_clip_has_properties_region(area);
673  ARegion *region_channels = ED_clip_has_channels_region(area);
674  bool main_visible = false, preview_visible = false, tools_visible = false;
675  bool properties_visible = false, channels_visible = false;
676  bool view_changed = false;
677 
678  switch (sc->view) {
679  case SC_VIEW_CLIP:
680  main_visible = true;
681  preview_visible = false;
682  tools_visible = true;
683  properties_visible = true;
684  channels_visible = false;
685  break;
686  case SC_VIEW_GRAPH:
687  main_visible = false;
688  preview_visible = true;
689  tools_visible = false;
690  properties_visible = false;
691  channels_visible = false;
692 
693  reinit_preview_region(C, region_preview);
694  break;
695  case SC_VIEW_DOPESHEET:
696  main_visible = false;
697  preview_visible = true;
698  tools_visible = false;
699  properties_visible = false;
700  channels_visible = true;
701 
702  reinit_preview_region(C, region_preview);
703  break;
704  }
705 
706  view_changed |= clip_set_region_visible(C, region_main, main_visible, RGN_ALIGN_NONE, false);
707  view_changed |= clip_set_region_visible(
708  C, region_properties, properties_visible, RGN_ALIGN_RIGHT, false);
709  view_changed |= clip_set_region_visible(C, region_tools, tools_visible, RGN_ALIGN_LEFT, false);
710  view_changed |= clip_set_region_visible(
711  C, region_preview, preview_visible, RGN_ALIGN_NONE, true);
712  view_changed |= clip_set_region_visible(
713  C, region_channels, channels_visible, RGN_ALIGN_LEFT, false);
714 
715  if (view_changed) {
716  ED_area_init(wm, window, area);
718  }
719 
721 }
722 
724 {
725  VIEW2D_GGT_navigate_impl(gzgt, "CLIP_GGT_navigate");
726 }
727 
728 static void clip_gizmos(void)
729 {
732 
734 }
735 
736 /********************* main region ********************/
737 
738 /* sets up the fields of the View2D from zoom and offset */
739 static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
740 {
742  float x1, y1, w, h, aspx, aspy;
743  int width, height, winx, winy;
744 
746  ED_space_clip_get_aspect(sc, &aspx, &aspy);
747 
748  w = width * aspx;
749  h = height * aspy;
750 
751  winx = BLI_rcti_size_x(&region->winrct) + 1;
752  winy = BLI_rcti_size_y(&region->winrct) + 1;
753 
754  region->v2d.tot.xmin = 0;
755  region->v2d.tot.ymin = 0;
756  region->v2d.tot.xmax = w;
757  region->v2d.tot.ymax = h;
758 
759  region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
760  region->v2d.mask.xmax = winx;
761  region->v2d.mask.ymax = winy;
762 
763  /* which part of the image space do we see? */
764  x1 = region->winrct.xmin + (winx - sc->zoom * w) / 2.0f;
765  y1 = region->winrct.ymin + (winy - sc->zoom * h) / 2.0f;
766 
767  x1 -= sc->zoom * sc->xof;
768  y1 -= sc->zoom * sc->yof;
769 
770  /* relative display right */
771  region->v2d.cur.xmin = (region->winrct.xmin - (float)x1) / sc->zoom;
772  region->v2d.cur.xmax = region->v2d.cur.xmin + ((float)winx / sc->zoom);
773 
774  /* relative display left */
775  region->v2d.cur.ymin = (region->winrct.ymin - (float)y1) / sc->zoom;
776  region->v2d.cur.ymax = region->v2d.cur.ymin + ((float)winy / sc->zoom);
777 
778  /* normalize 0.0..1.0 */
779  region->v2d.cur.xmin /= w;
780  region->v2d.cur.xmax /= w;
781  region->v2d.cur.ymin /= h;
782  region->v2d.cur.ymax /= h;
783 }
784 
785 /* add handlers, stuff you only do once or on area/region changes */
787 {
788  wmKeyMap *keymap;
789 
790  /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
791  * since the space clip manages own v2d in #movieclip_main_area_set_view2d */
792 
793  /* mask polls mode */
794  keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
796 
797  /* own keymap */
798  keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
800 
801  keymap = WM_keymap_ensure(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
803 }
804 
805 static void clip_main_region_draw(const bContext *C, ARegion *region)
806 {
807  /* draw entirely, view changes should be handled here */
809  MovieClip *clip = ED_space_clip_get_clip(sc);
810  float aspx, aspy, zoomx, zoomy, x, y;
811  int width, height;
812  bool show_cursor = false;
813 
814  /* If tracking is in progress, we should synchronize the frame from the clip-user
815  * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
816  if (clip && clip->tracking_context) {
818  }
819 
820  if (sc->flag & SC_LOCK_SELECTION) {
821  ImBuf *tmpibuf = NULL;
822 
825  }
826 
827  if (ED_clip_view_selection(C, region, 0)) {
828  sc->xof += sc->xlockof;
829  sc->yof += sc->ylockof;
830  }
831 
832  if (tmpibuf) {
833  IMB_freeImBuf(tmpibuf);
834  }
835  }
836 
837  /* clear and setup matrix */
839 
840  /* data... */
842 
843  /* callback */
845 
846  clip_draw_main(C, sc, region);
847 
848  /* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
849  UI_view2d_view_to_region_fl(&region->v2d, 0.0f, 0.0f, &x, &y);
851  ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
852  ED_space_clip_get_aspect(sc, &aspx, &aspy);
853 
854  if (sc->mode == SC_MODE_MASKEDIT) {
856  if (mask && clip) {
858  int mask_width, mask_height;
859  ED_mask_get_size(area, &mask_width, &mask_height);
861  mask,
862  region,
863  sc->mask_info.draw_flag,
864  sc->mask_info.draw_type,
867  mask_width,
868  mask_height,
869  aspx,
870  aspy,
871  true,
872  true,
873  sc->stabmat,
874  C);
875  }
876  }
877 
878  show_cursor |= sc->mode == SC_MODE_MASKEDIT;
879  show_cursor |= sc->around == V3D_AROUND_CURSOR;
880 
881  if (show_cursor) {
882  GPU_matrix_push();
884  GPU_matrix_scale_2f(zoomx, zoomy);
885  GPU_matrix_mul(sc->stabmat);
887  ED_image_draw_cursor(region, sc->cursor);
888  GPU_matrix_pop();
889  }
890 
891  clip_draw_cache_and_notes(C, sc, region);
892 
893  if (sc->flag & SC_SHOW_ANNOTATION) {
894  /* Grease Pencil */
896  }
897 
898  /* callback */
899  /* TODO(sergey): For being consistent with space image the projection needs to be configured
900  * the way how the commented out code does it. This works correct for tracking data, but it
901  * causes wrong aspect correction for mask editor (see T84990). */
902  // GPU_matrix_push_projection();
903  // wmOrtho2(region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin,
904  // region->v2d.cur.ymax);
906  // GPU_matrix_pop_projection();
907 
908  /* reset view matrix */
910 
911  if (sc->flag & SC_SHOW_ANNOTATION) {
912  /* draw Grease Pencil - screen space only */
914  }
915 
917 }
918 
920 {
921  ARegion *region = params->region;
922  wmNotifier *wmn = params->notifier;
923 
924  /* context changes */
925  switch (wmn->category) {
926  case NC_GPENCIL:
927  if (wmn->action == NA_EDITED) {
928  ED_region_tag_redraw(region);
929  }
930  else if (wmn->data & ND_GPENCIL_EDITMODE) {
931  ED_region_tag_redraw(region);
932  }
933  break;
934  }
935 }
936 
937 /****************** preview region ******************/
938 
940 {
941  wmKeyMap *keymap;
942 
943  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
944 
945  /* own keymap */
946 
947  keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
949 
950  keymap = WM_keymap_ensure(wm->defaultconf, "Clip Time Scrub", SPACE_CLIP, RGN_TYPE_PREVIEW);
952 
953  keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
955 
956  keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
958 }
959 
960 static void graph_region_draw(const bContext *C, ARegion *region)
961 {
962  View2D *v2d = &region->v2d;
965  short cfra_flag = 0;
966 
967  if (sc->flag & SC_LOCK_TIMECURSOR) {
969  }
970 
971  /* clear and setup matrix */
973 
975 
976  /* data... */
977  clip_draw_graph(sc, region, scene);
978 
979  /* current frame indicator line */
980  if (sc->flag & SC_SHOW_SECONDS) {
981  cfra_flag |= DRAWCFRA_UNIT_SECONDS;
982  }
983  ANIM_draw_cfra(C, v2d, cfra_flag);
984 
985  /* reset view matrix */
987 
988  /* time-scrubbing */
989  ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
990 
991  /* current frame indicator */
993 
994  /* scrollers */
996 
997  /* scale indicators */
998  {
999  rcti rect;
1000  BLI_rcti_init(
1001  &rect, 0, 15 * UI_DPI_FAC, 15 * UI_DPI_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y);
1002  UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT);
1003  }
1004 }
1005 
1006 static void dopesheet_region_draw(const bContext *C, ARegion *region)
1007 {
1009  SpaceClip *sc = CTX_wm_space_clip(C);
1010  MovieClip *clip = ED_space_clip_get_clip(sc);
1011  View2D *v2d = &region->v2d;
1012  short cfra_flag = 0;
1013 
1014  if (clip) {
1016  }
1017 
1018  /* clear and setup matrix */
1020 
1021  UI_view2d_view_ortho(v2d);
1022 
1023  /* time grid */
1025 
1026  /* data... */
1027  clip_draw_dopesheet_main(sc, region, scene);
1028 
1029  /* current frame indicator line */
1030  if (sc->flag & SC_SHOW_SECONDS) {
1031  cfra_flag |= DRAWCFRA_UNIT_SECONDS;
1032  }
1033  ANIM_draw_cfra(C, v2d, cfra_flag);
1034 
1035  /* reset view matrix */
1037 
1038  /* time-scrubbing */
1039  ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
1040 
1041  /* current frame indicator */
1043 
1044  /* scrollers */
1046 }
1047 
1048 static void clip_preview_region_draw(const bContext *C, ARegion *region)
1049 {
1050  SpaceClip *sc = CTX_wm_space_clip(C);
1051 
1052  if (sc->view == SC_VIEW_GRAPH) {
1053  graph_region_draw(C, region);
1054  }
1055  else if (sc->view == SC_VIEW_DOPESHEET) {
1056  dopesheet_region_draw(C, region);
1057  }
1058 }
1059 
1061 {
1062 }
1063 
1064 /****************** channels region ******************/
1065 
1067 {
1068  wmKeyMap *keymap;
1069 
1070  /* ensure the 2d view sync works - main region has bottom scroller */
1071  region->v2d.scroll = V2D_SCROLL_BOTTOM;
1072 
1073  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
1074 
1075  keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
1077 }
1078 
1079 static void clip_channels_region_draw(const bContext *C, ARegion *region)
1080 {
1081  SpaceClip *sc = CTX_wm_space_clip(C);
1082  MovieClip *clip = ED_space_clip_get_clip(sc);
1083  View2D *v2d = &region->v2d;
1084 
1085  if (clip) {
1087  }
1088 
1089  /* clear and setup matrix */
1091 
1092  UI_view2d_view_ortho(v2d);
1093 
1094  /* data... */
1096 
1097  /* reset view matrix */
1099 }
1100 
1102 {
1103 }
1104 
1105 /****************** header region ******************/
1106 
1107 /* add handlers, stuff you only do once or on area/region changes */
1109 {
1110  ED_region_header_init(region);
1111 }
1112 
1113 static void clip_header_region_draw(const bContext *C, ARegion *region)
1114 {
1115  ED_region_header(C, region);
1116 }
1117 
1119 {
1120  ARegion *region = params->region;
1121  wmNotifier *wmn = params->notifier;
1122 
1123  /* context changes */
1124  switch (wmn->category) {
1125  case NC_SCENE:
1126  switch (wmn->data) {
1127  /* for proportional editmode only */
1128  case ND_TOOLSETTINGS:
1129  /* TODO: should do this when in mask mode only but no data available. */
1130  // if (sc->mode == SC_MODE_MASKEDIT)
1131  {
1132  ED_region_tag_redraw(region);
1133  break;
1134  }
1135  }
1136  break;
1137  }
1138 }
1139 
1140 /****************** tools region ******************/
1141 
1142 /* add handlers, stuff you only do once or on area/region changes */
1144 {
1145  wmKeyMap *keymap;
1146 
1147  ED_region_panels_init(wm, region);
1148 
1149  keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
1150  WM_event_add_keymap_handler(&region->handlers, keymap);
1151 }
1152 
1153 static void clip_tools_region_draw(const bContext *C, ARegion *region)
1154 {
1155  ED_region_panels(C, region);
1156 }
1157 
1158 /****************** tool properties region ******************/
1159 
1161 {
1162  ARegion *region = params->region;
1163  wmNotifier *wmn = params->notifier;
1164 
1165  /* context changes */
1166  switch (wmn->category) {
1167  case NC_WM:
1168  if (wmn->data == ND_HISTORY) {
1169  ED_region_tag_redraw(region);
1170  }
1171  break;
1172  case NC_SCENE:
1173  if (wmn->data == ND_MODE) {
1174  ED_region_tag_redraw(region);
1175  }
1176  break;
1177  case NC_SPACE:
1178  if (wmn->data == ND_SPACE_CLIP) {
1179  ED_region_tag_redraw(region);
1180  }
1181  break;
1182  case NC_GPENCIL:
1183  if (wmn->action == NA_EDITED) {
1184  ED_region_tag_redraw(region);
1185  }
1186  break;
1187  }
1188 }
1189 
1190 /****************** properties region ******************/
1191 
1192 /* add handlers, stuff you only do once or on area/region changes */
1194 {
1195  wmKeyMap *keymap;
1196 
1197  ED_region_panels_init(wm, region);
1198 
1199  keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
1200  WM_event_add_keymap_handler(&region->handlers, keymap);
1201 }
1202 
1203 static void clip_properties_region_draw(const bContext *C, ARegion *region)
1204 {
1205  SpaceClip *sc = CTX_wm_space_clip(C);
1206 
1207  BKE_movieclip_update_scopes(sc->clip, &sc->user, &sc->scopes);
1208 
1209  ED_region_panels(C, region);
1210 }
1211 
1213 {
1214  ARegion *region = params->region;
1215  wmNotifier *wmn = params->notifier;
1216 
1217  /* context changes */
1218  switch (wmn->category) {
1219  case NC_GPENCIL:
1220  if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE)) {
1221  ED_region_tag_redraw(region);
1222  }
1223  break;
1224  case NC_BRUSH:
1225  if (wmn->action == NA_EDITED) {
1226  ED_region_tag_redraw(region);
1227  }
1228  break;
1229  }
1230 }
1231 
1232 /********************* registration ********************/
1233 
1235  SpaceLink *slink,
1236  const struct IDRemapper *mappings)
1237 {
1238  SpaceClip *sclip = (SpaceClip *)slink;
1239 
1241  return;
1242  }
1243 
1244  BKE_id_remapper_apply(mappings, (ID **)&sclip->clip, ID_REMAP_APPLY_ENSURE_REAL);
1246 }
1247 
1249 {
1250  SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype clip");
1251  ARegionType *art;
1252 
1253  st->spaceid = SPACE_CLIP;
1254  strncpy(st->name, "Clip", BKE_ST_MAXNAME);
1255 
1256  st->create = clip_create;
1257  st->free = clip_free;
1258  st->init = clip_init;
1259  st->duplicate = clip_duplicate;
1260  st->operatortypes = clip_operatortypes;
1261  st->keymap = clip_keymap;
1262  st->listener = clip_listener;
1263  st->context = clip_context;
1264  st->gizmos = clip_gizmos;
1265  st->dropboxes = clip_dropboxes;
1266  st->refresh = clip_refresh;
1267  st->id_remap = clip_id_remap;
1268 
1269  /* regions: main window */
1270  art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
1271  art->regionid = RGN_TYPE_WINDOW;
1272  art->init = clip_main_region_init;
1273  art->draw = clip_main_region_draw;
1276 
1277  BLI_addhead(&st->regiontypes, art);
1278 
1279  /* preview */
1280  art = MEM_callocN(sizeof(ARegionType), "spacetype clip region preview");
1281  art->regionid = RGN_TYPE_PREVIEW;
1282  art->prefsizey = 240;
1287 
1288  BLI_addhead(&st->regiontypes, art);
1289 
1290  /* regions: properties */
1291  art = MEM_callocN(sizeof(ARegionType), "spacetype clip region properties");
1292  art->regionid = RGN_TYPE_UI;
1298  BLI_addhead(&st->regiontypes, art);
1300 
1301  /* regions: tools */
1302  art = MEM_callocN(sizeof(ARegionType), "spacetype clip region tools");
1303  art->regionid = RGN_TYPE_TOOLS;
1309 
1310  BLI_addhead(&st->regiontypes, art);
1311 
1312  /* regions: header */
1313  art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");
1314  art->regionid = RGN_TYPE_HEADER;
1315  art->prefsizey = HEADERY;
1317 
1321 
1322  BLI_addhead(&st->regiontypes, art);
1323 
1325 
1326  /* channels */
1327  art = MEM_callocN(sizeof(ARegionType), "spacetype clip channels region");
1328  art->regionid = RGN_TYPE_CHANNELS;
1334 
1335  BLI_addhead(&st->regiontypes, art);
1336 
1337  /* regions: hud */
1338  art = ED_area_type_hud(st->spaceid);
1339  BLI_addhead(&st->regiontypes, art);
1340 }
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
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
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
Definition: context.c:696
bool CTX_data_equals(const char *member, const char *str)
Definition: context.c:634
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id)
Definition: context.c:644
bool CTX_data_dir(const char *member)
Definition: context.c:639
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct Mask * CTX_data_edit_mask(const bContext *C)
Definition: context.c:1390
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
Definition: context.c:1519
@ CTX_RESULT_MEMBER_NOT_FOUND
Definition: BKE_context.h:75
@ CTX_RESULT_OK
Definition: BKE_context.h:72
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
bool BKE_id_remapper_has_mapping_for(const struct IDRemapper *id_remapper, uint64_t type_filter)
@ ID_REMAP_APPLY_ENSURE_REAL
IDRemapperApplyResult BKE_id_remapper_apply(const struct IDRemapper *id_remapper, struct ID **r_id_ptr, IDRemapperApplyOptions options)
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr)
Definition: movieclip.c:1614
void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes)
Definition: movieclip.c:1683
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
#define BKE_ST_MAXNAME
Definition: BKE_screen.h:53
void BKE_spacetype_register(struct SpaceType *st)
Definition: screen.c:391
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking)
Definition: tracking.c:3418
void BKE_autotrack_context_sync_user(struct AutoTrackContext *context, struct MovieClipUser *user)
#define ATTR_FALLTHROUGH
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
Definition: listbase.c:340
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen)
Definition: path_util.c:1465
#define FILE_MAX
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:190
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition: rct.c:417
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
#define UNUSED(x)
#define ELEM(...)
#define FILTER_ID_MC
Definition: DNA_ID.h:912
#define FILTER_ID_MSK
Definition: DNA_ID.h:914
#define DNA_struct_default_alloc(struct_name)
Definition: DNA_defaults.h:32
#define MAXFRAMEF
#define HEADERY
@ RGN_FLAG_HIDDEN
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_ALIGN_NONE
@ SPACE_CLIP
@ SC_VIEW_GRAPH
@ SC_VIEW_CLIP
@ SC_VIEW_DOPESHEET
@ SC_MODE_TRACKING
@ SC_MODE_MASKEDIT
@ SC_SHOW_SECONDS
@ SC_LOCK_SELECTION
@ SC_SHOW_ANNOTATION
@ SC_LOCK_TIMECURSOR
@ SC_GPENCIL_SRC_TRACK
@ TRACKING_2D_STABILIZATION
@ USER_HEADER_BOTTOM
@ V2D_KEEPOFS_Y
@ V2D_LOCKZOOM_Y
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_POS_Y
@ V3D_AROUND_CURSOR
@ DRAWCFRA_UNIT_SECONDS
Definition: ED_anim_api.h:740
bool ED_clip_view_selection(const struct bContext *C, struct ARegion *region, bool fit)
void ED_space_clip_get_aspect(struct SpaceClip *sc, float *aspx, float *aspy)
Definition: clip_editor.c:176
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
struct ImBuf * ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle)
Definition: clip_editor.c:258
struct MovieClip * ED_space_clip_get_clip(struct SpaceClip *sc)
Definition: clip_editor.c:570
void ED_mask_draw_region(struct Depsgraph *depsgraph, struct Mask *mask, struct ARegion *region, char draw_flag, char draw_type, eMaskOverlayMode overlay_mode, float blend_factor, int width_i, int height_i, float aspx, float aspy, bool do_scale_applied, bool do_draw_cb, float stabmat[4][4], const struct bContext *C)
void ED_mask_get_size(struct ScrArea *area, int *width, int *height)
Definition: mask_query.c:674
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:729
@ ED_KEYMAP_UI
Definition: ED_screen.h:691
@ ED_KEYMAP_HEADER
Definition: ED_screen.h:697
@ ED_KEYMAP_GPENCIL
Definition: ED_screen.h:699
@ ED_KEYMAP_GIZMO
Definition: ED_screen.h:692
@ ED_KEYMAP_VIEW2D
Definition: ED_screen.h:694
@ ED_KEYMAP_FRAMES
Definition: ED_screen.h:696
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_region_panels(const struct bContext *C, struct ARegion *region)
struct ARegionType * ED_area_type_hud(int space_type)
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region)
Definition: area.c:3153
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
void ED_region_header_init(struct ARegion *region)
Definition: area.c:3417
void ED_area_init(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area)
Definition: area.c:1902
#define REGION_DRAW_POST_VIEW
Definition: ED_space_api.h:62
void ED_region_draw_cb_draw(const struct bContext *C, struct ARegion *region, int type)
#define REGION_DRAW_PRE_VIEW
Definition: ED_space_api.h:64
void ED_image_draw_cursor(struct ARegion *region, const float cursor[2])
Definition: uvedit_draw.c:25
_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 width
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:126
void GPU_matrix_scale_2f(float x, float y)
Definition: gpu_matrix.cc:216
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:224
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:119
void GPU_matrix_translate_2f(float x, float y)
Definition: gpu_matrix.cc:174
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
#define UI_SIDEBAR_PANEL_WIDTH
Definition: UI_interface.h:242
#define UI_DPI_FAC
Definition: UI_interface.h:305
#define UI_COMPACT_PANEL_WIDTH
Definition: UI_interface.h:241
@ TH_BACK
Definition: UI_resources.h:39
@ TH_TEXT
Definition: UI_resources.h:42
void UI_ThemeClearColor(int colorid)
Definition: resources.c:1448
void VIEW2D_GGT_navigate_impl(struct wmGizmoGroupType *gzgt, const char *idname)
void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy)
Definition: view2d.cc:217
void UI_view2d_view_to_region_fl(const struct View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL()
void UI_view2d_view_restore(const struct bContext *C)
#define UI_TIME_SCRUB_MARGIN_Y
Definition: UI_view2d.h:450
void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const struct View2D *v2d, const struct Scene *scene, bool display_seconds, bool display_minor_lines)
void UI_view2d_view_ortho(const struct View2D *v2d)
void UI_view2d_scrollers_draw(struct View2D *v2d, const struct rcti *mask_custom)
@ V2D_COMMONVIEW_LIST
Definition: UI_view2d.h:38
@ V2D_COMMONVIEW_CUSTOM
Definition: UI_view2d.h:34
void UI_view2d_draw_scale_y__values(const struct ARegion *region, const struct View2D *v2d, const struct rcti *rect, int colorid)
@ WM_GIZMOMAP_DRAWSTEP_2D
#define ND_FILEREAD
Definition: WM_types.h:360
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DRAW
Definition: WM_types.h:410
#define NC_BRUSH
Definition: WM_types.h:335
#define NC_WM
Definition: WM_types.h:324
#define ND_DATA
Definition: WM_types.h:456
#define WM_DRAG_PATH
Definition: WM_types.h:1050
#define ND_GPENCIL_EDITMODE
Definition: WM_types.h:451
#define NA_EVALUATED
Definition: WM_types.h:524
#define ND_DISPLAY
Definition: WM_types.h:439
#define NC_SCREEN
Definition: WM_types.h:327
#define NC_MOVIECLIP
Definition: WM_types.h:347
#define ND_MODE
Definition: WM_types.h:393
#define ND_ANIMPLAY
Definition: WM_types.h:372
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define NA_EDITED
Definition: WM_types.h:523
#define ND_FRAME_RANGE
Definition: WM_types.h:399
#define ND_SPACE_CLIP
Definition: WM_types.h:482
#define ND_UNDO
Definition: WM_types.h:365
#define ND_FRAME
Definition: WM_types.h:382
#define NA_REMOVED
Definition: WM_types.h:526
#define ND_SELECT
Definition: WM_types.h:455
#define NC_GPENCIL
Definition: WM_types.h:349
#define NC_MASK
Definition: WM_types.h:348
#define ND_HISTORY
Definition: WM_types.h:363
#define ND_LAYOUTSET
Definition: WM_types.h:374
#define NC_SPACE
Definition: WM_types.h:342
#define NA_SELECTED
Definition: WM_types.h:528
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition: anim_draw.c:51
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
void ED_clip_buttons_register(ARegionType *art)
Definition: clip_buttons.c:70
void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
void CLIP_OT_dopesheet_view_all(wmOperatorType *ot)
void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region)
Definition: clip_draw.c:1964
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
Definition: clip_draw.c:1894
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
Definition: clip_draw.c:1974
void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene)
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
void CLIP_OT_graph_select(wmOperatorType *ot)
void CLIP_OT_graph_select_box(wmOperatorType *ot)
void CLIP_OT_graph_view_all(wmOperatorType *ot)
void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
void CLIP_OT_tracking_object_remove(struct wmOperatorType *ot)
void CLIP_OT_frame_jump(struct wmOperatorType *ot)
void CLIP_OT_hide_tracks(struct wmOperatorType *ot)
void CLIP_OT_select_circle(struct wmOperatorType *ot)
void CLIP_OT_set_axis(struct wmOperatorType *ot)
void CLIP_OT_view_zoom_out(struct wmOperatorType *ot)
Definition: clip_ops.c:822
void CLIP_OT_view_center_cursor(struct wmOperatorType *ot)
Definition: clip_ops.c:996
void CLIP_OT_stabilize_2d_add(struct wmOperatorType *ot)
void CLIP_OT_track_copy_color(struct wmOperatorType *ot)
void CLIP_OT_set_scale(struct wmOperatorType *ot)
void CLIP_OT_set_solution_scale(struct wmOperatorType *ot)
void CLIP_OT_view_all(struct wmOperatorType *ot)
Definition: clip_ops.c:957
void CLIP_OT_view_zoom_in(struct wmOperatorType *ot)
Definition: clip_ops.c:765
void CLIP_OT_clean_tracks(struct wmOperatorType *ot)
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition: clip_ops.c:699
void CLIP_OT_clear_solution(struct wmOperatorType *ot)
void CLIP_OT_reload(struct wmOperatorType *ot)
Definition: clip_ops.c:342
void CLIP_OT_solve_camera(struct wmOperatorType *ot)
void CLIP_OT_lock_selection_toggle(struct wmOperatorType *ot)
Definition: clip_ops.c:1848
void CLIP_OT_add_marker_at_click(struct wmOperatorType *ot)
Definition: tracking_ops.c:193
void CLIP_OT_delete_track(struct wmOperatorType *ot)
Definition: tracking_ops.c:250
void CLIP_OT_select_lasso(struct wmOperatorType *ot)
void CLIP_OT_view_zoom_ratio(struct wmOperatorType *ot)
Definition: clip_ops.c:874
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition: clip_ops.c:1748
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition: clip_ops.c:1144
void CLIP_OT_select_grouped(struct wmOperatorType *ot)
void CLIP_OT_average_tracks(struct wmOperatorType *ot)
void CLIP_OT_mode_set(struct wmOperatorType *ot)
Definition: clip_ops.c:1601
void CLIP_OT_select(struct wmOperatorType *ot)
struct ARegion * ED_clip_has_properties_region(struct ScrArea *area)
Definition: clip_toolbar.c:28
void CLIP_OT_stabilize_2d_rotation_select(struct wmOperatorType *ot)
void CLIP_OT_open(struct wmOperatorType *ot)
Definition: clip_ops.c:295
void CLIP_OT_refine_markers(struct wmOperatorType *ot)
void CLIP_OT_set_solver_keyframe(struct wmOperatorType *ot)
void CLIP_OT_tracking_object_new(struct wmOperatorType *ot)
void CLIP_OT_disable_markers(struct wmOperatorType *ot)
void CLIP_OT_update_image_from_plane_marker(struct wmOperatorType *ot)
void CLIP_OT_clear_track_path(struct wmOperatorType *ot)
Definition: tracking_ops.c:978
void CLIP_OT_track_markers(struct wmOperatorType *ot)
void CLIP_OT_delete_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:321
void CLIP_OT_detect_features(struct wmOperatorType *ot)
void CLIP_OT_cursor_set(struct wmOperatorType *ot)
Definition: clip_ops.c:1798
void CLIP_OT_apply_solution_scale(struct wmOperatorType *ot)
void CLIP_OT_rebuild_proxy(struct wmOperatorType *ot)
Definition: clip_ops.c:1563
void CLIP_OT_set_origin(struct wmOperatorType *ot)
void CLIP_OT_slide_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:914
void CLIP_OT_select_box(struct wmOperatorType *ot)
void CLIP_OT_view_selected(struct wmOperatorType *ot)
Definition: clip_ops.c:1028
void CLIP_OT_stabilize_2d_rotation_remove(struct wmOperatorType *ot)
void CLIP_OT_create_plane_track(struct wmOperatorType *ot)
void CLIP_OT_slide_plane_marker(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(struct wmOperatorType *ot)
void CLIP_OT_add_marker(struct wmOperatorType *ot)
Definition: tracking_ops.c:112
void CLIP_OT_hide_tracks_clear(struct wmOperatorType *ot)
void CLIP_OT_prefetch(struct wmOperatorType *ot)
Definition: clip_ops.c:1707
void CLIP_OT_paste_tracks(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_add(struct wmOperatorType *ot)
void CLIP_OT_lock_tracks(struct wmOperatorType *ot)
void CLIP_OT_new_image_from_plane_marker(struct wmOperatorType *ot)
void CLIP_OT_select_all(struct wmOperatorType *ot)
void CLIP_OT_copy_tracks(struct wmOperatorType *ot)
void CLIP_OT_set_plane(struct wmOperatorType *ot)
void CLIP_OT_view_pan(struct wmOperatorType *ot)
Definition: clip_ops.c:496
void CLIP_OT_set_center_principal(struct wmOperatorType *ot)
void CLIP_OT_stabilize_2d_remove(struct wmOperatorType *ot)
void CLIP_OT_keyframe_delete(struct wmOperatorType *ot)
void CLIP_OT_join_tracks(struct wmOperatorType *ot)
void CLIP_OT_keyframe_insert(struct wmOperatorType *ot)
FILE * file
Scene scene
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:28
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:5155
void RNA_collection_clear(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5227
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
Definition: rna_access.c:5215
static ARegion * ED_clip_has_preview_region(const bContext *C, ScrArea *area)
Definition: space_clip.c:134
static void clip_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
Definition: space_clip.c:1108
static void clip_scopes_tag_refresh(ScrArea *area)
Definition: space_clip.c:188
static void clip_refresh(const bContext *C, ScrArea *area)
Definition: space_clip.c:663
static SpaceLink * clip_create(const ScrArea *area, const Scene *scene)
Definition: space_clip.c:224
static void clip_listener(const wmSpaceTypeListenerParams *params)
Definition: space_clip.c:314
static void clip_channels_region_listener(const wmRegionListenerParams *UNUSED(params))
Definition: space_clip.c:1101
static void clip_header_region_listener(const wmRegionListenerParams *params)
Definition: space_clip.c:1118
static void clip_header_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1113
static bool clip_set_region_visible(const bContext *C, ARegion *region, const bool is_visible, const short alignment, const bool view_all_on_show)
Definition: space_clip.c:625
static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
Definition: space_clip.c:739
static void clip_free(SpaceLink *sl)
Definition: space_clip.c:278
static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
Definition: space_clip.c:216
static void clip_properties_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1203
void ED_spacetype_clip(void)
Definition: space_clip.c:1248
static void clip_preview_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_clip.c:939
static SpaceLink * clip_duplicate(SpaceLink *sl)
Definition: space_clip.c:302
static void dopesheet_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1006
static void graph_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:960
static void reinit_preview_region(const bContext *C, ARegion *region)
Definition: space_clip.c:116
static ARegion * ED_clip_has_channels_region(ScrArea *area)
Definition: space_clip.c:159
static void clip_properties_region_listener(const wmRegionListenerParams *params)
Definition: space_clip.c:1212
static void init_preview_region(const Scene *scene, const ScrArea *area, const SpaceClip *sc, ARegion *region)
Definition: space_clip.c:56
static void clip_operatortypes(void)
Definition: space_clip.c:414
static void clip_tools_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_clip.c:1143
static void clip_drop_copy(bContext *UNUSED(C), wmDrag *drag, wmDropBox *drop)
Definition: space_clip.c:603
static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_clip.c:786
static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
Definition: space_clip.c:591
static void clip_main_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:805
static void clip_tools_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1153
static void clip_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
Definition: space_clip.c:294
static void clip_channels_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_clip.c:1066
static void clip_channels_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1079
static void clip_dropboxes(void)
Definition: space_clip.c:618
static void clip_preview_region_listener(const wmRegionListenerParams *UNUSED(params))
Definition: space_clip.c:1060
static int clip_context(const bContext *C, const char *member, bContextDataResult *result)
Definition: space_clip.c:563
static void CLIP_GGT_navigate(wmGizmoGroupType *gzgt)
Definition: space_clip.c:723
static void clip_main_region_listener(const wmRegionListenerParams *params)
Definition: space_clip.c:919
static void clip_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const struct IDRemapper *mappings)
Definition: space_clip.c:1234
static void clip_props_region_listener(const wmRegionListenerParams *params)
Definition: space_clip.c:1160
static void clip_properties_region_init(wmWindowManager *wm, ARegion *region)
Definition: space_clip.c:1193
const char * clip_context_dir[]
Definition: space_clip.c:561
static void clip_keymap(struct wmKeyConfig *keyconf)
Definition: space_clip.c:543
static void clip_scopes_check_gpencil_change(ScrArea *area)
Definition: space_clip.c:207
static void clip_preview_region_draw(const bContext *C, ARegion *region)
Definition: space_clip.c:1048
static void clip_gizmos(void)
Definition: space_clip.c:728
void(* draw)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:151
void(* listener)(const wmRegionListenerParams *params)
Definition: BKE_screen.h:165
int keymapflag
Definition: BKE_screen.h:208
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
Definition: BKE_screen.h:147
ListBase handlers
short alignment
short regiontype
struct wmGizmoMap * gizmo_map
Definition: DNA_ID.h:368
struct Mask * mask
struct ImBuf * track_preview
struct ImBuf * track_search
void * tracking_context
struct MovieTracking tracking
MovieTrackingStabilization stabilization
struct RenderData r
ListBase regionbase
struct MovieClipUser user
float cursor[2]
float stabmat[4][4]
struct MovieClipScopes scopes
struct MovieClip * clip
MaskSpaceInfo mask_info
short flag
float minzoom
short align
short keeptot
float max[2]
short keepzoom
short keepofs
float min[2]
short scroll
float maxzoom
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
char path[1024]
Definition: WM_types.h:1150
int icon
Definition: WM_types.h:1146
int type
Definition: WM_types.h:1148
struct PointerRNA * ptr
Definition: WM_types.h:1237
unsigned int data
Definition: WM_types.h:308
unsigned int action
Definition: WM_types.h:308
unsigned int category
Definition: WM_types.h:308
struct wmKeyConfig * defaultconf
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames)
bool ED_time_scrub_event_in_region(const ARegion *region, const wmEvent *event)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
Definition: wm_dragdrop.cc:76
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *, wmDrag *, const wmEvent *), void(*copy)(bContext *, wmDrag *, wmDropBox *), void(*cancel)(Main *, wmDrag *, wmDropBox *), WMDropboxTooltipFunc tooltip)
Definition: wm_dragdrop.cc:95
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmEventHandler_Keymap * WM_event_add_keymap_handler_poll(ListBase *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoMapType * WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params)
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
Definition: wm_gizmo_map.c:483
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))