Blender V4.5
space_clip.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstring>
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_listbase.h"
21#include "BLI_path_utils.hh"
22#include "BLI_string.h"
23#include "BLI_utildefines.h"
24
25#include "BKE_context.hh"
26#include "BKE_lib_query.hh"
27#include "BKE_lib_remap.hh"
28#include "BKE_movieclip.h"
29#include "BKE_screen.hh"
30#include "BKE_tracking.h"
31
32#include "IMB_imbuf_types.hh"
33
34#include "ED_anim_api.hh" /* for timeline cursor drawing */
35#include "ED_clip.hh"
36#include "ED_mask.hh"
37#include "ED_screen.hh"
38#include "ED_space_api.hh"
39#include "ED_time_scrub_ui.hh"
40#include "ED_uvedit.hh" /* just for ED_image_draw_cursor */
41
42#include "IMB_imbuf.hh"
43
44#include "GPU_matrix.hh"
45
46#include "WM_api.hh"
47#include "WM_types.hh"
48
49#include "UI_interface.hh"
50#include "UI_resources.hh"
51#include "UI_view2d.hh"
52
53#include "BLO_read_write.hh"
54
55#include "RNA_access.hh"
56
57#include "clip_intern.hh" /* own include */
58
59/* -------------------------------------------------------------------- */
62
63static void init_preview_region(const Scene *scene,
64 const ScrArea *area,
65 const SpaceClip *sc,
66 ARegion *region)
67{
68 if (sc->view == SC_VIEW_DOPESHEET) {
69 region->v2d.tot.xmin = -10.0f;
70 region->v2d.tot.ymin = float(-area->winy) / 3.0f;
71 region->v2d.tot.xmax = float(area->winx);
72 region->v2d.tot.ymax = 0.0f;
73
74 region->v2d.cur = region->v2d.tot;
75
76 region->v2d.min[0] = 0.0f;
77 region->v2d.min[1] = 0.0f;
78
79 region->v2d.max[0] = MAXFRAMEF;
80 region->v2d.max[1] = FLT_MAX;
81
82 region->v2d.minzoom = 0.01f;
83 region->v2d.maxzoom = 50;
85 region->v2d.scroll |= V2D_SCROLL_RIGHT;
86 region->v2d.keepzoom = V2D_LOCKZOOM_Y;
87 region->v2d.keepofs = V2D_KEEPOFS_Y;
90 }
91 else {
92 region->v2d.tot.xmin = 0.0f;
93 region->v2d.tot.ymin = -10.0f;
94 region->v2d.tot.xmax = float(scene->r.efra);
95 region->v2d.tot.ymax = 10.0f;
96
97 region->v2d.cur = region->v2d.tot;
98
99 region->v2d.min[0] = FLT_MIN;
100 region->v2d.min[1] = FLT_MIN;
101
102 region->v2d.max[0] = MAXFRAMEF;
103 region->v2d.max[1] = FLT_MAX;
104
107
108 region->v2d.minzoom = 0.0f;
109 region->v2d.maxzoom = 0.0f;
110 region->v2d.keepzoom = 0;
111 region->v2d.keepofs = 0;
112 region->v2d.align = 0;
113 region->v2d.flag = 0;
114
115 region->v2d.keeptot = 0;
116 }
117}
118
120{
121 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
122
123 if (sc->mode != SC_MODE_TRACKING) {
124 return;
125 }
126
127 /* only while properties are visible */
128 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
129 if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) {
130 return;
131 }
132 }
133
134 sc->scopes.ok = false;
135}
136
138{
139 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
140
143 }
144}
145
146static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
147{
148 SpaceClip *space_clip = (SpaceClip *)area->spacedata.first;
149 BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra);
150}
151
153
154/* -------------------------------------------------------------------- */
157
158static SpaceLink *clip_create(const ScrArea * /*area*/, const Scene * /*scene*/)
159{
160 ARegion *region;
161 SpaceClip *sc;
162
164
165 /* header */
166 region = BKE_area_region_new();
167
168 BLI_addtail(&sc->regionbase, region);
169 region->regiontype = RGN_TYPE_HEADER;
171
172 /* tools view */
173 region = BKE_area_region_new();
174
175 BLI_addtail(&sc->regionbase, region);
176 region->regiontype = RGN_TYPE_TOOLS;
177 region->alignment = RGN_ALIGN_LEFT;
178
179 /* properties view */
180 region = BKE_area_region_new();
181
182 BLI_addtail(&sc->regionbase, region);
183 region->regiontype = RGN_TYPE_UI;
184 region->alignment = RGN_ALIGN_RIGHT;
185
186 /* channels view */
187 region = BKE_area_region_new();
188
189 BLI_addtail(&sc->regionbase, region);
191 region->alignment = RGN_ALIGN_LEFT;
192
193 region->v2d.scroll = V2D_SCROLL_BOTTOM;
195
196 /* preview view */
197 region = BKE_area_region_new();
198
199 BLI_addtail(&sc->regionbase, region);
201
202 /* main region */
203 region = BKE_area_region_new();
204
205 BLI_addtail(&sc->regionbase, region);
206 region->regiontype = RGN_TYPE_WINDOW;
207
208 return (SpaceLink *)sc;
209}
210
211/* Doesn't free the space-link itself. */
212static void clip_free(SpaceLink *sl)
213{
214 SpaceClip *sc = (SpaceClip *)sl;
215
216 sc->clip = nullptr;
217
218 if (sc->scopes.track_preview) {
220 }
221
222 if (sc->scopes.track_search) {
224 }
225}
226
227/* spacetype; init callback */
228static void clip_init(wmWindowManager * /*wm*/, ScrArea *area)
229{
231
232 /* add drop boxes */
234}
235
237{
238 SpaceClip *scn = MEM_dupallocN("clip_duplicate", *reinterpret_cast<SpaceClip *>(sl));
239
240 /* clear or remove stuff from old */
241 scn->scopes.track_search = nullptr;
242 scn->scopes.track_preview = nullptr;
243 scn->scopes.ok = false;
244
245 return (SpaceLink *)scn;
246}
247
249{
250 ScrArea *area = params->area;
251 const wmNotifier *wmn = params->notifier;
252 const Scene *scene = params->scene;
253
254 /* context changes */
255 switch (wmn->category) {
256 case NC_SCENE:
257 switch (wmn->data) {
258 case ND_FRAME:
261
262 case ND_FRAME_RANGE:
263 ED_area_tag_redraw(area);
264 break;
265 }
266 break;
267 case NC_MOVIECLIP:
268 switch (wmn->data) {
269 case ND_DISPLAY:
270 case ND_SELECT:
272 ED_area_tag_redraw(area);
273 break;
274 }
275 switch (wmn->action) {
276 case NA_REMOVED:
277 case NA_EDITED:
278 case NA_EVALUATED:
279 /* fall-through */
280
281 case NA_SELECTED:
283 ED_area_tag_redraw(area);
284 break;
285 }
286 break;
287 case NC_MASK:
288 switch (wmn->data) {
289 case ND_SELECT:
290 case ND_DATA:
291 case ND_DRAW:
292 ED_area_tag_redraw(area);
293 break;
294 }
295 switch (wmn->action) {
296 case NA_SELECTED:
297 ED_area_tag_redraw(area);
298 break;
299 case NA_EDITED:
300 ED_area_tag_redraw(area);
301 break;
302 }
303 break;
304 case NC_GEOM:
305 switch (wmn->data) {
306 case ND_SELECT:
308 ED_area_tag_redraw(area);
309 break;
310 }
311 break;
312 case NC_SCREEN:
313 switch (wmn->data) {
314 case ND_ANIMPLAY:
315 ED_area_tag_redraw(area);
316 break;
317 case ND_LAYOUTSET:
319 break;
320 }
321 break;
322 case NC_SPACE:
323 if (wmn->data == ND_SPACE_CLIP) {
325 ED_area_tag_redraw(area);
326 }
327 break;
328 case NC_GPENCIL:
329 if (wmn->action == NA_EDITED) {
331 ED_area_tag_redraw(area);
332 }
333 else if (wmn->data & ND_GPENCIL_EDITMODE) {
334 ED_area_tag_redraw(area);
335 }
336 break;
337 case NC_WM:
338 switch (wmn->data) {
339 case ND_FILEREAD:
340 case ND_UNDO:
342 break;
343 }
344 break;
345 }
346}
347
349{
350 /* `clip_ops.cc` */
364#ifdef WITH_INPUT_NDOF
365 WM_operatortype_append(CLIP_OT_view_ndof);
366#endif
371
372 /* `tracking_ops.cc` */
373
374 /* navigation */
376
377 /* selection */
384
385 /* markers */
391
392 /* track */
395
396 /* solving */
399
404
406
407 /* orientation */
414
415 /* detect */
417
418 /* stabilization */
425
426 /* clean-up */
431
433
434 /* object tracking */
437
438 /* clipboard */
441
442 /* Plane tracker */
445
448
451
452 /* `clip_graph_ops.cc` */
453
454 /* graph editing */
455
456 /* selection */
460
465
467
468 /* `clip_dopesheet_ops.cc` */
469
472}
473
474static void clip_keymap(wmKeyConfig *keyconf)
475{
476 /* ******** Global hotkeys available for all regions ******** */
478
479 /* ******** Hotkeys available for main region only ******** */
480 WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
481 // keymap->poll = ED_space_clip_tracking_poll;
482
483 /* ******** Hotkeys available for preview region only ******** */
484 WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
485
486 /* ******** Hotkeys available for channels region only ******** */
487 WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
488}
489
490/* DO NOT make this static, this hides the symbol and breaks API generation script. */
491extern "C" const char *clip_context_dir[]; /* quiet warning. */
492const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", nullptr};
493
494static int /*eContextResult*/ clip_context(const bContext *C,
495 const char *member,
497{
499
500 if (CTX_data_dir(member)) {
502
503 return CTX_RESULT_OK;
504 }
505 if (CTX_data_equals(member, "edit_movieclip")) {
506 if (sc->clip) {
508 }
509 return CTX_RESULT_OK;
510 }
511 if (CTX_data_equals(member, "edit_mask")) {
512 if (sc->mask_info.mask) {
514 }
515 return CTX_RESULT_OK;
516 }
517
519}
520
521/* dropboxes */
522static bool clip_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
523{
524 if (drag->type == WM_DRAG_PATH) {
526 if (ELEM(file_type, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE)) {
527 return true;
528 }
529 }
530
531 return false;
532}
533
534static void clip_drop_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
535{
536 PointerRNA itemptr;
537 char dir[FILE_MAX], file[FILE_MAX];
538
539 BLI_path_split_dir_file(WM_drag_get_single_path(drag), dir, sizeof(dir), file, sizeof(file));
540
541 RNA_string_set(drop->ptr, "directory", dir);
542
543 RNA_collection_clear(drop->ptr, "files");
544 RNA_collection_add(drop->ptr, "files", &itemptr);
545 RNA_string_set(&itemptr, "name", file);
546}
547
548/* area+region dropbox definition */
549static void clip_dropboxes()
550{
552
553 WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
554}
555
556static void clip_refresh(const bContext *C, ScrArea *area)
557{
558 Scene *scene = CTX_data_scene(C);
559 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
560
561 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
562 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
563 init_preview_region(scene, area, sc, region_preview);
564 region_preview->v2d.cur = region_preview->v2d.tot;
565 }
566 /* #V2D_VIEWSYNC_AREA_VERTICAL must always be set for the dopesheet view, in graph view it must
567 * be unset. This is enforced by region re-initialization.
568 * That means if it's not set correctly, the view just changed and needs re-initialization */
569 else if (sc->view == SC_VIEW_DOPESHEET) {
570 if ((region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
571 init_preview_region(scene, area, sc, region_preview);
572 }
573 }
574 else {
575 if (region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
576 init_preview_region(scene, area, sc, region_preview);
577 }
578 }
579
581}
582
584{
585 VIEW2D_GGT_navigate_impl(gzgt, "CLIP_GGT_navigate");
586}
587
588static void clip_gizmos()
589{
591 wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gizmo_params);
592
594}
595
597
598/* -------------------------------------------------------------------- */
601
602/* sets up the fields of the View2D from zoom and offset */
604{
606 float x1, y1, w, h, aspx, aspy;
607 int width, height, winx, winy;
608
609 ED_space_clip_get_size(sc, &width, &height);
610 ED_space_clip_get_aspect(sc, &aspx, &aspy);
611
612 w = width * aspx;
613 h = height * aspy;
614
615 winx = BLI_rcti_size_x(&region->winrct) + 1;
616 winy = BLI_rcti_size_y(&region->winrct) + 1;
617
618 region->v2d.tot.xmin = 0;
619 region->v2d.tot.ymin = 0;
620 region->v2d.tot.xmax = w;
621 region->v2d.tot.ymax = h;
622
623 region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
624 region->v2d.mask.xmax = winx;
625 region->v2d.mask.ymax = winy;
626
627 /* which part of the image space do we see? */
628 x1 = region->winrct.xmin + (winx - sc->zoom * w) / 2.0f;
629 y1 = region->winrct.ymin + (winy - sc->zoom * h) / 2.0f;
630
631 x1 -= sc->zoom * sc->xof;
632 y1 -= sc->zoom * sc->yof;
633
634 /* relative display right */
635 region->v2d.cur.xmin = (region->winrct.xmin - x1) / sc->zoom;
636 region->v2d.cur.xmax = region->v2d.cur.xmin + (float(winx) / sc->zoom);
637
638 /* relative display left */
639 region->v2d.cur.ymin = (region->winrct.ymin - y1) / sc->zoom;
640 region->v2d.cur.ymax = region->v2d.cur.ymin + (float(winy) / sc->zoom);
641
642 /* normalize 0.0..1.0 */
643 region->v2d.cur.xmin /= w;
644 region->v2d.cur.xmax /= w;
645 region->v2d.cur.ymin /= h;
646 region->v2d.cur.ymax /= h;
647}
648
650{
651 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
652 return ELEM(sclip->view, SC_VIEW_CLIP);
653}
654
655/* add handlers, stuff you only do once or on area/region changes */
657{
658 wmKeyMap *keymap;
659
660 /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
661 * since the space clip manages its own v2d in #movieclip_main_area_set_view2d */
662
663 /* mask polls mode */
664 keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
665 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
666
667 /* own keymap */
669 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
670
671 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
672 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
673}
674
675static void clip_main_region_draw(const bContext *C, ARegion *region)
676{
677 /* draw entirely, view changes should be handled here */
680 float aspx, aspy, zoomx, zoomy, x, y;
681 int width, height;
682 bool show_cursor = false;
683
684 /* If tracking is in progress, we should synchronize the frame from the clip-user
685 * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
686 if (clip && clip->tracking_context) {
688 &sc->user);
689 }
690
691 if (sc->flag & SC_LOCK_SELECTION) {
692 ImBuf *tmpibuf = nullptr;
693
695 tmpibuf = ED_space_clip_get_stable_buffer(sc, nullptr, nullptr, nullptr);
696 }
697
698 if (ED_clip_view_selection(C, region, false)) {
699 sc->xof += sc->xlockof;
700 sc->yof += sc->ylockof;
701 }
702
703 if (tmpibuf) {
704 IMB_freeImBuf(tmpibuf);
705 }
706 }
707
708 /* clear and setup matrix */
710
711 /* data... */
713
714 /* callback */
716
717 clip_draw_main(C, sc, region);
718
719 /* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
720 UI_view2d_view_to_region_fl(&region->v2d, 0.0f, 0.0f, &x, &y);
721 ED_space_clip_get_size(sc, &width, &height);
722 ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
723 ED_space_clip_get_aspect(sc, &aspx, &aspy);
724
725 if (sc->mode == SC_MODE_MASKEDIT) {
727 if (mask && clip) {
728 ScrArea *area = CTX_wm_area(C);
729 int mask_width, mask_height;
730 ED_mask_get_size(area, &mask_width, &mask_height);
732 mask,
733 region,
738 mask_width,
739 mask_height,
740 aspx,
741 aspy,
742 true,
743 true,
744 sc->stabmat,
745 C);
746 }
747 }
748
749 show_cursor |= sc->mode == SC_MODE_MASKEDIT;
750 show_cursor |= sc->around == V3D_AROUND_CURSOR;
751
752 if (show_cursor) {
755 GPU_matrix_scale_2f(zoomx, zoomy);
757 GPU_matrix_scale_2f(width, height);
758 ED_image_draw_cursor(region, sc->cursor);
760 }
761
762 clip_draw_cache_and_notes(C, sc, region);
763
764 if (sc->flag & SC_SHOW_ANNOTATION) {
765 /* Grease Pencil */
767 }
768
769 /* callback */
770 /* TODO(sergey): For being consistent with space image the projection needs to be configured
771 * the way how the commented out code does it. This works correct for tracking data, but it
772 * causes wrong aspect correction for mask editor (see #84990). */
773 // GPU_matrix_push_projection();
774 // wmOrtho2(region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin,
775 // region->v2d.cur.ymax);
777 // GPU_matrix_pop_projection();
778
779 /* reset view matrix */
781
782 if (sc->flag & SC_SHOW_ANNOTATION) {
783 /* draw Grease Pencil - screen space only */
785 }
786 if ((sc->gizmo_flag & SCLIP_GIZMO_HIDE) == 0) {
788 }
789}
790
792{
793 ARegion *region = params->region;
794 const wmNotifier *wmn = params->notifier;
795
796 /* context changes */
797 switch (wmn->category) {
798 case NC_GPENCIL:
799 if (wmn->action == NA_EDITED) {
800 ED_region_tag_redraw(region);
801 }
802 else if (wmn->data & ND_GPENCIL_EDITMODE) {
803 ED_region_tag_redraw(region);
804 }
805 break;
806 }
807}
808
810
811/* -------------------------------------------------------------------- */
814
816{
817 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
818 return ELEM(sclip->view, SC_VIEW_GRAPH, SC_VIEW_DOPESHEET);
819}
820
822{
823 wmKeyMap *keymap;
824
825 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
826
827 /* own keymap */
828
830 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
831
832 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Time Scrub", SPACE_CLIP, RGN_TYPE_PREVIEW);
834 &region->runtime->handlers, keymap, ED_time_scrub_event_in_region_poll);
835
836 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
837 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
838
839 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
840 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
841}
842
843static void graph_region_draw(const bContext *C, ARegion *region)
844{
845 View2D *v2d = &region->v2d;
847 Scene *scene = CTX_data_scene(C);
848 short cfra_flag = 0;
849 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
850
851 if (sc->flag & SC_LOCK_TIMECURSOR) {
853 }
854
855 /* clear and setup matrix */
857
859
860 /* data... */
861 clip_draw_graph(sc, region, scene);
862
863 /* current frame indicator line */
864 if (sc->flag & SC_SHOW_SECONDS) {
865 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
866 }
867 ANIM_draw_cfra(C, v2d, cfra_flag);
868
869 /* reset view matrix */
871
872 /* time-scrubbing */
873 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
874
875 /* current frame indicator */
876 ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS, !minimized);
877
878 /* scrollers */
879 if (!minimized) {
880 const rcti scroller_mask = ED_time_scrub_clamp_scroller_mask(v2d->mask);
881 region->v2d.scroll |= V2D_SCROLL_BOTTOM;
882 UI_view2d_scrollers_draw(v2d, &scroller_mask);
883 }
884 else {
885 region->v2d.scroll &= ~V2D_SCROLL_BOTTOM;
886 }
887
888 /* scale indicators */
889 {
890 rcti rect;
892 &rect, 0, 15 * UI_SCALE_FAC, 15 * UI_SCALE_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y);
893 UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT);
894 }
895}
896
897static void dopesheet_region_draw(const bContext *C, ARegion *region)
898{
899 Scene *scene = CTX_data_scene(C);
902 View2D *v2d = &region->v2d;
903 short cfra_flag = 0;
904 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
905
906 if (clip) {
908 }
909
910 /* clear and setup matrix */
912
914
915 /* time grid */
916 if (!minimized) {
918 v2d, scene, sc->flag & SC_SHOW_SECONDS, true);
919 }
920
921 /* data... */
922 clip_draw_dopesheet_main(sc, region, scene);
923
924 /* current frame indicator line */
925 if (sc->flag & SC_SHOW_SECONDS) {
926 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
927 }
928 ANIM_draw_cfra(C, v2d, cfra_flag);
929
930 /* reset view matrix */
932
933 /* time-scrubbing */
934 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
935
936 /* current frame indicator */
937 ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS, !minimized);
938
939 /* scrollers */
940 if (!minimized) {
941 region->v2d.scroll |= V2D_SCROLL_BOTTOM;
942 UI_view2d_scrollers_draw(v2d, nullptr);
943 }
944 else {
945 region->v2d.scroll &= ~V2D_SCROLL_BOTTOM;
946 }
947}
948
949static void clip_preview_region_draw(const bContext *C, ARegion *region)
950{
952
953 if (sc->view == SC_VIEW_GRAPH) {
954 graph_region_draw(C, region);
955 }
956 else if (sc->view == SC_VIEW_DOPESHEET) {
957 dopesheet_region_draw(C, region);
958 }
959}
960
961static void clip_preview_region_listener(const wmRegionListenerParams * /*params*/) {}
962
964
965/* -------------------------------------------------------------------- */
968
970{
971 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
972 return ELEM(sclip->view, SC_VIEW_DOPESHEET);
973}
974
976{
977 wmKeyMap *keymap;
978
979 /* ensure the 2d view sync works - main region has bottom scroller */
980 region->v2d.scroll = V2D_SCROLL_BOTTOM;
981
982 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
983
984 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
985 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
986}
987
988static void clip_channels_region_draw(const bContext *C, ARegion *region)
989{
992 View2D *v2d = &region->v2d;
993
994 if (clip) {
996 }
997
998 /* clear and setup matrix */
1000
1002
1003 /* data... */
1005
1006 /* reset view matrix */
1008}
1009
1011
1013
1014/* -------------------------------------------------------------------- */
1017
1018/* add handlers, stuff you only do once or on area/region changes */
1020{
1021 ED_region_header_init(region);
1022}
1023
1024static void clip_header_region_draw(const bContext *C, ARegion *region)
1025{
1026 ED_region_header(C, region);
1027}
1028
1030{
1031 ARegion *region = params->region;
1032 const wmNotifier *wmn = params->notifier;
1033
1034 /* context changes */
1035 switch (wmn->category) {
1036 case NC_SCENE:
1037 switch (wmn->data) {
1038 /* for proportional editmode only */
1039 case ND_TOOLSETTINGS:
1040 /* TODO: should do this when in mask mode only but no data available. */
1041 // if (sc->mode == SC_MODE_MASKEDIT)
1042 {
1043 ED_region_tag_redraw(region);
1044 break;
1045 }
1046 }
1047 break;
1048 }
1049}
1050
1052
1053/* -------------------------------------------------------------------- */
1056
1058{
1059 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1060 return ELEM(sclip->view, SC_VIEW_CLIP);
1061}
1062
1063/* add handlers, stuff you only do once or on area/region changes */
1065{
1066 wmKeyMap *keymap;
1067
1068 ED_region_panels_init(wm, region);
1069
1071 WM_event_add_keymap_handler(&region->runtime->handlers, keymap);
1072}
1073
1074static void clip_tools_region_draw(const bContext *C, ARegion *region)
1075{
1076 ED_region_panels(C, region);
1077}
1078
1080
1081/* -------------------------------------------------------------------- */
1084
1086{
1087 ARegion *region = params->region;
1088 const wmNotifier *wmn = params->notifier;
1089
1090 /* context changes */
1091 switch (wmn->category) {
1092 case NC_WM:
1093 if (wmn->data == ND_HISTORY) {
1094 ED_region_tag_redraw(region);
1095 }
1096 break;
1097 case NC_SCENE:
1098 if (wmn->data == ND_MODE) {
1099 ED_region_tag_redraw(region);
1100 }
1101 break;
1102 case NC_SPACE:
1103 if (wmn->data == ND_SPACE_CLIP) {
1104 ED_region_tag_redraw(region);
1105 }
1106 break;
1107 case NC_GPENCIL:
1108 if (wmn->action == NA_EDITED) {
1109 ED_region_tag_redraw(region);
1110 }
1111 break;
1112 }
1113}
1114
1116
1117/* -------------------------------------------------------------------- */
1120
1122{
1123 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1124 return ELEM(sclip->view, SC_VIEW_CLIP);
1125}
1126
1127/* add handlers, stuff you only do once or on area/region changes */
1129{
1130 wmKeyMap *keymap;
1131
1132 ED_region_panels_init(wm, region);
1133
1135 WM_event_add_keymap_handler(&region->runtime->handlers, keymap);
1136}
1137
1138static void clip_properties_region_draw(const bContext *C, ARegion *region)
1139{
1141
1143
1144 ED_region_panels(C, region);
1145}
1146
1148{
1149 ARegion *region = params->region;
1150 const wmNotifier *wmn = params->notifier;
1151
1152 /* context changes */
1153 switch (wmn->category) {
1154 case NC_GPENCIL:
1155 if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE)) {
1156 ED_region_tag_redraw(region);
1157 }
1158 break;
1159 case NC_BRUSH:
1160 if (wmn->action == NA_EDITED) {
1161 ED_region_tag_redraw(region);
1162 }
1163 break;
1164 }
1165}
1166
1168
1169/* -------------------------------------------------------------------- */
1172
1173static void clip_id_remap(ScrArea * /*area*/,
1174 SpaceLink *slink,
1175 const blender::bke::id::IDRemapper &mappings)
1176{
1177 SpaceClip *sclip = (SpaceClip *)slink;
1178
1180 return;
1181 }
1182
1183 mappings.apply(reinterpret_cast<ID **>(&sclip->clip), ID_REMAP_APPLY_ENSURE_REAL);
1184 mappings.apply(reinterpret_cast<ID **>(&sclip->mask_info.mask), ID_REMAP_APPLY_ENSURE_REAL);
1185}
1186
1188{
1189 SpaceClip *sclip = reinterpret_cast<SpaceClip *>(space_link);
1190 const int data_flags = BKE_lib_query_foreachid_process_flags_get(data);
1191 const bool is_readonly = (data_flags & IDWALK_READONLY) != 0;
1192
1197
1198 if (!is_readonly) {
1199 sclip->scopes.ok = 0;
1200 }
1201}
1202
1204{
1205 SpaceClip *sclip = (SpaceClip *)sl;
1206
1207 sclip->scopes.track_search = nullptr;
1208 sclip->scopes.track_preview = nullptr;
1209 sclip->scopes.ok = 0;
1210}
1211
1213{
1214 BLO_write_struct(writer, SpaceClip, sl);
1215}
1216
1218
1219/* -------------------------------------------------------------------- */
1222
1224{
1225 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1226 ARegionType *art;
1227
1228 st->spaceid = SPACE_CLIP;
1229 STRNCPY(st->name, "Clip");
1230
1231 st->create = clip_create;
1232 st->free = clip_free;
1233 st->init = clip_init;
1234 st->duplicate = clip_duplicate;
1235 st->operatortypes = clip_operatortypes;
1236 st->keymap = clip_keymap;
1237 st->listener = clip_listener;
1238 st->context = clip_context;
1239 st->gizmos = clip_gizmos;
1240 st->dropboxes = clip_dropboxes;
1241 st->refresh = clip_refresh;
1242 st->id_remap = clip_id_remap;
1243 st->foreach_id = clip_foreach_id;
1244 st->blend_read_data = clip_space_blend_read_data;
1245 st->blend_read_after_liblink = nullptr;
1246 st->blend_write = clip_space_blend_write;
1247
1248 /* regions: main window */
1249 art = MEM_callocN<ARegionType>("spacetype clip region");
1256
1257 BLI_addhead(&st->regiontypes, art);
1258
1259 /* preview */
1260 art = MEM_callocN<ARegionType>("spacetype clip region preview");
1262 art->prefsizey = 240;
1268
1269 BLI_addhead(&st->regiontypes, art);
1270
1271 /* regions: properties */
1272 art = MEM_callocN<ARegionType>("spacetype clip region properties");
1273 art->regionid = RGN_TYPE_UI;
1280 BLI_addhead(&st->regiontypes, art);
1282
1283 /* regions: tools */
1284 art = MEM_callocN<ARegionType>("spacetype clip region tools");
1285 art->regionid = RGN_TYPE_TOOLS;
1292
1293 BLI_addhead(&st->regiontypes, art);
1294
1295 /* regions: header */
1296 art = MEM_callocN<ARegionType>("spacetype clip region");
1298 art->prefsizey = HEADERY;
1300
1304
1305 BLI_addhead(&st->regiontypes, art);
1306
1307 /* channels */
1308 art = MEM_callocN<ARegionType>("spacetype clip channels region");
1316
1317 BLI_addhead(&st->regiontypes, art);
1318
1319 /* regions: hud */
1320 art = ED_area_type_hud(st->spaceid);
1321 BLI_addhead(&st->regiontypes, art);
1322
1323 BKE_spacetype_register(std::move(st));
1324}
1325
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
bool CTX_data_equals(const char *member, const char *str)
Mask * CTX_data_edit_mask(const bContext *C)
bool CTX_data_dir(const char *member)
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
ScrArea * CTX_wm_area(const bContext *C)
@ CTX_RESULT_MEMBER_NOT_FOUND
@ CTX_RESULT_OK
Scene * CTX_data_scene(const bContext *C)
SpaceClip * CTX_wm_space_clip(const bContext *C)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
@ IDWALK_CB_USER_ONE
@ IDWALK_CB_DIRECT_WEAK_LINK
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:129
@ IDWALK_READONLY
@ ID_REMAP_APPLY_ENSURE_REAL
void BKE_movieclip_update_scopes(struct MovieClip *clip, const struct MovieClipUser *user, struct MovieClipScopes *scopes)
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr)
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:276
ARegion * BKE_area_region_new()
Definition screen.cc:381
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:840
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking)
Definition tracking.cc:3445
void BKE_autotrack_context_sync_user(struct AutoTrackContext *context, struct MovieClipUser *user)
#define ATTR_FALLTHROUGH
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:91
#define FILE_MAX
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:198
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition rct.cc:414
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:194
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
#define ELEM(...)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define DNA_struct_default_alloc(struct_name)
eMaskOverlayMode
#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
eFileSel_File_Types
@ FILE_TYPE_MOVIE
@ FILE_TYPE_IMAGE
@ SPACE_CLIP
@ SPACE_EMPTY
@ 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
@ SCLIP_GIZMO_HIDE
@ SC_GPENCIL_SRC_TRACK
#define UI_SCALE_FAC
@ TRACKING_2D_STABILIZATION
@ USER_HEADER_BOTTOM
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_POS_Y
@ V2D_KEEPOFS_Y
@ V2D_LOCKZOOM_Y
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V3D_AROUND_CURSOR
@ DRAWCFRA_UNIT_SECONDS
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
void ED_space_clip_get_size(const SpaceClip *sc, int *r_width, int *r_height)
void ED_space_clip_get_zoom(const SpaceClip *sc, const ARegion *region, float *r_zoomx, float *r_zoomy)
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
bool ED_clip_view_selection(const bContext *C, const ARegion *region, bool fit)
ImBuf * ED_space_clip_get_stable_buffer(const SpaceClip *sc, float loc[2], float *scale, float *angle)
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
void ED_mask_draw_region(Depsgraph *depsgraph, Mask *mask, 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 bContext *C)
Definition mask_draw.cc:641
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:714
ARegionType * ED_area_type_hud(int space_type)
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3462
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3750
void ED_region_header_init(ARegion *region)
Definition area.cc:3765
@ ED_KEYMAP_UI
Definition ED_screen.hh:740
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:746
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:748
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:741
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:743
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:745
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:3469
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:639
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
void ED_image_draw_cursor(ARegion *region, const float cursor[2])
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push()
#define GPU_matrix_mul(x)
void GPU_matrix_pop()
void GPU_matrix_translate_2f(float x, float y)
void IMB_freeImBuf(ImBuf *ibuf)
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_COMPACT_PANEL_WIDTH
@ TH_TIME_SCRUB_BACKGROUND
@ TH_BACK
@ TH_TEXT
void UI_ThemeClearColor(int colorid)
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1503
void UI_view2d_view_restore(const bContext *C)
Definition view2d.cc:1162
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:221
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:471
void UI_view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1095
void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const View2D *v2d, const Scene *scene, bool display_seconds, bool display_minor_lines)
void UI_view2d_view_to_region_fl(const View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL()
Definition view2d.cc:1738
void UI_view2d_draw_scale_y__values(const ARegion *region, const View2D *v2d, const rcti *rect, int colorid)
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:35
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:31
@ WM_GIZMOMAP_DRAWSTEP_2D
#define ND_FILEREAD
Definition WM_types.hh:409
#define NC_GEOM
Definition WM_types.hh:390
#define ND_DRAW
Definition WM_types.hh:458
#define NC_BRUSH
Definition WM_types.hh:382
#define NC_WM
Definition WM_types.hh:371
#define ND_DATA
Definition WM_types.hh:506
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:501
#define NA_EVALUATED
Definition WM_types.hh:582
#define ND_DISPLAY
Definition WM_types.hh:488
#define NC_SCREEN
Definition WM_types.hh:374
#define NC_MOVIECLIP
Definition WM_types.hh:394
#define ND_MODE
Definition WM_types.hh:442
#define ND_ANIMPLAY
Definition WM_types.hh:421
#define NC_SCENE
Definition WM_types.hh:375
#define ND_TOOLSETTINGS
Definition WM_types.hh:446
#define NA_EDITED
Definition WM_types.hh:581
#define ND_FRAME_RANGE
Definition WM_types.hh:448
#define ND_SPACE_CLIP
Definition WM_types.hh:536
#define ND_UNDO
Definition WM_types.hh:414
#define ND_FRAME
Definition WM_types.hh:431
#define NA_REMOVED
Definition WM_types.hh:584
#define ND_SELECT
Definition WM_types.hh:505
#define NC_GPENCIL
Definition WM_types.hh:396
#define NC_MASK
Definition WM_types.hh:395
#define ND_HISTORY
Definition WM_types.hh:412
@ WM_DRAG_PATH
Definition WM_types.hh:1205
#define ND_LAYOUTSET
Definition WM_types.hh:423
#define NC_SPACE
Definition WM_types.hh:389
#define NA_SELECTED
Definition WM_types.hh:586
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition anim_draw.cc:47
#define U
BMesh const char void * data
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
bool contains_mappings_for_any(IDTypeFilter filter) const
void ED_clip_buttons_register(ARegionType *art)
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)
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
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_paste_tracks(wmOperatorType *ot)
void CLIP_OT_create_plane_track(wmOperatorType *ot)
void CLIP_OT_delete_marker(wmOperatorType *ot)
void CLIP_OT_set_origin(wmOperatorType *ot)
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
Definition clip_ops.cc:781
void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:890
void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot)
void CLIP_OT_track_copy_color(wmOperatorType *ot)
void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
void CLIP_OT_cursor_set(wmOperatorType *ot)
Definition clip_ops.cc:1815
void CLIP_OT_keyframe_delete(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot)
void CLIP_OT_select_circle(wmOperatorType *ot)
void CLIP_OT_mode_set(wmOperatorType *ot)
Definition clip_ops.cc:1610
void CLIP_OT_clear_solution(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition clip_ops.cc:715
void CLIP_OT_hide_tracks(wmOperatorType *ot)
void CLIP_OT_track_markers(wmOperatorType *ot)
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
Definition clip_ops.cc:838
void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
void CLIP_OT_open(wmOperatorType *ot)
Definition clip_ops.cc:303
void CLIP_OT_detect_features(wmOperatorType *ot)
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1763
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1163
void CLIP_OT_lock_tracks(wmOperatorType *ot)
void CLIP_OT_average_tracks(wmOperatorType *ot)
void CLIP_OT_view_selected(wmOperatorType *ot)
Definition clip_ops.cc:1044
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
void CLIP_OT_set_axis(wmOperatorType *ot)
void CLIP_OT_tracking_object_new(wmOperatorType *ot)
void CLIP_OT_keyframe_insert(wmOperatorType *ot)
void CLIP_OT_select_lasso(wmOperatorType *ot)
void CLIP_OT_copy_tracks(wmOperatorType *ot)
void CLIP_OT_select_all(wmOperatorType *ot)
void CLIP_OT_slide_marker(wmOperatorType *ot)
void CLIP_OT_solve_camera(wmOperatorType *ot)
void CLIP_OT_prefetch(wmOperatorType *ot)
Definition clip_ops.cc:1722
void CLIP_OT_set_scale(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_select(wmOperatorType *ot)
void CLIP_OT_view_center_cursor(wmOperatorType *ot)
Definition clip_ops.cc:1012
void CLIP_OT_select_box(wmOperatorType *ot)
void CLIP_OT_add_marker_at_click(wmOperatorType *ot)
void CLIP_OT_clean_tracks(wmOperatorType *ot)
void CLIP_OT_join_tracks(wmOperatorType *ot)
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
Definition clip_ops.cc:1572
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1865
void CLIP_OT_slide_plane_marker(wmOperatorType *ot)
void CLIP_OT_refine_markers(wmOperatorType *ot)
void CLIP_OT_select_grouped(wmOperatorType *ot)
void CLIP_OT_delete_track(wmOperatorType *ot)
void CLIP_OT_add_marker(wmOperatorType *ot)
void CLIP_OT_select(wmOperatorType *ot)
void CLIP_OT_update_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_view_pan(wmOperatorType *ot)
Definition clip_ops.cc:508
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:973
void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
void CLIP_OT_disable_markers(wmOperatorType *ot)
void CLIP_OT_set_plane(wmOperatorType *ot)
void CLIP_OT_new_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_reload(wmOperatorType *ot)
Definition clip_ops.cc:350
void CLIP_OT_clear_track_path(wmOperatorType *ot)
void CLIP_OT_frame_jump(wmOperatorType *ot)
#define FILTER_ID_MC
#define FILTER_ID_MSK
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void * MEM_dupallocN(const void *vmemh)
Definition mallocn.cc:143
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
static bool clip_main_region_poll(const RegionPollParams *params)
static void clip_id_remap(ScrArea *, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
static void clip_scopes_tag_refresh(ScrArea *area)
static void clip_refresh(const bContext *C, ScrArea *area)
static bool clip_drop_poll(bContext *, wmDrag *drag, const wmEvent *)
static void clip_listener(const wmSpaceTypeListenerParams *params)
static bool clip_tools_region_poll(const RegionPollParams *params)
static void clip_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
static SpaceLink * clip_create(const ScrArea *, const Scene *)
static void clip_header_region_listener(const wmRegionListenerParams *params)
static void clip_header_region_draw(const bContext *C, ARegion *region)
static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
static void clip_free(SpaceLink *sl)
static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
static bool clip_preview_region_poll(const RegionPollParams *params)
static void clip_properties_region_draw(const bContext *C, ARegion *region)
static void clip_dropboxes()
void ED_spacetype_clip()
static void clip_preview_region_init(wmWindowManager *wm, ARegion *region)
static void dopesheet_region_draw(const bContext *C, ARegion *region)
static void graph_region_draw(const bContext *C, ARegion *region)
static void clip_header_region_init(wmWindowManager *, ARegion *region)
static void clip_operatortypes()
static void clip_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void clip_keymap(wmKeyConfig *keyconf)
static bool clip_channels_region_poll(const RegionPollParams *params)
static void clip_properties_region_listener(const wmRegionListenerParams *params)
static SpaceLink * clip_duplicate(SpaceLink *sl)
static void init_preview_region(const Scene *scene, const ScrArea *area, const SpaceClip *sc, ARegion *region)
Definition space_clip.cc:63
static void clip_tools_region_init(wmWindowManager *wm, ARegion *region)
static void clip_space_blend_write(BlendWriter *writer, SpaceLink *sl)
static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
static bool clip_properties_region_poll(const RegionPollParams *params)
static void clip_main_region_draw(const bContext *C, ARegion *region)
static void clip_tools_region_draw(const bContext *C, ARegion *region)
static void clip_channels_region_listener(const wmRegionListenerParams *)
static void clip_channels_region_init(wmWindowManager *wm, ARegion *region)
static void clip_channels_region_draw(const bContext *C, ARegion *region)
static int clip_context(const bContext *C, const char *member, bContextDataResult *result)
static void CLIP_GGT_navigate(wmGizmoGroupType *gzgt)
static void clip_preview_region_listener(const wmRegionListenerParams *)
static void clip_main_region_listener(const wmRegionListenerParams *params)
static void clip_props_region_listener(const wmRegionListenerParams *params)
static void clip_properties_region_init(wmWindowManager *wm, ARegion *region)
static void clip_gizmos()
const char * clip_context_dir[]
static void clip_drop_copy(bContext *, wmDrag *drag, wmDropBox *drop)
static void clip_scopes_check_gpencil_change(ScrArea *area)
static void clip_preview_region_draw(const bContext *C, ARegion *region)
static void clip_init(wmWindowManager *, ScrArea *area)
#define FLT_MAX
Definition stdcycles.h:14
bool(* poll)(const RegionPollParams *params)
void(* listener)(const wmRegionListenerParams *params)
void(* draw)(const bContext *C, ARegion *region)
void(* init)(wmWindowManager *wm, ARegion *region)
ARegionRuntimeHandle * runtime
Definition DNA_ID.h:404
void * first
struct Mask * mask
struct ImBuf * track_preview
struct ImBuf * track_search
void * tracking_context
struct MovieTracking tracking
MovieTrackingStabilization stabilization
struct RenderData r
ListBase handlers
ListBase spacedata
ListBase regionbase
ListBase regionbase
struct MovieClipUser user
float cursor[2]
float stabmat[4][4]
struct MovieClipScopes scopes
struct MovieClip * clip
MaskSpaceInfo mask_info
float minzoom
short keeptot
float max[2]
short keepzoom
short keepofs
float min[2]
float maxzoom
float xmax
float xmin
float ymax
float ymin
int ymin
int ymax
int xmin
int xmax
eWM_DragDataType type
Definition WM_types.hh:1327
PointerRNA * ptr
Definition WM_types.hh:1415
unsigned int data
Definition WM_types.hh:355
unsigned int action
Definition WM_types.hh:355
unsigned int category
Definition WM_types.hh:355
struct wmKeyConfig * defaultconf
rcti ED_time_scrub_clamp_scroller_mask(const rcti &scroller_mask)
bool ED_time_scrub_event_in_region_poll(const wmWindow *, const ScrArea *, const ARegion *region, const wmEvent *event)
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames)
wmDropBox * WM_dropbox_add(ListBase *lb, const char *idname, bool(*poll)(bContext *C, wmDrag *drag, const wmEvent *event), void(*copy)(bContext *C, wmDrag *drag, wmDropBox *drop), void(*cancel)(Main *bmain, wmDrag *drag, wmDropBox *drop), WMDropboxTooltipFunc tooltip)
int WM_drag_get_path_file_type(const wmDrag *drag)
const char * WM_drag_get_single_path(const wmDrag *drag)
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
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)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(wmGizmoGroupType *))
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:893
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))