Blender V4.3
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
9#include <cstdio>
10#include <cstring>
11
12#include "DNA_defaults.h"
13
14#include "DNA_mask_types.h"
15#include "DNA_movieclip_types.h"
16#include "DNA_scene_types.h"
17#include "DNA_view3d_types.h" /* for pivot point */
18
19#include "MEM_guardedalloc.h"
20
21#include "BLI_blenlib.h"
22#include "BLI_utildefines.h"
23
24#include "BKE_context.hh"
25#include "BKE_lib_query.hh"
26#include "BKE_lib_remap.hh"
27#include "BKE_movieclip.h"
28#include "BKE_screen.hh"
29#include "BKE_tracking.h"
30
31#include "IMB_imbuf_types.hh"
32
33#include "ED_anim_api.hh" /* for timeline cursor drawing */
34#include "ED_clip.hh"
35#include "ED_mask.hh"
36#include "ED_screen.hh"
37#include "ED_space_api.hh"
38#include "ED_time_scrub_ui.hh"
39#include "ED_uvedit.hh" /* just for ED_image_draw_cursor */
40
41#include "IMB_imbuf.hh"
42
43#include "GPU_matrix.hh"
44
45#include "WM_api.hh"
46#include "WM_types.hh"
47
48#include "UI_interface.hh"
49#include "UI_resources.hh"
50#include "UI_view2d.hh"
51
52#include "BLO_read_write.hh"
53
54#include "RNA_access.hh"
55
56#include "clip_intern.hh" /* own include */
57
58/* -------------------------------------------------------------------- */
62static void init_preview_region(const Scene *scene,
63 const ScrArea *area,
64 const SpaceClip *sc,
65 ARegion *region)
66{
67 if (sc->view == SC_VIEW_DOPESHEET) {
68 region->v2d.tot.xmin = -10.0f;
69 region->v2d.tot.ymin = float(-area->winy) / 3.0f;
70 region->v2d.tot.xmax = float(area->winx);
71 region->v2d.tot.ymax = 0.0f;
72
73 region->v2d.cur = region->v2d.tot;
74
75 region->v2d.min[0] = 0.0f;
76 region->v2d.min[1] = 0.0f;
77
78 region->v2d.max[0] = MAXFRAMEF;
79 region->v2d.max[1] = FLT_MAX;
80
81 region->v2d.minzoom = 0.01f;
82 region->v2d.maxzoom = 50;
83 region->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
84 region->v2d.scroll |= V2D_SCROLL_RIGHT;
85 region->v2d.keepzoom = V2D_LOCKZOOM_Y;
86 region->v2d.keepofs = V2D_KEEPOFS_Y;
87 region->v2d.align = V2D_ALIGN_NO_POS_Y;
88 region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
89 }
90 else {
91 region->v2d.tot.xmin = 0.0f;
92 region->v2d.tot.ymin = -10.0f;
93 region->v2d.tot.xmax = float(scene->r.efra);
94 region->v2d.tot.ymax = 10.0f;
95
96 region->v2d.cur = region->v2d.tot;
97
98 region->v2d.min[0] = FLT_MIN;
99 region->v2d.min[1] = FLT_MIN;
100
101 region->v2d.max[0] = MAXFRAMEF;
102 region->v2d.max[1] = FLT_MAX;
103
104 region->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
105 region->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HANDLES);
106
107 region->v2d.minzoom = 0.0f;
108 region->v2d.maxzoom = 0.0f;
109 region->v2d.keepzoom = 0;
110 region->v2d.keepofs = 0;
111 region->v2d.align = 0;
112 region->v2d.flag = 0;
113
114 region->v2d.keeptot = 0;
115 }
116}
117
119{
120 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
121
122 if (sc->mode != SC_MODE_TRACKING) {
123 return;
124 }
125
126 /* only while properties are visible */
127 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
128 if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) {
129 return;
130 }
131 }
132
133 sc->scopes.ok = false;
134}
135
137{
138 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
139
142 }
143}
144
145static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
146{
147 SpaceClip *space_clip = (SpaceClip *)area->spacedata.first;
148 BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra);
149}
150
153/* -------------------------------------------------------------------- */
157static SpaceLink *clip_create(const ScrArea * /*area*/, const Scene * /*scene*/)
158{
159 ARegion *region;
160 SpaceClip *sc;
161
163
164 /* header */
165 region = MEM_cnew<ARegion>("header for clip");
166
167 BLI_addtail(&sc->regionbase, region);
168 region->regiontype = RGN_TYPE_HEADER;
169 region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
170
171 /* tools view */
172 region = MEM_cnew<ARegion>("tools for clip");
173
174 BLI_addtail(&sc->regionbase, region);
175 region->regiontype = RGN_TYPE_TOOLS;
176 region->alignment = RGN_ALIGN_LEFT;
177
178 /* properties view */
179 region = MEM_cnew<ARegion>("properties for clip");
180
181 BLI_addtail(&sc->regionbase, region);
182 region->regiontype = RGN_TYPE_UI;
183 region->alignment = RGN_ALIGN_RIGHT;
184
185 /* channels view */
186 region = MEM_cnew<ARegion>("channels for clip");
187
188 BLI_addtail(&sc->regionbase, region);
189 region->regiontype = RGN_TYPE_CHANNELS;
190 region->alignment = RGN_ALIGN_LEFT;
191
192 region->v2d.scroll = V2D_SCROLL_BOTTOM;
193 region->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
194
195 /* preview view */
196 region = MEM_cnew<ARegion>("preview for clip");
197
198 BLI_addtail(&sc->regionbase, region);
199 region->regiontype = RGN_TYPE_PREVIEW;
200
201 /* main region */
202 region = MEM_cnew<ARegion>("main region for clip");
203
204 BLI_addtail(&sc->regionbase, region);
205 region->regiontype = RGN_TYPE_WINDOW;
206
207 return (SpaceLink *)sc;
208}
209
210/* Doesn't free the space-link itself. */
211static void clip_free(SpaceLink *sl)
212{
213 SpaceClip *sc = (SpaceClip *)sl;
214
215 sc->clip = nullptr;
216
217 if (sc->scopes.track_preview) {
219 }
220
221 if (sc->scopes.track_search) {
223 }
224}
225
226/* spacetype; init callback */
227static void clip_init(wmWindowManager * /*wm*/, ScrArea *area)
228{
230
231 /* add drop boxes */
232 WM_event_add_dropbox_handler(&area->handlers, lb);
233}
234
236{
237 SpaceClip *scn = MEM_cnew("clip_duplicate", *reinterpret_cast<SpaceClip *>(sl));
238
239 /* clear or remove stuff from old */
240 scn->scopes.track_search = nullptr;
241 scn->scopes.track_preview = nullptr;
242 scn->scopes.ok = false;
243
244 return (SpaceLink *)scn;
245}
246
248{
249 ScrArea *area = params->area;
250 const wmNotifier *wmn = params->notifier;
251 const Scene *scene = params->scene;
252
253 /* context changes */
254 switch (wmn->category) {
255 case NC_SCENE:
256 switch (wmn->data) {
257 case ND_FRAME:
260
261 case ND_FRAME_RANGE:
262 ED_area_tag_redraw(area);
263 break;
264 }
265 break;
266 case NC_MOVIECLIP:
267 switch (wmn->data) {
268 case ND_DISPLAY:
269 case ND_SELECT:
271 ED_area_tag_redraw(area);
272 break;
273 }
274 switch (wmn->action) {
275 case NA_REMOVED:
276 case NA_EDITED:
277 case NA_EVALUATED:
278 /* fall-through */
279
280 case NA_SELECTED:
282 ED_area_tag_redraw(area);
283 break;
284 }
285 break;
286 case NC_MASK:
287 switch (wmn->data) {
288 case ND_SELECT:
289 case ND_DATA:
290 case ND_DRAW:
291 ED_area_tag_redraw(area);
292 break;
293 }
294 switch (wmn->action) {
295 case NA_SELECTED:
296 ED_area_tag_redraw(area);
297 break;
298 case NA_EDITED:
299 ED_area_tag_redraw(area);
300 break;
301 }
302 break;
303 case NC_GEOM:
304 switch (wmn->data) {
305 case ND_SELECT:
307 ED_area_tag_redraw(area);
308 break;
309 }
310 break;
311 case NC_SCREEN:
312 switch (wmn->data) {
313 case ND_ANIMPLAY:
314 ED_area_tag_redraw(area);
315 break;
316 case ND_LAYOUTSET:
318 break;
319 }
320 break;
321 case NC_SPACE:
322 if (wmn->data == ND_SPACE_CLIP) {
324 ED_area_tag_redraw(area);
325 }
326 break;
327 case NC_GPENCIL:
328 if (wmn->action == NA_EDITED) {
330 ED_area_tag_redraw(area);
331 }
332 else if (wmn->data & ND_GPENCIL_EDITMODE) {
333 ED_area_tag_redraw(area);
334 }
335 break;
336 case NC_WM:
337 switch (wmn->data) {
338 case ND_FILEREAD:
339 case ND_UNDO:
341 break;
342 }
343 break;
344 }
345}
346
348{
349 /* `clip_ops.cc` */
363#ifdef WITH_INPUT_NDOF
364 WM_operatortype_append(CLIP_OT_view_ndof);
365#endif
370
371 /* `tracking_ops.cc` */
372
373 /* navigation */
375
376 /* selection */
383
384 /* markers */
390
391 /* track */
394
395 /* solving */
398
403
405
406 /* orientation */
413
414 /* detect */
416
417 /* stabilization */
424
425 /* clean-up */
430
432
433 /* object tracking */
436
437 /* clipboard */
440
441 /* Plane tracker */
444
447
450
451 /* `clip_graph_ops.cc` */
452
453 /* graph editing */
454
455 /* selection */
459
464
466
467 /* `clip_dopesheet_ops.cc` */
468
471}
472
473static void clip_keymap(wmKeyConfig *keyconf)
474{
475 /* ******** Global hotkeys available for all regions ******** */
477
478 /* ******** Hotkeys available for main region only ******** */
479 WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
480 // keymap->poll = ED_space_clip_tracking_poll;
481
482 /* ******** Hotkeys available for preview region only ******** */
483 WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
484
485 /* ******** Hotkeys available for channels region only ******** */
486 WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
487}
488
489/* DO NOT make this static, this hides the symbol and breaks API generation script. */
490extern "C" const char *clip_context_dir[]; /* quiet warning. */
491const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", nullptr};
492
493static int /*eContextResult*/ clip_context(const bContext *C,
494 const char *member,
495 bContextDataResult *result)
496{
498
499 if (CTX_data_dir(member)) {
501
502 return CTX_RESULT_OK;
503 }
504 if (CTX_data_equals(member, "edit_movieclip")) {
505 if (sc->clip) {
506 CTX_data_id_pointer_set(result, &sc->clip->id);
507 }
508 return CTX_RESULT_OK;
509 }
510 if (CTX_data_equals(member, "edit_mask")) {
511 if (sc->mask_info.mask) {
513 }
514 return CTX_RESULT_OK;
515 }
516
518}
519
520/* dropboxes */
521static bool clip_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
522{
523 if (drag->type == WM_DRAG_PATH) {
525 if (ELEM(file_type, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE)) {
526 return true;
527 }
528 }
529
530 return false;
531}
532
533static void clip_drop_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
534{
535 PointerRNA itemptr;
536 char dir[FILE_MAX], file[FILE_MAX];
537
538 BLI_path_split_dir_file(WM_drag_get_single_path(drag), dir, sizeof(dir), file, sizeof(file));
539
540 RNA_string_set(drop->ptr, "directory", dir);
541
542 RNA_collection_clear(drop->ptr, "files");
543 RNA_collection_add(drop->ptr, "files", &itemptr);
544 RNA_string_set(&itemptr, "name", file);
545}
546
547/* area+region dropbox definition */
548static void clip_dropboxes()
549{
551
552 WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
553}
554
555static void clip_refresh(const bContext *C, ScrArea *area)
556{
557 Scene *scene = CTX_data_scene(C);
558 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
559
560 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
561 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
562 init_preview_region(scene, area, sc, region_preview);
563 region_preview->v2d.cur = region_preview->v2d.tot;
564 }
565 /* #V2D_VIEWSYNC_AREA_VERTICAL must always be set for the dopesheet view, in graph view it must
566 * be unset. This is enforced by region re-initialization.
567 * That means if it's not set correctly, the view just changed and needs re-initialization */
568 else if (sc->view == SC_VIEW_DOPESHEET) {
569 if ((region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
570 init_preview_region(scene, area, sc, region_preview);
571 }
572 }
573 else {
574 if (region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
575 init_preview_region(scene, area, sc, region_preview);
576 }
577 }
578
579 BKE_movieclip_user_set_frame(&sc->user, scene->r.cfra);
580}
581
583{
584 VIEW2D_GGT_navigate_impl(gzgt, "CLIP_GGT_navigate");
585}
586
587static void clip_gizmos()
588{
590 wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gizmo_params);
591
593}
594
597/* -------------------------------------------------------------------- */
601/* sets up the fields of the View2D from zoom and offset */
602static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
603{
605 float x1, y1, w, h, aspx, aspy;
606 int width, height, winx, winy;
607
608 ED_space_clip_get_size(sc, &width, &height);
609 ED_space_clip_get_aspect(sc, &aspx, &aspy);
610
611 w = width * aspx;
612 h = height * aspy;
613
614 winx = BLI_rcti_size_x(&region->winrct) + 1;
615 winy = BLI_rcti_size_y(&region->winrct) + 1;
616
617 region->v2d.tot.xmin = 0;
618 region->v2d.tot.ymin = 0;
619 region->v2d.tot.xmax = w;
620 region->v2d.tot.ymax = h;
621
622 region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
623 region->v2d.mask.xmax = winx;
624 region->v2d.mask.ymax = winy;
625
626 /* which part of the image space do we see? */
627 x1 = region->winrct.xmin + (winx - sc->zoom * w) / 2.0f;
628 y1 = region->winrct.ymin + (winy - sc->zoom * h) / 2.0f;
629
630 x1 -= sc->zoom * sc->xof;
631 y1 -= sc->zoom * sc->yof;
632
633 /* relative display right */
634 region->v2d.cur.xmin = (region->winrct.xmin - float(x1)) / sc->zoom;
635 region->v2d.cur.xmax = region->v2d.cur.xmin + (float(winx) / sc->zoom);
636
637 /* relative display left */
638 region->v2d.cur.ymin = (region->winrct.ymin - float(y1)) / sc->zoom;
639 region->v2d.cur.ymax = region->v2d.cur.ymin + (float(winy) / sc->zoom);
640
641 /* normalize 0.0..1.0 */
642 region->v2d.cur.xmin /= w;
643 region->v2d.cur.xmax /= w;
644 region->v2d.cur.ymin /= h;
645 region->v2d.cur.ymax /= h;
646}
647
649{
650 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
651 return ELEM(sclip->view, SC_VIEW_CLIP);
652}
653
654/* add handlers, stuff you only do once or on area/region changes */
656{
657 wmKeyMap *keymap;
658
659 /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
660 * since the space clip manages its own v2d in #movieclip_main_area_set_view2d */
661
662 /* mask polls mode */
663 keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
664 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
665
666 /* own keymap */
668 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
669
670 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
671 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
672}
673
674static void clip_main_region_draw(const bContext *C, ARegion *region)
675{
676 /* draw entirely, view changes should be handled here */
679 float aspx, aspy, zoomx, zoomy, x, y;
680 int width, height;
681 bool show_cursor = false;
682
683 /* If tracking is in progress, we should synchronize the frame from the clip-user
684 * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
685 if (clip && clip->tracking_context) {
686 BKE_autotrack_context_sync_user(static_cast<AutoTrackContext *>(clip->tracking_context),
687 &sc->user);
688 }
689
690 if (sc->flag & SC_LOCK_SELECTION) {
691 ImBuf *tmpibuf = nullptr;
692
693 if (clip && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
694 tmpibuf = ED_space_clip_get_stable_buffer(sc, nullptr, nullptr, nullptr);
695 }
696
697 if (ED_clip_view_selection(C, region, false)) {
698 sc->xof += sc->xlockof;
699 sc->yof += sc->ylockof;
700 }
701
702 if (tmpibuf) {
703 IMB_freeImBuf(tmpibuf);
704 }
705 }
706
707 /* clear and setup matrix */
709
710 /* data... */
712
713 /* callback */
715
716 clip_draw_main(C, sc, region);
717
718 /* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
719 UI_view2d_view_to_region_fl(&region->v2d, 0.0f, 0.0f, &x, &y);
720 ED_space_clip_get_size(sc, &width, &height);
721 ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
722 ED_space_clip_get_aspect(sc, &aspx, &aspy);
723
724 if (sc->mode == SC_MODE_MASKEDIT) {
725 Mask *mask = CTX_data_edit_mask(C);
726 if (mask && clip) {
727 ScrArea *area = CTX_wm_area(C);
728 int mask_width, mask_height;
729 ED_mask_get_size(area, &mask_width, &mask_height);
731 mask,
732 region,
737 mask_width,
738 mask_height,
739 aspx,
740 aspy,
741 true,
742 true,
743 sc->stabmat,
744 C);
745 }
746 }
747
748 show_cursor |= sc->mode == SC_MODE_MASKEDIT;
749 show_cursor |= sc->around == V3D_AROUND_CURSOR;
750
751 if (show_cursor) {
754 GPU_matrix_scale_2f(zoomx, zoomy);
756 GPU_matrix_scale_2f(width, height);
757 ED_image_draw_cursor(region, sc->cursor);
759 }
760
761 clip_draw_cache_and_notes(C, sc, region);
762
763 if (sc->flag & SC_SHOW_ANNOTATION) {
764 /* Grease Pencil */
766 }
767
768 /* callback */
769 /* TODO(sergey): For being consistent with space image the projection needs to be configured
770 * the way how the commented out code does it. This works correct for tracking data, but it
771 * causes wrong aspect correction for mask editor (see #84990). */
772 // GPU_matrix_push_projection();
773 // wmOrtho2(region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin,
774 // region->v2d.cur.ymax);
776 // GPU_matrix_pop_projection();
777
778 /* reset view matrix */
780
781 if (sc->flag & SC_SHOW_ANNOTATION) {
782 /* draw Grease Pencil - screen space only */
784 }
785 if ((sc->gizmo_flag & SCLIP_GIZMO_HIDE) == 0) {
786 WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D);
787 }
788}
789
791{
792 ARegion *region = params->region;
793 const wmNotifier *wmn = params->notifier;
794
795 /* context changes */
796 switch (wmn->category) {
797 case NC_GPENCIL:
798 if (wmn->action == NA_EDITED) {
799 ED_region_tag_redraw(region);
800 }
801 else if (wmn->data & ND_GPENCIL_EDITMODE) {
802 ED_region_tag_redraw(region);
803 }
804 break;
805 }
806}
807
810/* -------------------------------------------------------------------- */
815{
816 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
817 return ELEM(sclip->view, SC_VIEW_GRAPH, SC_VIEW_DOPESHEET);
818}
819
821{
822 wmKeyMap *keymap;
823
824 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
825
826 /* own keymap */
827
829 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
830
831 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Time Scrub", SPACE_CLIP, RGN_TYPE_PREVIEW);
833
834 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
835 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
836
837 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
838 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
839}
840
841static void graph_region_draw(const bContext *C, ARegion *region)
842{
843 View2D *v2d = &region->v2d;
845 Scene *scene = CTX_data_scene(C);
846 short cfra_flag = 0;
847
848 if (sc->flag & SC_LOCK_TIMECURSOR) {
850 }
851
852 /* clear and setup matrix */
854
856
857 /* data... */
858 clip_draw_graph(sc, region, scene);
859
860 /* current frame indicator line */
861 if (sc->flag & SC_SHOW_SECONDS) {
862 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
863 }
864 ANIM_draw_cfra(C, v2d, cfra_flag);
865
866 /* reset view matrix */
868
869 /* time-scrubbing */
870 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
871
872 /* current frame indicator */
874
875 /* scrollers */
876 if (region->winy > HEADERY * UI_SCALE_FAC) {
877 const rcti scroller_mask = ED_time_scrub_clamp_scroller_mask(v2d->mask);
878 UI_view2d_scrollers_draw(v2d, &scroller_mask);
879 }
880
881 /* scale indicators */
882 {
883 rcti rect;
885 &rect, 0, 15 * UI_SCALE_FAC, 15 * UI_SCALE_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y);
886 UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT);
887 }
888}
889
890static void dopesheet_region_draw(const bContext *C, ARegion *region)
891{
892 Scene *scene = CTX_data_scene(C);
895 View2D *v2d = &region->v2d;
896 short cfra_flag = 0;
897
898 if (clip) {
899 BKE_tracking_dopesheet_update(&clip->tracking);
900 }
901
902 /* clear and setup matrix */
904
906
907 /* time grid */
909
910 /* data... */
911 clip_draw_dopesheet_main(sc, region, scene);
912
913 /* current frame indicator line */
914 if (sc->flag & SC_SHOW_SECONDS) {
915 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
916 }
917 ANIM_draw_cfra(C, v2d, cfra_flag);
918
919 /* reset view matrix */
921
922 /* time-scrubbing */
923 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true);
924
925 /* current frame indicator */
927
928 /* scrollers */
929 if (region->winy > HEADERY * UI_SCALE_FAC) {
930 UI_view2d_scrollers_draw(v2d, nullptr);
931 }
932}
933
934static void clip_preview_region_draw(const bContext *C, ARegion *region)
935{
937
938 if (sc->view == SC_VIEW_GRAPH) {
939 graph_region_draw(C, region);
940 }
941 else if (sc->view == SC_VIEW_DOPESHEET) {
942 dopesheet_region_draw(C, region);
943 }
944}
945
946static void clip_preview_region_listener(const wmRegionListenerParams * /*params*/) {}
947
950/* -------------------------------------------------------------------- */
955{
956 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
957 return ELEM(sclip->view, SC_VIEW_DOPESHEET);
958}
959
961{
962 wmKeyMap *keymap;
963
964 /* ensure the 2d view sync works - main region has bottom scroller */
965 region->v2d.scroll = V2D_SCROLL_BOTTOM;
966
967 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
968
969 keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
970 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
971}
972
973static void clip_channels_region_draw(const bContext *C, ARegion *region)
974{
977 View2D *v2d = &region->v2d;
978
979 if (clip) {
980 BKE_tracking_dopesheet_update(&clip->tracking);
981 }
982
983 /* clear and setup matrix */
985
987
988 /* data... */
990
991 /* reset view matrix */
993}
994
996
999/* -------------------------------------------------------------------- */
1003/* add handlers, stuff you only do once or on area/region changes */
1005{
1006 ED_region_header_init(region);
1007}
1008
1009static void clip_header_region_draw(const bContext *C, ARegion *region)
1010{
1011 ED_region_header(C, region);
1012}
1013
1015{
1016 ARegion *region = params->region;
1017 const wmNotifier *wmn = params->notifier;
1018
1019 /* context changes */
1020 switch (wmn->category) {
1021 case NC_SCENE:
1022 switch (wmn->data) {
1023 /* for proportional editmode only */
1024 case ND_TOOLSETTINGS:
1025 /* TODO: should do this when in mask mode only but no data available. */
1026 // if (sc->mode == SC_MODE_MASKEDIT)
1027 {
1028 ED_region_tag_redraw(region);
1029 break;
1030 }
1031 }
1032 break;
1033 }
1034}
1035
1038/* -------------------------------------------------------------------- */
1043{
1044 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1045 return ELEM(sclip->view, SC_VIEW_CLIP);
1046}
1047
1048/* add handlers, stuff you only do once or on area/region changes */
1050{
1051 wmKeyMap *keymap;
1052
1053 ED_region_panels_init(wm, region);
1054
1056 WM_event_add_keymap_handler(&region->handlers, keymap);
1057}
1058
1059static void clip_tools_region_draw(const bContext *C, ARegion *region)
1060{
1061 ED_region_panels(C, region);
1062}
1063
1066/* -------------------------------------------------------------------- */
1071{
1072 ARegion *region = params->region;
1073 const wmNotifier *wmn = params->notifier;
1074
1075 /* context changes */
1076 switch (wmn->category) {
1077 case NC_WM:
1078 if (wmn->data == ND_HISTORY) {
1079 ED_region_tag_redraw(region);
1080 }
1081 break;
1082 case NC_SCENE:
1083 if (wmn->data == ND_MODE) {
1084 ED_region_tag_redraw(region);
1085 }
1086 break;
1087 case NC_SPACE:
1088 if (wmn->data == ND_SPACE_CLIP) {
1089 ED_region_tag_redraw(region);
1090 }
1091 break;
1092 case NC_GPENCIL:
1093 if (wmn->action == NA_EDITED) {
1094 ED_region_tag_redraw(region);
1095 }
1096 break;
1097 }
1098}
1099
1102/* -------------------------------------------------------------------- */
1107{
1108 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1109 return ELEM(sclip->view, SC_VIEW_CLIP);
1110}
1111
1112/* add handlers, stuff you only do once or on area/region changes */
1114{
1115 wmKeyMap *keymap;
1116
1117 ED_region_panels_init(wm, region);
1118
1120 WM_event_add_keymap_handler(&region->handlers, keymap);
1121}
1122
1123static void clip_properties_region_draw(const bContext *C, ARegion *region)
1124{
1126
1128
1129 ED_region_panels(C, region);
1130}
1131
1133{
1134 ARegion *region = params->region;
1135 const wmNotifier *wmn = params->notifier;
1136
1137 /* context changes */
1138 switch (wmn->category) {
1139 case NC_GPENCIL:
1140 if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE)) {
1141 ED_region_tag_redraw(region);
1142 }
1143 break;
1144 case NC_BRUSH:
1145 if (wmn->action == NA_EDITED) {
1146 ED_region_tag_redraw(region);
1147 }
1148 break;
1149 }
1150}
1151
1154/* -------------------------------------------------------------------- */
1158static void clip_id_remap(ScrArea * /*area*/,
1159 SpaceLink *slink,
1160 const blender::bke::id::IDRemapper &mappings)
1161{
1162 SpaceClip *sclip = (SpaceClip *)slink;
1163
1165 return;
1166 }
1167
1168 mappings.apply(reinterpret_cast<ID **>(&sclip->clip), ID_REMAP_APPLY_ENSURE_REAL);
1169 mappings.apply(reinterpret_cast<ID **>(&sclip->mask_info.mask), ID_REMAP_APPLY_ENSURE_REAL);
1170}
1171
1172static void clip_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
1173{
1174 SpaceClip *sclip = reinterpret_cast<SpaceClip *>(space_link);
1175 const int data_flags = BKE_lib_query_foreachid_process_flags_get(data);
1176 const bool is_readonly = (data_flags & IDWALK_READONLY) != 0;
1177
1182
1183 if (!is_readonly) {
1184 sclip->scopes.ok = 0;
1185 }
1186}
1187
1189{
1190 SpaceClip *sclip = (SpaceClip *)sl;
1191
1192 sclip->scopes.track_search = nullptr;
1193 sclip->scopes.track_preview = nullptr;
1194 sclip->scopes.ok = 0;
1195}
1196
1198{
1199 BLO_write_struct(writer, SpaceClip, sl);
1200}
1201
1204/* -------------------------------------------------------------------- */
1209{
1210 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1211 ARegionType *art;
1212
1213 st->spaceid = SPACE_CLIP;
1214 STRNCPY(st->name, "Clip");
1215
1216 st->create = clip_create;
1217 st->free = clip_free;
1218 st->init = clip_init;
1219 st->duplicate = clip_duplicate;
1220 st->operatortypes = clip_operatortypes;
1221 st->keymap = clip_keymap;
1222 st->listener = clip_listener;
1223 st->context = clip_context;
1224 st->gizmos = clip_gizmos;
1225 st->dropboxes = clip_dropboxes;
1226 st->refresh = clip_refresh;
1227 st->id_remap = clip_id_remap;
1228 st->foreach_id = clip_foreach_id;
1229 st->blend_read_data = clip_space_blend_read_data;
1230 st->blend_read_after_liblink = nullptr;
1231 st->blend_write = clip_space_blend_write;
1232
1233 /* regions: main window */
1234 art = MEM_cnew<ARegionType>("spacetype clip region");
1241
1242 BLI_addhead(&st->regiontypes, art);
1243
1244 /* preview */
1245 art = MEM_cnew<ARegionType>("spacetype clip region preview");
1247 art->prefsizey = 240;
1253
1254 BLI_addhead(&st->regiontypes, art);
1255
1256 /* regions: properties */
1257 art = MEM_cnew<ARegionType>("spacetype clip region properties");
1258 art->regionid = RGN_TYPE_UI;
1265 BLI_addhead(&st->regiontypes, art);
1267
1268 /* regions: tools */
1269 art = MEM_cnew<ARegionType>("spacetype clip region tools");
1270 art->regionid = RGN_TYPE_TOOLS;
1277
1278 BLI_addhead(&st->regiontypes, art);
1279
1280 /* regions: header */
1281 art = MEM_cnew<ARegionType>("spacetype clip region");
1283 art->prefsizey = HEADERY;
1285
1289
1290 BLI_addhead(&st->regiontypes, art);
1291
1292 /* channels */
1293 art = MEM_cnew<ARegionType>("spacetype clip channels region");
1301
1302 BLI_addhead(&st->regiontypes, art);
1303
1304 /* regions: hud */
1305 art = ED_area_type_hud(st->spaceid);
1306 BLI_addhead(&st->regiontypes, art);
1307
1308 BKE_spacetype_register(std::move(st));
1309}
1310
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
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:120
@ 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:268
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:815
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking)
Definition tracking.cc: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.cc:90
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
#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:193
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition rct.c:418
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define ELEM(...)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define FILTER_ID_MC
Definition DNA_ID.h:1177
#define FILTER_ID_MSK
Definition DNA_ID.h:1179
#define DNA_struct_default_alloc(struct_name)
eMaskOverlayMode
#define MAXFRAMEF
#define HEADERY
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_FLAG_HIDDEN
eFileSel_File_Types
@ FILE_TYPE_MOVIE
@ FILE_TYPE_IMAGE
@ SPACE_CLIP
@ SPACE_EMPTY
@ SC_VIEW_GRAPH
@ SC_VIEW_CLIP
@ SC_VIEW_DOPESHEET
@ SCLIP_GIZMO_HIDE
@ 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
#define UI_SCALE_FAC
@ V2D_ALIGN_NO_POS_Y
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_KEEPOFS_Y
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_LOCKZOOM_Y
@ 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:640
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:708
ARegionType * ED_area_type_hud(int space_type)
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3336
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3646
void ED_region_header_init(ARegion *region)
Definition area.cc:3661
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:3343
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:634
@ ED_KEYMAP_UI
Definition ED_screen.hh:725
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:731
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:733
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:726
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:728
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:730
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)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_COMPACT_PANEL_WIDTH
@ TH_BACK
@ TH_TEXT
void UI_ThemeClearColor(int colorid)
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1605
void UI_view2d_view_restore(const bContext *C)
Definition view2d.cc:1158
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:212
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:472
void UI_view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1091
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:1734
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:379
#define NC_GEOM
Definition WM_types.hh:360
#define ND_DRAW
Definition WM_types.hh:428
#define NC_BRUSH
Definition WM_types.hh:352
#define NC_WM
Definition WM_types.hh:341
#define ND_DATA
Definition WM_types.hh:475
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:470
#define NA_EVALUATED
Definition WM_types.hh:551
#define ND_DISPLAY
Definition WM_types.hh:458
#define NC_SCREEN
Definition WM_types.hh:344
#define NC_MOVIECLIP
Definition WM_types.hh:364
#define ND_MODE
Definition WM_types.hh:412
#define ND_ANIMPLAY
Definition WM_types.hh:391
#define NC_SCENE
Definition WM_types.hh:345
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define NA_EDITED
Definition WM_types.hh:550
#define ND_FRAME_RANGE
Definition WM_types.hh:418
#define ND_SPACE_CLIP
Definition WM_types.hh:505
#define ND_UNDO
Definition WM_types.hh:384
#define ND_FRAME
Definition WM_types.hh:401
#define NA_REMOVED
Definition WM_types.hh:553
#define ND_SELECT
Definition WM_types.hh:474
#define NC_GPENCIL
Definition WM_types.hh:366
#define NC_MASK
Definition WM_types.hh:365
#define ND_HISTORY
Definition WM_types.hh:382
@ WM_DRAG_PATH
Definition WM_types.hh:1160
#define ND_LAYOUTSET
Definition WM_types.hh:393
#define NC_SPACE
Definition WM_types.hh:359
#define NA_SELECTED
Definition WM_types.hh:555
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition anim_draw.cc:45
unsigned int U
Definition btGjkEpa3.h:78
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:770
void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:879
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:1805
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:1606
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:704
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:827
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:300
void CLIP_OT_detect_features(wmOperatorType *ot)
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1755
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1149
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:1033
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:1714
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:1001
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:1568
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1855
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:501
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:962
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:347
void CLIP_OT_clear_track_path(wmOperatorType *ot)
void CLIP_OT_frame_jump(wmOperatorType *ot)
draw_view in_light_buf[] float
void IMB_freeImBuf(ImBuf *)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
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:62
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)
Definition DNA_ID.h:413
struct Mask * mask
struct ImBuf * track_preview
struct ImBuf * track_search
ListBase regionbase
struct MovieClipUser user
float cursor[2]
float stabmat[4][4]
struct MovieClipScopes scopes
struct MovieClip * clip
MaskSpaceInfo mask_info
eWM_DragDataType type
Definition WM_types.hh:1282
PointerRNA * ptr
Definition WM_types.hh:1368
unsigned int data
Definition WM_types.hh:325
unsigned int action
Definition WM_types.hh:325
unsigned int category
Definition WM_types.hh:325
struct wmKeyConfig * defaultconf
rcti ED_time_scrub_clamp_scroller_mask(const rcti &scroller_mask)
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)
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:897
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))