Blender V5.0
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 <cfloat>
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_listbase.h"
22#include "BLI_math_base.h"
23#include "BLI_path_utils.hh"
24#include "BLI_string_utf8.h"
25#include "BLI_utildefines.h"
26
27#include "BKE_context.hh"
28#include "BKE_lib_query.hh"
29#include "BKE_lib_remap.hh"
30#include "BKE_movieclip.h"
31#include "BKE_screen.hh"
32#include "BKE_tracking.h"
33
34#include "IMB_imbuf_types.hh"
35
36#include "ED_anim_api.hh" /* for timeline cursor drawing */
37#include "ED_clip.hh"
38#include "ED_mask.hh"
39#include "ED_screen.hh"
40#include "ED_space_api.hh"
41#include "ED_time_scrub_ui.hh"
42#include "ED_uvedit.hh" /* just for ED_image_draw_cursor */
43
44#include "IMB_imbuf.hh"
45
46#include "GPU_matrix.hh"
47
48#include "WM_api.hh"
49#include "WM_types.hh"
50
51#include "UI_interface.hh"
52#include "UI_resources.hh"
53#include "UI_view2d.hh"
54
55#include "BLO_read_write.hh"
56
57#include "RNA_access.hh"
58
59#include "clip_intern.hh" /* own include */
60
61/* -------------------------------------------------------------------- */
64
65static void init_preview_region(const Scene *scene,
66 const ScrArea *area,
67 const SpaceClip *sc,
68 ARegion *region)
69{
70 if (sc->view == SC_VIEW_DOPESHEET) {
71 region->v2d.tot.xmin = -10.0f;
72 region->v2d.tot.ymin = float(-area->winy) / 3.0f;
73 region->v2d.tot.xmax = float(area->winx);
74 region->v2d.tot.ymax = 0.0f;
75
76 region->v2d.cur = region->v2d.tot;
77
78 region->v2d.min[0] = 0.0f;
79 region->v2d.min[1] = 0.0f;
80
81 region->v2d.max[0] = MAXFRAMEF;
82 region->v2d.max[1] = FLT_MAX;
83
84 region->v2d.minzoom = 0.01f;
85 region->v2d.maxzoom = 50;
87 region->v2d.scroll |= V2D_SCROLL_RIGHT;
88 region->v2d.keepzoom = V2D_LOCKZOOM_Y;
89 region->v2d.keepofs = V2D_KEEPOFS_Y;
92 }
93 else {
94 region->v2d.tot.xmin = 0.0f;
95 region->v2d.tot.ymin = -10.0f;
96 region->v2d.tot.xmax = float(scene->r.efra);
97 region->v2d.tot.ymax = 10.0f;
98
99 region->v2d.cur = region->v2d.tot;
100
101 region->v2d.min[0] = FLT_MIN;
102 region->v2d.min[1] = FLT_MIN;
103
104 region->v2d.max[0] = MAXFRAMEF;
105 region->v2d.max[1] = FLT_MAX;
106
109
110 region->v2d.minzoom = 0.0f;
111 region->v2d.maxzoom = 0.0f;
112 region->v2d.keepzoom = 0;
113 region->v2d.keepofs = 0;
114 region->v2d.align = 0;
115 region->v2d.flag = 0;
116
117 region->v2d.keeptot = 0;
118 }
119}
120
122{
123 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
124
125 if (sc->mode != SC_MODE_TRACKING) {
126 return;
127 }
128
129 /* only while properties are visible */
130 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
131 if (region->regiontype == RGN_TYPE_UI && region->flag & RGN_FLAG_HIDDEN) {
132 return;
133 }
134 }
135
136 sc->scopes.ok = false;
137}
138
140{
141 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
142
145 }
146}
147
148static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
149{
150 SpaceClip *space_clip = (SpaceClip *)area->spacedata.first;
151 BKE_movieclip_user_set_frame(&space_clip->user, scene->r.cfra);
152}
153
155
156/* -------------------------------------------------------------------- */
159
160static SpaceLink *clip_create(const ScrArea * /*area*/, const Scene * /*scene*/)
161{
162 ARegion *region;
163 SpaceClip *sc;
164
166
167 /* header */
168 region = BKE_area_region_new();
169
170 BLI_addtail(&sc->regionbase, region);
171 region->regiontype = RGN_TYPE_HEADER;
173
174 /* tools view */
175 region = BKE_area_region_new();
176
177 BLI_addtail(&sc->regionbase, region);
178 region->regiontype = RGN_TYPE_TOOLS;
179 region->alignment = RGN_ALIGN_LEFT;
180
181 /* properties view */
182 region = BKE_area_region_new();
183
184 BLI_addtail(&sc->regionbase, region);
185 region->regiontype = RGN_TYPE_UI;
186 region->alignment = RGN_ALIGN_RIGHT;
187
188 /* channels view */
189 region = BKE_area_region_new();
190
191 BLI_addtail(&sc->regionbase, region);
193 region->alignment = RGN_ALIGN_LEFT;
194
195 region->v2d.scroll = V2D_SCROLL_BOTTOM;
197
198 /* preview view */
199 region = BKE_area_region_new();
200
201 BLI_addtail(&sc->regionbase, region);
203
204 /* main region */
205 region = BKE_area_region_new();
206
207 BLI_addtail(&sc->regionbase, region);
208 region->regiontype = RGN_TYPE_WINDOW;
209
210 return (SpaceLink *)sc;
211}
212
213/* Doesn't free the space-link itself. */
214static void clip_free(SpaceLink *sl)
215{
216 SpaceClip *sc = (SpaceClip *)sl;
217
218 sc->clip = nullptr;
219
220 if (sc->scopes.track_preview) {
222 }
223
224 if (sc->scopes.track_search) {
226 }
227}
228
229/* spacetype; init callback */
230static void clip_init(wmWindowManager * /*wm*/, ScrArea *area)
231{
233
234 /* add drop boxes */
236}
237
239{
240 SpaceClip *scn = MEM_dupallocN("clip_duplicate", *reinterpret_cast<SpaceClip *>(sl));
241
242 /* clear or remove stuff from old */
243 scn->scopes.track_search = nullptr;
244 scn->scopes.track_preview = nullptr;
245 scn->scopes.ok = false;
246
247 return (SpaceLink *)scn;
248}
249
251{
252 ScrArea *area = params->area;
253 const wmNotifier *wmn = params->notifier;
254 const Scene *scene = params->scene;
255
256 /* context changes */
257 switch (wmn->category) {
258 case NC_SCENE:
259 switch (wmn->data) {
260 case ND_FRAME:
263
264 case ND_FRAME_RANGE:
265 ED_area_tag_redraw(area);
266 break;
267 }
268 break;
269 case NC_MOVIECLIP:
270 switch (wmn->data) {
271 case ND_DISPLAY:
272 case ND_SELECT:
274 ED_area_tag_redraw(area);
275 break;
276 }
277 switch (wmn->action) {
278 case NA_REMOVED:
279 case NA_EDITED:
280 case NA_EVALUATED:
281 /* fall-through */
282
283 case NA_SELECTED:
285 ED_area_tag_redraw(area);
286 break;
287 }
288 break;
289 case NC_MASK:
290 switch (wmn->data) {
291 case ND_SELECT:
292 case ND_DATA:
293 case ND_DRAW:
294 ED_area_tag_redraw(area);
295 break;
296 }
297 switch (wmn->action) {
298 case NA_SELECTED:
299 ED_area_tag_redraw(area);
300 break;
301 case NA_EDITED:
302 ED_area_tag_redraw(area);
303 break;
304 }
305 break;
306 case NC_GEOM:
307 switch (wmn->data) {
308 case ND_SELECT:
310 ED_area_tag_redraw(area);
311 break;
312 }
313 break;
314 case NC_SCREEN:
315 switch (wmn->data) {
316 case ND_ANIMPLAY:
317 ED_area_tag_redraw(area);
318 break;
319 case ND_LAYOUTSET:
321 break;
322 }
323 break;
324 case NC_SPACE:
325 if (wmn->data == ND_SPACE_CLIP) {
327 ED_area_tag_redraw(area);
328 }
329 break;
330 case NC_GPENCIL:
331 if (wmn->action == NA_EDITED) {
333 ED_area_tag_redraw(area);
334 }
335 else if (wmn->data & ND_GPENCIL_EDITMODE) {
336 ED_area_tag_redraw(area);
337 }
338 break;
339 case NC_WM:
340 switch (wmn->data) {
341 case ND_FILEREAD:
342 case ND_UNDO:
344 break;
345 }
346 break;
347 }
348}
349
351{
352 /* `clip_ops.cc` */
366#ifdef WITH_INPUT_NDOF
367 WM_operatortype_append(CLIP_OT_view_ndof);
368#endif
373
374 /* `tracking_ops.cc` */
375
376 /* navigation */
378
379 /* selection */
386
387 /* markers */
393
394 /* track */
397
398 /* solving */
401
406
408
409 /* orientation */
416
417 /* detect */
419
420 /* stabilization */
427
428 /* clean-up */
433
435
436 /* object tracking */
439
440 /* clipboard */
443
444 /* Plane tracker */
447
450
453
454 /* `clip_graph_ops.cc` */
455
456 /* graph editing */
457
458 /* selection */
462
467
469
470 /* `clip_dopesheet_ops.cc` */
471
474}
475
476static void clip_keymap(wmKeyConfig *keyconf)
477{
478 /* ******** Global hotkeys available for all regions ******** */
480
481 /* ******** Hotkeys available for main region only ******** */
482 WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
483 // keymap->poll = ED_space_clip_tracking_poll;
484
485 /* ******** Hotkeys available for preview region only ******** */
486 WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
487
488 /* ******** Hotkeys available for channels region only ******** */
489 WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
490}
491
492/* DO NOT make this static, this hides the symbol and breaks API generation script. */
493extern "C" const char *clip_context_dir[]; /* quiet warning. */
494const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", nullptr};
495
496static int /*eContextResult*/ clip_context(const bContext *C,
497 const char *member,
499{
501
502 if (CTX_data_dir(member)) {
504
505 return CTX_RESULT_OK;
506 }
507 if (CTX_data_equals(member, "edit_movieclip")) {
508 if (sc->clip) {
510 }
511 return CTX_RESULT_OK;
512 }
513 if (CTX_data_equals(member, "edit_mask")) {
514 if (sc->mask_info.mask) {
516 }
517 return CTX_RESULT_OK;
518 }
519
521}
522
523/* dropboxes */
524static bool clip_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
525{
526 if (drag->type == WM_DRAG_PATH) {
528 if (ELEM(file_type, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE)) {
529 return true;
530 }
531 }
532
533 return false;
534}
535
536static void clip_drop_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
537{
538 PointerRNA itemptr;
539 char dir[FILE_MAX], file[FILE_MAX];
540
541 BLI_path_split_dir_file(WM_drag_get_single_path(drag), dir, sizeof(dir), file, sizeof(file));
542
543 RNA_string_set(drop->ptr, "directory", dir);
544
545 RNA_collection_clear(drop->ptr, "files");
546 RNA_collection_add(drop->ptr, "files", &itemptr);
547 RNA_string_set(&itemptr, "name", file);
548}
549
550/* area+region dropbox definition */
551static void clip_dropboxes()
552{
554
555 WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
556}
557
558static void clip_refresh(const bContext *C, ScrArea *area)
559{
560 Scene *scene = CTX_data_scene(C);
561 SpaceClip *sc = (SpaceClip *)area->spacedata.first;
562
563 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
564 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
565 init_preview_region(scene, area, sc, region_preview);
566 region_preview->v2d.cur = region_preview->v2d.tot;
567 }
568 /* #V2D_VIEWSYNC_AREA_VERTICAL must always be set for the dopesheet view, in graph view it must
569 * be unset. This is enforced by region re-initialization.
570 * That means if it's not set correctly, the view just changed and needs re-initialization */
571 else if (sc->view == SC_VIEW_DOPESHEET) {
572 if ((region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
573 init_preview_region(scene, area, sc, region_preview);
574 }
575 }
576 else {
577 if (region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
578 init_preview_region(scene, area, sc, region_preview);
579 }
580 }
581
583}
584
586{
587 VIEW2D_GGT_navigate_impl(gzgt, "CLIP_GGT_navigate");
588}
589
590static void clip_gizmos()
591{
593 wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gizmo_params);
594
596}
597
599
600/* -------------------------------------------------------------------- */
603
604/* sets up the fields of the View2D from zoom and offset */
606{
608 float x1, y1, w, h, aspx, aspy;
609 int width, height, winx, winy;
610
611 ED_space_clip_get_size(sc, &width, &height);
612 ED_space_clip_get_aspect(sc, &aspx, &aspy);
613
614 w = width * aspx;
615 h = height * aspy;
616
617 winx = BLI_rcti_size_x(&region->winrct) + 1;
618 winy = BLI_rcti_size_y(&region->winrct) + 1;
619
620 region->v2d.tot.xmin = 0;
621 region->v2d.tot.ymin = 0;
622 region->v2d.tot.xmax = w;
623 region->v2d.tot.ymax = h;
624
625 region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
626 region->v2d.mask.xmax = winx;
627 region->v2d.mask.ymax = winy;
628
629 /* which part of the image space do we see? */
630 x1 = region->winrct.xmin + (winx - sc->zoom * w) / 2.0f;
631 y1 = region->winrct.ymin + (winy - sc->zoom * h) / 2.0f;
632
633 x1 -= sc->zoom * sc->xof;
634 y1 -= sc->zoom * sc->yof;
635
636 /* relative display right */
637 region->v2d.cur.xmin = (region->winrct.xmin - x1) / sc->zoom;
638 region->v2d.cur.xmax = region->v2d.cur.xmin + (float(winx) / sc->zoom);
639
640 /* relative display left */
641 region->v2d.cur.ymin = (region->winrct.ymin - y1) / sc->zoom;
642 region->v2d.cur.ymax = region->v2d.cur.ymin + (float(winy) / sc->zoom);
643
644 /* normalize 0.0..1.0 */
645 region->v2d.cur.xmin /= w;
646 region->v2d.cur.xmax /= w;
647 region->v2d.cur.ymin /= h;
648 region->v2d.cur.ymax /= h;
649}
650
652{
653 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
654 return ELEM(sclip->view, SC_VIEW_CLIP);
655}
656
657/* add handlers, stuff you only do once or on area/region changes */
659{
660 wmKeyMap *keymap;
661
662 /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
663 * since the space clip manages its own v2d in #movieclip_main_area_set_view2d */
664
665 /* mask polls mode */
666 keymap = WM_keymap_ensure(
667 wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
668 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
669
670 /* own keymap */
671 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
672 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
673
674 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
675 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
676}
677
678static void clip_main_region_draw(const bContext *C, ARegion *region)
679{
680 /* draw entirely, view changes should be handled here */
683 float aspx, aspy, zoomx, zoomy, x, y;
684 int width, height;
685 bool show_cursor = false;
686
687 /* If tracking is in progress, we should synchronize the frame from the clip-user
688 * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
689 if (clip && clip->tracking_context) {
691 &sc->user);
692 }
693
694 if (sc->flag & SC_LOCK_SELECTION) {
695 ImBuf *tmpibuf = nullptr;
696
698 tmpibuf = ED_space_clip_get_stable_buffer(sc, nullptr, nullptr, nullptr);
699 }
700
701 if (ED_clip_view_selection(C, region, false)) {
702 sc->xof += sc->xlockof;
703 sc->yof += sc->ylockof;
704 }
705
706 if (tmpibuf) {
707 IMB_freeImBuf(tmpibuf);
708 }
709 }
710
711 /* clear and setup matrix */
713
714 /* data... */
716
717 /* callback */
719
720 clip_draw_main(C, sc, region);
721
722 /* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
723 UI_view2d_view_to_region_fl(&region->v2d, 0.0f, 0.0f, &x, &y);
724 ED_space_clip_get_size(sc, &width, &height);
725 ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
726 ED_space_clip_get_aspect(sc, &aspx, &aspy);
727
728 if (sc->mode == SC_MODE_MASKEDIT) {
730 if (mask && clip) {
731 ScrArea *area = CTX_wm_area(C);
732 int mask_width, mask_height;
733 ED_mask_get_size(area, &mask_width, &mask_height);
735 mask,
736 region,
742 mask_width,
743 mask_height,
744 aspx,
745 aspy,
746 true,
747 true,
748 sc->stabmat,
749 C);
750 }
751 }
752
753 show_cursor |= sc->mode == SC_MODE_MASKEDIT;
754 show_cursor |= sc->around == V3D_AROUND_CURSOR;
755
756 if (sc->overlay.flag & SC_SHOW_OVERLAYS && sc->overlay.flag & SC_SHOW_CURSOR && show_cursor) {
759 GPU_matrix_scale_2f(zoomx, zoomy);
761 GPU_matrix_scale_2f(width, height);
762 ED_image_draw_cursor(region, sc->cursor);
764 }
765
766 clip_draw_cache_and_notes(C, sc, region);
767
769 /* Grease Pencil */
771 }
772
773 /* callback */
774 /* TODO(sergey): For being consistent with space image the projection needs to be configured
775 * the way how the commented out code does it. This works correct for tracking data, but it
776 * causes wrong aspect correction for mask editor (see #84990). */
777 // GPU_matrix_push_projection();
778 // wmOrtho2(region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin,
779 // region->v2d.cur.ymax);
781 // GPU_matrix_pop_projection();
782
783 /* reset view matrix */
785
787 /* draw Grease Pencil - screen space only */
789 }
790 if ((sc->gizmo_flag & SCLIP_GIZMO_HIDE) == 0) {
792 }
793}
794
796{
797 ARegion *region = params->region;
798 const wmNotifier *wmn = params->notifier;
799
800 /* context changes */
801 switch (wmn->category) {
802 case NC_GPENCIL:
803 if (wmn->action == NA_EDITED) {
804 ED_region_tag_redraw(region);
805 }
806 else if (wmn->data & ND_GPENCIL_EDITMODE) {
807 ED_region_tag_redraw(region);
808 }
809 break;
810 }
811}
812
814
815/* -------------------------------------------------------------------- */
818
820{
821 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
822 return ELEM(sclip->view, SC_VIEW_GRAPH, SC_VIEW_DOPESHEET);
823}
824
826{
827 wmKeyMap *keymap;
828
829 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
830
831 /* own keymap */
832
833 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
834 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
835
836 keymap = WM_keymap_ensure(
837 wm->runtime->defaultconf, "Clip Time Scrub", SPACE_CLIP, RGN_TYPE_PREVIEW);
839 &region->runtime->handlers, keymap, ED_time_scrub_event_in_region_poll);
840
841 keymap = WM_keymap_ensure(
842 wm->runtime->defaultconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
843 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
844
845 keymap = WM_keymap_ensure(
846 wm->runtime->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
847 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
848}
849
850static void graph_region_draw(const bContext *C, ARegion *region)
851{
852 View2D *v2d = &region->v2d;
854 Scene *scene = CTX_data_scene(C);
855 short cfra_flag = 0;
856 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
857
858 if (sc->flag & SC_LOCK_TIMECURSOR) {
860 }
861
862 /* clear and setup matrix */
864
866
867 /* data... */
868 clip_draw_graph(sc, region, scene);
869
870 /* current frame indicator line */
871 if (sc->flag & SC_SHOW_SECONDS) {
872 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
873 }
874 ANIM_draw_cfra(C, v2d, cfra_flag);
875
876 /* reset view matrix */
878
879 /* time-scrubbing */
880 const int fps = round_db_to_int(scene->frames_per_second());
881 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true, fps);
882
883 /* current frame indicator */
884 ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS, !minimized);
885
886 /* scrollers */
887 if (!minimized) {
888 const rcti scroller_mask = ED_time_scrub_clamp_scroller_mask(v2d->mask);
889 region->v2d.scroll |= V2D_SCROLL_BOTTOM;
890 UI_view2d_scrollers_draw(v2d, &scroller_mask);
891 }
892 else {
893 region->v2d.scroll &= ~V2D_SCROLL_BOTTOM;
894 }
895
896 /* scale indicators */
897 {
898 rcti rect;
900 &rect, 0, 15 * UI_SCALE_FAC, 15 * UI_SCALE_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y);
901 UI_view2d_draw_scale_y__values(region, v2d, &rect, TH_TEXT, 10);
902 }
903}
904
905static void dopesheet_region_draw(const bContext *C, ARegion *region)
906{
907 Scene *scene = CTX_data_scene(C);
910 View2D *v2d = &region->v2d;
911 short cfra_flag = 0;
912 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
913
914 if (clip) {
916 }
917
918 /* clear and setup matrix */
920
922
923 /* time grid */
924 if (!minimized) {
926 v2d, scene, sc->flag & SC_SHOW_SECONDS, true);
927 }
928
929 /* data... */
930 clip_draw_dopesheet_main(sc, region, scene);
931
932 /* current frame indicator line */
933 if (sc->flag & SC_SHOW_SECONDS) {
934 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
935 }
936 ANIM_draw_cfra(C, v2d, cfra_flag);
937
938 /* reset view matrix */
940
941 /* time-scrubbing */
942 const int fps = round_db_to_int(scene->frames_per_second());
943 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true, fps);
944
945 /* current frame indicator */
946 ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS, !minimized);
947
948 /* scrollers */
949 if (!minimized) {
950 region->v2d.scroll |= V2D_SCROLL_BOTTOM;
951 UI_view2d_scrollers_draw(v2d, nullptr);
952 }
953 else {
954 region->v2d.scroll &= ~V2D_SCROLL_BOTTOM;
955 }
956}
957
958static void clip_preview_region_draw(const bContext *C, ARegion *region)
959{
961
962 if (sc->view == SC_VIEW_GRAPH) {
963 graph_region_draw(C, region);
964 }
965 else if (sc->view == SC_VIEW_DOPESHEET) {
966 dopesheet_region_draw(C, region);
967 }
968}
969
970static void clip_preview_region_listener(const wmRegionListenerParams * /*params*/) {}
971
973
974/* -------------------------------------------------------------------- */
977
979{
980 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
981 return ELEM(sclip->view, SC_VIEW_DOPESHEET);
982}
983
985{
986 wmKeyMap *keymap;
987
988 /* ensure the 2d view sync works - main region has bottom scroller */
989 region->v2d.scroll = V2D_SCROLL_BOTTOM;
990
991 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
992
993 keymap = WM_keymap_ensure(
994 wm->runtime->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
995 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
996}
997
998static void clip_channels_region_draw(const bContext *C, ARegion *region)
999{
1002 View2D *v2d = &region->v2d;
1003
1004 if (clip) {
1006 }
1007
1008 /* clear and setup matrix */
1010
1012
1013 /* data... */
1015
1016 /* reset view matrix */
1018}
1019
1021
1023
1024/* -------------------------------------------------------------------- */
1027
1028/* add handlers, stuff you only do once or on area/region changes */
1030{
1031 ED_region_header_init(region);
1032}
1033
1034static void clip_header_region_draw(const bContext *C, ARegion *region)
1035{
1036 ED_region_header(C, region);
1037}
1038
1040{
1041 ARegion *region = params->region;
1042 const wmNotifier *wmn = params->notifier;
1043
1044 /* context changes */
1045 switch (wmn->category) {
1046 case NC_SCENE:
1047 switch (wmn->data) {
1048 /* for proportional editmode only */
1049 case ND_TOOLSETTINGS:
1050 /* TODO: should do this when in mask mode only but no data available. */
1051 // if (sc->mode == SC_MODE_MASKEDIT)
1052 {
1053 ED_region_tag_redraw(region);
1054 break;
1055 }
1056 }
1057 break;
1058 }
1059}
1060
1062
1063/* -------------------------------------------------------------------- */
1066
1068{
1069 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1070 return ELEM(sclip->view, SC_VIEW_CLIP);
1071}
1072
1073/* add handlers, stuff you only do once or on area/region changes */
1075{
1076 wmKeyMap *keymap;
1077
1078 ED_region_panels_init(wm, region);
1079
1080 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
1081 WM_event_add_keymap_handler(&region->runtime->handlers, keymap);
1082}
1083
1084static void clip_tools_region_draw(const bContext *C, ARegion *region)
1085{
1086 ED_region_panels(C, region);
1087}
1088
1090
1091/* -------------------------------------------------------------------- */
1094
1096{
1097 ARegion *region = params->region;
1098 const wmNotifier *wmn = params->notifier;
1099
1100 /* context changes */
1101 switch (wmn->category) {
1102 case NC_WM:
1103 if (wmn->data == ND_HISTORY) {
1104 ED_region_tag_redraw(region);
1105 }
1106 break;
1107 case NC_SCENE:
1108 if (wmn->data == ND_MODE) {
1109 ED_region_tag_redraw(region);
1110 }
1111 break;
1112 case NC_SPACE:
1113 if (wmn->data == ND_SPACE_CLIP) {
1114 ED_region_tag_redraw(region);
1115 }
1116 break;
1117 case NC_GPENCIL:
1118 if (wmn->action == NA_EDITED) {
1119 ED_region_tag_redraw(region);
1120 }
1121 break;
1122 }
1123}
1124
1126
1127/* -------------------------------------------------------------------- */
1130
1132{
1133 const SpaceClip *sclip = static_cast<SpaceClip *>(params->area->spacedata.first);
1134 return ELEM(sclip->view, SC_VIEW_CLIP);
1135}
1136
1137/* add handlers, stuff you only do once or on area/region changes */
1139{
1140 wmKeyMap *keymap;
1141
1142 ED_region_panels_init(wm, region);
1143
1144 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
1145 WM_event_add_keymap_handler(&region->runtime->handlers, keymap);
1146}
1147
1148static void clip_properties_region_draw(const bContext *C, ARegion *region)
1149{
1151
1153
1154 ED_region_panels(C, region);
1155}
1156
1158{
1159 ARegion *region = params->region;
1160 const wmNotifier *wmn = params->notifier;
1161
1162 /* context changes */
1163 switch (wmn->category) {
1164 case NC_GPENCIL:
1165 if (ELEM(wmn->data, ND_DATA, ND_GPENCIL_EDITMODE)) {
1166 ED_region_tag_redraw(region);
1167 }
1168 break;
1169 case NC_BRUSH:
1170 if (wmn->action == NA_EDITED) {
1171 ED_region_tag_redraw(region);
1172 }
1173 break;
1174 }
1175}
1176
1178
1179/* -------------------------------------------------------------------- */
1182
1183static void clip_id_remap(ScrArea * /*area*/,
1184 SpaceLink *slink,
1185 const blender::bke::id::IDRemapper &mappings)
1186{
1187 SpaceClip *sclip = (SpaceClip *)slink;
1188
1190 return;
1191 }
1192
1193 mappings.apply(reinterpret_cast<ID **>(&sclip->clip), ID_REMAP_APPLY_ENSURE_REAL);
1194 mappings.apply(reinterpret_cast<ID **>(&sclip->mask_info.mask), ID_REMAP_APPLY_ENSURE_REAL);
1195}
1196
1198{
1199 SpaceClip *sclip = reinterpret_cast<SpaceClip *>(space_link);
1200 const int data_flags = BKE_lib_query_foreachid_process_flags_get(data);
1201 const bool is_readonly = (data_flags & IDWALK_READONLY) != 0;
1202
1207
1208 if (!is_readonly) {
1209 sclip->scopes.ok = 0;
1210 }
1211}
1212
1214{
1215 SpaceClip *sclip = (SpaceClip *)sl;
1216
1217 sclip->scopes.track_search = nullptr;
1218 sclip->scopes.track_preview = nullptr;
1219 sclip->scopes.ok = 0;
1220}
1221
1223{
1224 BLO_write_struct(writer, SpaceClip, sl);
1225}
1226
1228
1229/* -------------------------------------------------------------------- */
1232
1234{
1235 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1236 ARegionType *art;
1237
1238 st->spaceid = SPACE_CLIP;
1239 STRNCPY_UTF8(st->name, "Clip");
1240
1241 st->create = clip_create;
1242 st->free = clip_free;
1243 st->init = clip_init;
1244 st->duplicate = clip_duplicate;
1245 st->operatortypes = clip_operatortypes;
1246 st->keymap = clip_keymap;
1247 st->listener = clip_listener;
1248 st->context = clip_context;
1249 st->gizmos = clip_gizmos;
1250 st->dropboxes = clip_dropboxes;
1251 st->refresh = clip_refresh;
1252 st->id_remap = clip_id_remap;
1253 st->foreach_id = clip_foreach_id;
1254 st->blend_read_data = clip_space_blend_read_data;
1255 st->blend_read_after_liblink = nullptr;
1256 st->blend_write = clip_space_blend_write;
1257
1258 /* regions: main window */
1259 art = MEM_callocN<ARegionType>("spacetype clip region");
1266
1267 BLI_addhead(&st->regiontypes, art);
1268
1269 /* preview */
1270 art = MEM_callocN<ARegionType>("spacetype clip region preview");
1272 art->prefsizey = 240;
1278
1279 BLI_addhead(&st->regiontypes, art);
1280
1281 /* regions: properties */
1282 art = MEM_callocN<ARegionType>("spacetype clip region properties");
1283 art->regionid = RGN_TYPE_UI;
1291 BLI_addhead(&st->regiontypes, art);
1293
1294 /* regions: tools */
1295 art = MEM_callocN<ARegionType>("spacetype clip region tools");
1296 art->regionid = RGN_TYPE_TOOLS;
1303
1304 BLI_addhead(&st->regiontypes, art);
1305
1306 /* regions: header */
1307 art = MEM_callocN<ARegionType>("spacetype clip region");
1309 art->prefsizey = HEADERY;
1311
1315
1316 BLI_addhead(&st->regiontypes, art);
1317
1318 /* channels */
1319 art = MEM_callocN<ARegionType>("spacetype clip channels region");
1327
1328 BLI_addhead(&st->regiontypes, art);
1329
1330 /* regions: hud */
1331 art = ED_area_type_hud(st->spaceid);
1332 BLI_addhead(&st->regiontypes, art);
1333
1334 BKE_spacetype_register(std::move(st));
1335}
1336
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:282
ARegion * BKE_area_region_new()
Definition screen.cc:387
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:846
void BKE_tracking_dopesheet_update(struct MovieTracking *tracking)
Definition tracking.cc:3446
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
MINLINE int round_db_to_int(double a)
#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
#define STRNCPY_UTF8(dst, src)
#define ELEM(...)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define FILTER_ID_MC
Definition DNA_ID.h:1210
#define FILTER_ID_MSK
Definition DNA_ID.h:1212
#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
@ SC_SHOW_CURSOR
@ SC_SHOW_OVERLAYS
@ SC_MODE_TRACKING
@ SC_MODE_MASKEDIT
@ SC_SHOW_SECONDS
@ SC_LOCK_SELECTION
@ SC_SHOW_ANNOTATION
@ SC_LOCK_TIMECURSOR
@ SC_GPENCIL_SRC_TRACK
@ SCLIP_GIZMO_HIDE
#define UI_SCALE_FAC
@ TRACKING_2D_STABILIZATION
@ USER_HEADER_BOTTOM
@ V2D_KEEPOFS_Y
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_LOCKZOOM_Y
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_POS_Y
@ V3D_AROUND_CURSOR
@ DRAWCFRA_UNIT_SECONDS
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_draw_region(Depsgraph *depsgraph, Mask *mask, ARegion *region, bool show_overlays, 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_mask_get_size(ScrArea *area, int *r_width, int *r_height)
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:693
ARegionType * ED_area_type_hud(int space_type)
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3609
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3935
void ED_region_header_init(ARegion *region)
Definition area.cc:3950
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:71
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:3616
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
@ ED_KEYMAP_UI
Definition ED_screen.hh:758
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:764
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:766
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:759
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:761
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:763
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_draw_scale_y__values(const ARegion *region, const View2D *v2d, const rcti *rect, int colorid, int base)
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1504
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:479
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:1739
@ 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:412
#define NC_GEOM
Definition WM_types.hh:393
#define ND_DRAW
Definition WM_types.hh:461
#define NC_BRUSH
Definition WM_types.hh:385
#define NC_WM
Definition WM_types.hh:374
#define ND_DATA
Definition WM_types.hh:509
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:504
#define NA_EVALUATED
Definition WM_types.hh:585
@ WM_DRAG_PATH
Definition WM_types.hh:1208
#define ND_DISPLAY
Definition WM_types.hh:491
#define NC_SCREEN
Definition WM_types.hh:377
#define NC_MOVIECLIP
Definition WM_types.hh:397
#define ND_MODE
Definition WM_types.hh:445
#define ND_ANIMPLAY
Definition WM_types.hh:424
#define NC_SCENE
Definition WM_types.hh:378
#define ND_TOOLSETTINGS
Definition WM_types.hh:449
#define NA_EDITED
Definition WM_types.hh:584
#define ND_FRAME_RANGE
Definition WM_types.hh:451
#define ND_SPACE_CLIP
Definition WM_types.hh:539
#define ND_UNDO
Definition WM_types.hh:417
#define ND_FRAME
Definition WM_types.hh:434
#define NA_REMOVED
Definition WM_types.hh:587
#define ND_SELECT
Definition WM_types.hh:508
#define NC_GPENCIL
Definition WM_types.hh:399
#define NC_MASK
Definition WM_types.hh:398
#define ND_HISTORY
Definition WM_types.hh:415
#define ND_LAYOUTSET
Definition WM_types.hh:426
#define NC_SPACE
Definition WM_types.hh:392
#define NA_SELECTED
Definition WM_types.hh:589
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition anim_draw.cc:54
#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)
nullptr float
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:65
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)
int(* snap_size)(const ARegion *region, int size, int axis)
void(* init)(wmWindowManager *wm, ARegion *region)
ARegionRuntimeHandle * runtime
Definition DNA_ID.h:414
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
struct SpaceClipOverlay overlay
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:1331
PointerRNA * ptr
Definition WM_types.hh:1420
unsigned int data
Definition WM_types.hh:358
unsigned int action
Definition WM_types.hh:358
unsigned int category
Definition WM_types.hh:358
WindowManagerRuntimeHandle * runtime
rcti ED_time_scrub_clamp_scroller_mask(const rcti &scroller_mask)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames, const int base)
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)
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:895
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))