Blender V5.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
8
9#include <cfloat>
10#include <cstring>
11
12#include "DNA_mask_types.h"
13#include "DNA_movieclip_types.h"
14#include "DNA_scene_types.h"
15#include "DNA_view3d_types.h" /* for pivot point */
16
17#include "MEM_guardedalloc.h"
18
19#include "BLI_listbase.hh"
20#include "BLI_math_base_c.hh"
21#include "BLI_path_utils.hh"
22#include "BLI_string_utf8.hh"
23#include "BLI_utildefines.hh"
24
25#include "BKE_context.hh"
26#include "BKE_lib_query.hh"
27#include "BKE_lib_remap.hh"
28#include "BKE_movieclip.hh"
29#include "BKE_screen.hh"
30#include "BKE_tracking.hh"
31
32#include "IMB_imbuf_types.hh"
33
34#include "ED_anim_api.hh" /* for timeline cursor drawing */
35#include "ED_clip.hh"
36#include "ED_mask.hh"
37#include "ED_screen.hh"
38#include "ED_space_api.hh"
39#include "ED_time_scrub_ui.hh"
40#include "ED_uvedit.hh" /* just for ED_image_draw_cursor */
41
42#include "IMB_imbuf.hh"
43
44#include "GPU_matrix.hh"
45
46#include "WM_api.hh"
47#include "WM_types.hh"
48
49#include "UI_interface.hh"
50#include "UI_resources.hh"
51#include "UI_view2d.hh"
52
53#include "BLO_read_write.hh"
54
55#include "RNA_access.hh"
56
57#include "clip_intern.hh" /* own include */
58
59namespace blender {
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 = eView2D_KeepZoom{};
113 region->v2d.keepofs = eView2D_KeepOfs{};
114 region->v2d.align = eView2D_Align{};
115 region->v2d.flag = eView2D_Flag{};
116
117 region->v2d.keeptot = eView2D_KeepTot{};
118 }
119}
120
122{
123 SpaceClip *sc = area->spacedata.first_as<SpaceClip>();
124
125 if (sc->mode != SC_MODE_TRACKING) {
126 return;
127 }
128
129 /* only while properties are visible */
130 for (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 = area->spacedata.first_as<SpaceClip>();
142
145 }
146}
147
148static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
149{
150 SpaceClip *space_clip = area->spacedata.first_as<SpaceClip>();
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 = MEM_new<SpaceClip>(__func__);
164
165 /* header */
166 region = BKE_area_region_new();
167
168 BLI_addtail(&sc->regionbase, region);
169 region->regiontype = RGN_TYPE_HEADER;
171
172 /* tools view */
173 region = BKE_area_region_new();
174
175 BLI_addtail(&sc->regionbase, region);
176 region->regiontype = RGN_TYPE_TOOLS;
177 region->alignment = RGN_ALIGN_LEFT;
178
179 /* properties view */
180 region = BKE_area_region_new();
181
182 BLI_addtail(&sc->regionbase, region);
183 region->regiontype = RGN_TYPE_UI;
184 region->alignment = RGN_ALIGN_RIGHT;
185
186 /* channels view */
187 region = BKE_area_region_new();
188
189 BLI_addtail(&sc->regionbase, region);
191 region->alignment = RGN_ALIGN_LEFT;
192
193 region->v2d.scroll = V2D_SCROLL_BOTTOM;
195
196 /* preview view */
197 region = BKE_area_region_new();
198
199 BLI_addtail(&sc->regionbase, region);
201
202 /* main region */
203 region = BKE_area_region_new();
204
205 BLI_addtail(&sc->regionbase, region);
206 region->regiontype = RGN_TYPE_WINDOW;
207
208 return reinterpret_cast<SpaceLink *>(sc);
209}
210
211/* Doesn't free the space-link itself. */
212static void clip_free(SpaceLink *sl)
213{
214 SpaceClip *sc = reinterpret_cast<SpaceClip *>(sl);
215
216 sc->clip = nullptr;
217
218 if (sc->scopes.track_preview) {
220 }
221
222 if (sc->scopes.track_search) {
224 }
225}
226
227/* spacetype; init callback */
228static void clip_init(wmWindowManager * /*wm*/, ScrArea *area)
229{
230 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
231
232 /* add drop boxes */
234}
235
237{
238 SpaceClip *scn = MEM_new<SpaceClip>("clip_duplicate", *reinterpret_cast<SpaceClip *>(sl));
239
240 /* clear or remove stuff from old */
241 scn->scopes.track_search = nullptr;
242 scn->scopes.track_preview = nullptr;
243 scn->scopes.ok = false;
244
245 return reinterpret_cast<SpaceLink *>(scn);
246}
247
248static void clip_listener(const wmSpaceTypeListenerParams *params)
249{
250 ScrArea *area = params->area;
251 const wmNotifier *wmn = params->notifier;
252 const Scene *scene = params->scene;
253
254 /* context changes */
255 switch (wmn->category) {
256 case NC_SCENE:
257 switch (wmn->data) {
258 case ND_FRAME:
261
262 case ND_FRAME_RANGE:
263 ED_area_tag_redraw(area);
264 break;
265 }
266 break;
267 case NC_MOVIECLIP:
268 switch (wmn->data) {
269 case ND_DISPLAY:
270 case ND_SELECT:
272 ED_area_tag_redraw(area);
273 break;
274 }
275 switch (wmn->action) {
276 case NA_REMOVED:
277 case NA_EDITED:
278 case NA_EVALUATED:
279 /* fall-through */
280
281 case NA_SELECTED:
283 ED_area_tag_redraw(area);
284 break;
285 }
286 break;
287 case NC_MASK:
288 switch (wmn->data) {
289 case ND_SELECT:
290 case ND_DATA:
291 case ND_DRAW:
292 ED_area_tag_redraw(area);
293 break;
294 }
295 switch (wmn->action) {
296 case NA_SELECTED:
297 ED_area_tag_redraw(area);
298 break;
299 case NA_EDITED:
300 ED_area_tag_redraw(area);
301 break;
302 }
303 break;
304 case NC_GEOM:
305 switch (wmn->data) {
306 case ND_SELECT:
308 ED_area_tag_redraw(area);
309 break;
310 }
311 break;
312 case NC_SCREEN:
313 switch (wmn->data) {
314 case ND_ANIMPLAY:
315 ED_area_tag_redraw(area);
316 break;
317 case ND_LAYOUTSET:
319 break;
320 }
321 break;
322 case NC_SPACE:
323 if (wmn->data == ND_SPACE_CLIP) {
325 ED_area_tag_redraw(area);
326 }
327 break;
328 case NC_GPENCIL:
329 if (wmn->action == NA_EDITED) {
331 ED_area_tag_redraw(area);
332 }
333 else if (wmn->data & ND_GPENCIL_EDITMODE) {
334 ED_area_tag_redraw(area);
335 }
336 break;
337 case NC_WM:
338 switch (wmn->data) {
339 case ND_FILEREAD:
340 case ND_UNDO:
342 break;
343 }
344 break;
345 }
346}
347
349{
350 /* `clip_ops.cc` */
364#ifdef WITH_INPUT_NDOF
365 WM_operatortype_append(CLIP_OT_view_ndof);
366#endif
371
372 /* `tracking_ops.cc` */
373
374 /* navigation */
376
377 /* selection */
384
385 /* markers */
391
392 /* track */
395
396 /* solving */
399
404
406
407 /* orientation */
414
415 /* detect */
417
418 /* stabilization */
425
426 /* clean-up */
431
433
434 /* object tracking */
437
438 /* clipboard */
441
442 /* Plane tracker */
445
448
451
452 /* `clip_graph_ops.cc` */
453
454 /* graph editing */
455
456 /* selection */
460
465
467
468 /* `clip_dopesheet_ops.cc` */
469
472}
473
474static void clip_keymap(wmKeyConfig *keyconf)
475{
476 /* ******** Global hotkeys available for all regions ******** */
478
479 /* ******** Hotkeys available for main region only ******** */
480 WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
481 // keymap->poll = ED_space_clip_tracking_poll;
482
483 /* ******** Hotkeys available for preview region only ******** */
484 WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
485
486 /* ******** Hotkeys available for channels region only ******** */
487 WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
488}
489
490/* DO NOT make this static, this hides the symbol and breaks API generation script. */
491extern "C" const char *clip_context_dir[]; /* quiet warning. */
492const char *clip_context_dir[] = {"edit_movieclip", "edit_mask", nullptr};
493
494static int /*eContextResult*/ clip_context(const bContext *C,
495 const char *member,
497{
499
500 if (CTX_data_dir(member)) {
502
503 return CTX_RESULT_OK;
504 }
505 if (CTX_data_equals(member, "edit_movieclip")) {
506 if (sc->clip) {
508 }
509 return CTX_RESULT_OK;
510 }
511 if (CTX_data_equals(member, "edit_mask")) {
512 if (sc->mask_info.mask) {
514 }
515 return CTX_RESULT_OK;
516 }
517
519}
520
521/* dropboxes */
522static bool clip_drop_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
523{
524 if (drag->type == WM_DRAG_PATH) {
526 if (ELEM(file_type, FILE_TYPE_IMAGE, FILE_TYPE_MOVIE)) {
527 return true;
528 }
529 }
530
531 return false;
532}
533
534static void clip_drop_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop)
535{
536 PointerRNA itemptr;
537 char dir[FILE_MAX], file[FILE_MAX];
538
539 BLI_path_split_dir_file(WM_drag_get_single_path(drag), dir, sizeof(dir), file, sizeof(file));
540
541 RNA_string_set(drop->ptr, "directory", dir);
542
543 RNA_collection_clear(drop->ptr, "files");
544 RNA_collection_add(drop->ptr, "files", &itemptr);
545 RNA_string_set(&itemptr, "name", file);
546}
547
548/* area+region dropbox definition */
549static void clip_dropboxes()
550{
551 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
552
553 WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, nullptr, nullptr);
554}
555
556static void clip_refresh(const bContext *C, ScrArea *area)
557{
558 Scene *scene = CTX_data_scene(C);
559 SpaceClip *sc = area->spacedata.first_as<SpaceClip>();
560
561 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
562 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
563 init_preview_region(scene, area, sc, region_preview);
564 region_preview->v2d.cur = region_preview->v2d.tot;
565 }
566 /* #V2D_VIEWSYNC_AREA_VERTICAL must always be set for the dopesheet view, in graph view it must
567 * be unset. This is enforced by region re-initialization.
568 * That means if it's not set correctly, the view just changed and needs re-initialization */
569 else if (sc->view == SC_VIEW_DOPESHEET) {
570 if ((region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) == 0) {
571 init_preview_region(scene, area, sc, region_preview);
572 }
573 }
574 else {
575 if (region_preview->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) {
576 init_preview_region(scene, area, sc, region_preview);
577 }
578 }
579
581}
582
584{
585 ui::VIEW2D_GGT_navigate_impl(gzgt, "CLIP_GGT_navigate");
586}
587
588static void clip_gizmos()
589{
591 wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(&gizmo_params);
592
594}
595
597
598/* -------------------------------------------------------------------- */
601
602/* sets up the fields of the View2D from zoom and offset */
604{
606 float x1, y1, w, h, aspx, aspy;
607 int width, height, winx, winy;
608
609 ED_space_clip_get_size(sc, &width, &height);
610 ED_space_clip_get_aspect(sc, &aspx, &aspy);
611
612 w = width * aspx;
613 h = height * aspy;
614
615 winx = BLI_rcti_size_x(&region->winrct) + 1;
616 winy = BLI_rcti_size_y(&region->winrct) + 1;
617
618 region->v2d.tot.xmin = 0;
619 region->v2d.tot.ymin = 0;
620 region->v2d.tot.xmax = w;
621 region->v2d.tot.ymax = h;
622
623 region->v2d.mask.xmin = region->v2d.mask.ymin = 0;
624 region->v2d.mask.xmax = winx;
625 region->v2d.mask.ymax = winy;
626
627 /* which part of the image space do we see? */
628 x1 = region->winrct.xmin + (winx - sc->zoom * w) / 2.0f;
629 y1 = region->winrct.ymin + (winy - sc->zoom * h) / 2.0f;
630
631 x1 -= sc->zoom * sc->xof;
632 y1 -= sc->zoom * sc->yof;
633
634 /* relative display right */
635 region->v2d.cur.xmin = (region->winrct.xmin - x1) / sc->zoom;
636 region->v2d.cur.xmax = region->v2d.cur.xmin + (float(winx) / sc->zoom);
637
638 /* relative display left */
639 region->v2d.cur.ymin = (region->winrct.ymin - y1) / sc->zoom;
640 region->v2d.cur.ymax = region->v2d.cur.ymin + (float(winy) / sc->zoom);
641
642 /* normalize 0.0..1.0 */
643 region->v2d.cur.xmin /= w;
644 region->v2d.cur.xmax /= w;
645 region->v2d.cur.ymin /= h;
646 region->v2d.cur.ymax /= h;
647}
648
649static bool clip_main_region_poll(const RegionPollParams *params)
650{
651 const SpaceClip *sclip = params->area->spacedata.first_as<SpaceClip>();
652 return ELEM(sclip->view, SC_VIEW_CLIP);
653}
654
655/* add handlers, stuff you only do once or on area/region changes */
657{
658 wmKeyMap *keymap;
659
660 /* NOTE: don't use `view2d_region_reinit(&region->v2d, ...)`
661 * since the space clip manages its own v2d in #movieclip_main_area_set_view2d */
662
663 /* mask polls mode */
664 keymap = WM_keymap_ensure(
665 wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
667
668 /* own keymap */
669 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
671
672 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
674}
675
676static void clip_main_region_draw(const bContext *C, ARegion *region)
677{
678 /* draw entirely, view changes should be handled here */
681 ScrArea *area = CTX_wm_area(C);
682 float aspx, aspy, zoomx, zoomy, x, y;
683 int width, height;
684 bool show_cursor = false;
685
686 /* If tracking is in progress, we should synchronize the frame from the clip-user
687 * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
688 if (clip && clip->tracking_context) {
690 &sc->user);
691 }
692
693 if (sc->flag & SC_LOCK_SELECTION) {
694 ImBuf *tmpibuf = nullptr;
695
697 tmpibuf = ED_space_clip_get_stable_buffer(sc, nullptr, nullptr, nullptr);
698 }
699
700 if (ED_clip_view_selection(C, region, false)) {
701 sc->xof += sc->xlockof;
702 sc->yof += sc->ylockof;
703 }
704
705 if (tmpibuf) {
706 IMB_freeImBuf(tmpibuf);
707 }
708 }
709
710 /* clear and setup matrix */
712
713 /* data... */
715
716 /* callback */
718
719 clip_draw_main(C, sc, region);
720
721 /* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
722 ui::view2d_view_to_region_fl(&region->v2d, 0.0f, 0.0f, &x, &y);
723 ED_space_clip_get_size(sc, &width, &height);
724 ED_space_clip_get_zoom(sc, region, &zoomx, &zoomy);
725 ED_space_clip_get_aspect(sc, &aspx, &aspy);
726
727 if (sc->mode == SC_MODE_MASKEDIT) {
729 if (mask && clip) {
730 ScrArea *area = CTX_wm_area(C);
731 int mask_width, mask_height;
732 ED_mask_get_size(area, &mask_width, &mask_height);
734 mask,
735 region,
741 mask_width,
742 mask_height,
743 aspx,
744 aspy,
745 true,
746 true,
747 sc->stabmat,
748 C);
749 }
750 }
751
752 show_cursor |= sc->mode == SC_MODE_MASKEDIT;
753 show_cursor |= sc->around == V3D_AROUND_CURSOR;
754
755 if (sc->overlay.flag & SC_SHOW_OVERLAYS && sc->overlay.flag & SC_SHOW_CURSOR && show_cursor) {
758 GPU_matrix_scale_2f(zoomx, zoomy);
760 GPU_matrix_scale_2f(width, height);
761 ED_image_draw_cursor(region, sc->cursor);
763 }
764
765 clip_draw_cache_and_notes(C, sc, region);
766
768 /* Grease Pencil */
769 clip_draw_grease_pencil(const_cast<bContext *>(C), true);
770 }
771
772 /* callback */
773 /* TODO(sergey): For being consistent with space image the projection needs to be configured
774 * the way how the commented out code does it. This works correct for tracking data, but it
775 * causes wrong aspect correction for mask editor (see #84990). */
776 // GPU_matrix_push_projection();
777 // wmOrtho2(region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin,
778 // region->v2d.cur.ymax);
780 // GPU_matrix_pop_projection();
781
782 /* reset view matrix */
784
786 /* draw Grease Pencil - screen space only */
787 clip_draw_grease_pencil(const_cast<bContext *>(C), false);
788 }
789 if ((sc->gizmo_flag & SCLIP_GIZMO_HIDE) == 0) {
791 }
792
793 ED_area_hud_region_set_padding_flag(area, region, true);
794}
795
797{
798 ARegion *region = params->region;
799 const wmNotifier *wmn = params->notifier;
800
801 /* context changes */
802 switch (wmn->category) {
803 case NC_GPENCIL:
804 if (wmn->action == NA_EDITED) {
805 ED_region_tag_redraw(region);
806 }
807 else if (wmn->data & ND_GPENCIL_EDITMODE) {
808 ED_region_tag_redraw(region);
809 }
810 break;
811 }
812}
813
815
816/* -------------------------------------------------------------------- */
819
821{
822 const SpaceClip *sclip = params->area->spacedata.first_as<SpaceClip>();
823 return ELEM(sclip->view, SC_VIEW_GRAPH, SC_VIEW_DOPESHEET);
824}
825
827{
828 wmKeyMap *keymap;
829
830 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
831
832 /* own keymap */
833
834 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Clip", SPACE_CLIP, RGN_TYPE_WINDOW);
836
837 keymap = WM_keymap_ensure(
838 wm->runtime->defaultconf, "Clip Time Scrub", SPACE_CLIP, RGN_TYPE_PREVIEW);
841
842 keymap = WM_keymap_ensure(
843 wm->runtime->defaultconf, "Clip Graph Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
845
846 keymap = WM_keymap_ensure(
847 wm->runtime->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, RGN_TYPE_WINDOW);
849}
850
851static void graph_region_draw(const bContext *C, ARegion *region)
852{
853 View2D *v2d = &region->v2d;
855 Scene *scene = CTX_data_scene(C);
856 short cfra_flag = 0;
857 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
858
859 if (sc->flag & SC_LOCK_TIMECURSOR) {
861 }
862
863 /* clear and setup matrix */
865
867
868 /* data... */
869 clip_draw_graph(sc, region, scene);
870
871 /* current frame indicator line */
872 if (sc->flag & SC_SHOW_SECONDS) {
873 cfra_flag |= DRAWCFRA_UNIT_SECONDS;
874 }
875 ANIM_draw_cfra(C, v2d, cfra_flag);
876
877 /* reset view matrix */
879
880 /* time-scrubbing */
881 const int fps = round_db_to_int(scene->frames_per_second());
882 ED_time_scrub_draw(region, scene, sc->flag & SC_SHOW_SECONDS, true, fps);
883
884 /* current frame indicator */
885 ED_time_scrub_draw_current_frame(region, scene, sc->flag & SC_SHOW_SECONDS, !minimized);
886
887 /* scrollers */
888 if (!minimized) {
889 const rcti scroller_mask = ED_time_scrub_clamp_scroller_mask(v2d->mask);
890 region->v2d.scroll |= V2D_SCROLL_BOTTOM;
891 ui::view2d_scrollers_draw(v2d, &scroller_mask);
892 }
893 else {
894 region->v2d.scroll &= ~V2D_SCROLL_BOTTOM;
895 }
896
897 /* scale indicators */
898 {
899 rcti rect;
901 &rect, 0, 15 * UI_SCALE_FAC, 15 * UI_SCALE_FAC, region->winy - UI_TIME_SCRUB_MARGIN_Y);
902 ui::view2d_draw_scale_y(region, v2d, &rect, TH_TEXT, 10);
903 }
904}
905
906static void dopesheet_region_draw(const bContext *C, ARegion *region)
907{
908 Scene *scene = CTX_data_scene(C);
911 View2D *v2d = &region->v2d;
912 short cfra_flag = 0;
913 const bool minimized = (region->winy <= HEADERY * UI_SCALE_FAC * 1.1f);
914
915 if (clip) {
917 }
918
919 /* clear and setup matrix */
921
923
924 /* time grid */
925 if (!minimized) {
926 ui::view2d_draw_lines_x_frames(v2d, scene, sc->flag & SC_SHOW_SECONDS, false, 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 = params->area->spacedata.first_as<SpaceClip>();
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 view2d_region_reinit(&region->v2d, ui::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);
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 = params->area->spacedata.first_as<SpaceClip>();
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 = params->area->spacedata.first_as<SpaceClip>();
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 bke::id::IDRemapper &mappings)
1186{
1187 SpaceClip *sclip = reinterpret_cast<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 = reinterpret_cast<SpaceClip *>(sl);
1216
1217 sclip->scopes.track_search = nullptr;
1218 sclip->scopes.track_preview = nullptr;
1219 sclip->scopes.ok = 0;
1220}
1221
1223{
1224 writer->write_struct_cast<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 st->struct_size = sizeof(SpaceClip);
1241
1242 st->create = clip_create;
1243 st->free = clip_free;
1244 st->init = clip_init;
1245 st->duplicate = clip_duplicate;
1246 st->operatortypes = clip_operatortypes;
1247 st->keymap = clip_keymap;
1248 st->listener = clip_listener;
1249 st->context = clip_context;
1250 st->gizmos = clip_gizmos;
1251 st->dropboxes = clip_dropboxes;
1252 st->refresh = clip_refresh;
1253 st->id_remap = clip_id_remap;
1254 st->foreach_id = clip_foreach_id;
1255 st->blend_read_data = clip_space_blend_read_data;
1256 st->blend_read_after_liblink = nullptr;
1257 st->blend_write = clip_space_blend_write;
1258
1259 /* regions: main window */
1260 art = MEM_new_zeroed<ARegionType>("spacetype clip region");
1267
1268 BLI_addhead(&st->regiontypes, art);
1269
1270 /* preview */
1271 art = MEM_new_zeroed<ARegionType>("spacetype clip region preview");
1273 art->prefsizey = 240;
1279
1280 BLI_addhead(&st->regiontypes, art);
1281
1282 /* regions: properties */
1283 art = MEM_new_zeroed<ARegionType>("spacetype clip region properties");
1284 art->regionid = RGN_TYPE_UI;
1293 BLI_addhead(&st->regiontypes, art);
1295
1296 /* regions: tools */
1297 art = MEM_new_zeroed<ARegionType>("spacetype clip region tools");
1298 art->regionid = RGN_TYPE_TOOLS;
1306
1307 BLI_addhead(&st->regiontypes, art);
1308
1309 /* regions: header */
1310 art = MEM_new_zeroed<ARegionType>("spacetype clip region");
1312 art->prefsizey = HEADERY;
1314
1318
1319 BLI_addhead(&st->regiontypes, art);
1320
1321 /* channels */
1322 art = MEM_new_zeroed<ARegionType>("spacetype clip channels region");
1330
1331 BLI_addhead(&st->regiontypes, art);
1332
1333 /* regions: hud */
1334 art = ui::ED_area_type_hud(st->spaceid);
1335 BLI_addhead(&st->regiontypes, art);
1336
1337 BKE_spacetype_register(std::move(st));
1338}
1339
1341
1342} // namespace blender
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define ATTR_FALLTHROUGH
#define FILE_MAX
#define STRNCPY_UTF8(dst, src)
#define FILTER_ID_MC
Definition DNA_ID.h:1212
#define FILTER_ID_MSK
Definition DNA_ID.h:1214
#define MAXFRAMEF
#define HEADERY
#define UI_SCALE_FAC
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_COMPACT_PANEL_WIDTH
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:493
#define ND_FILEREAD
Definition WM_types.hh:428
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DRAW
Definition WM_types.hh:502
#define NC_BRUSH
Definition WM_types.hh:398
#define NC_WM
Definition WM_types.hh:387
#define ND_DATA
Definition WM_types.hh:552
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:547
#define NA_EVALUATED
Definition WM_types.hh:635
#define ND_DISPLAY
Definition WM_types.hh:534
#define NC_SCREEN
Definition WM_types.hh:390
#define NC_MOVIECLIP
Definition WM_types.hh:410
#define ND_MODE
Definition WM_types.hh:464
#define ND_ANIMPLAY
Definition WM_types.hh:441
#define NC_SCENE
Definition WM_types.hh:391
#define ND_TOOLSETTINGS
Definition WM_types.hh:468
#define NA_EDITED
Definition WM_types.hh:634
#define ND_FRAME_RANGE
Definition WM_types.hh:470
#define ND_SPACE_CLIP
Definition WM_types.hh:582
#define ND_UNDO
Definition WM_types.hh:433
#define ND_FRAME
Definition WM_types.hh:453
#define NA_REMOVED
Definition WM_types.hh:637
#define ND_SELECT
Definition WM_types.hh:551
#define NC_GPENCIL
Definition WM_types.hh:412
#define NC_MASK
Definition WM_types.hh:411
#define ND_HISTORY
Definition WM_types.hh:431
#define ND_LAYOUTSET
Definition WM_types.hh:443
#define NC_SPACE
Definition WM_types.hh:405
#define NA_SELECTED
Definition WM_types.hh:639
#define ELEM(...)
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
#define FLT_MAX
#define FLT_MIN
void frame_buffer_clear(int colorid)
void 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:1720
void view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1080
void view2d_view_restore(const bContext *C)
Definition view2d.cc:1147
ARegionType * ED_area_type_hud(int space_type)
void view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1487
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
void view2d_draw_scale_y(const ARegion *region, const View2D *v2d, const rcti *rect, int colorid, int base)
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:60
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:56
void view2d_draw_lines_x_frames(const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines)
BMesh Iterators.
void CLIP_OT_add_marker(wmOperatorType *ot)
UserDef U
Definition blender.cc:58
void CLIP_OT_create_plane_track(wmOperatorType *ot)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void CLIP_OT_graph_select_all_markers(wmOperatorType *ot)
const char * WM_drag_get_single_path(const wmDrag *drag)
static bool clip_drop_poll(bContext *, wmDrag *drag, const wmEvent *)
void ED_space_clip_get_size(const SpaceClip *sc, int *r_width, int *r_height)
void ED_image_draw_cursor(ARegion *region, const float cursor[2])
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk, bool clamp_playhead)
static void clip_preview_region_draw(const bContext *C, ARegion *region)
void CLIP_OT_stabilize_2d_add(wmOperatorType *ot)
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1164
void CLIP_OT_keyframe_insert(wmOperatorType *ot)
ScrArea * CTX_wm_area(const bContext *C)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames, const int base)
wmDropBox * WM_dropbox_add(ListBaseT< wmDropBox > *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)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
void clip_draw_graph(SpaceClip *sc, ARegion *region, Scene *scene)
static bool clip_channels_region_poll(const RegionPollParams *params)
void CLIP_OT_tracking_object_remove(wmOperatorType *ot)
void CLIP_OT_keyframe_delete(wmOperatorType *ot)
void CLIP_OT_average_tracks(wmOperatorType *ot)
static void clip_header_region_init(wmWindowManager *, ARegion *region)
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
static SpaceLink * clip_create(const ScrArea *, const Scene *)
static void clip_listener(const wmSpaceTypeListenerParams *params)
@ V2D_VIEWSYNC_AREA_VERTICAL
void CLIP_OT_track_markers(wmOperatorType *ot)
static bool clip_properties_region_poll(const RegionPollParams *params)
void CLIP_OT_join_tracks(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:98
static void clip_tools_region_draw(const bContext *C, ARegion *region)
void CLIP_OT_clear_solution(wmOperatorType *ot)
void CLIP_OT_solve_camera(wmOperatorType *ot)
static void clip_free(SpaceLink *sl)
static void clip_preview_region_init(wmWindowManager *wm, ARegion *region)
static void clip_header_region_listener(const wmRegionListenerParams *params)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void CLIP_OT_copy_tracks(wmOperatorType *ot)
void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
Definition anim_draw.cc:60
void CLIP_OT_lock_tracks(wmOperatorType *ot)
SpaceClip * CTX_wm_space_clip(const bContext *C)
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
Definition clip_ops.cc:1574
void CLIP_OT_select_grouped(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_select(wmOperatorType *ot)
@ WM_DRAG_PATH
Definition WM_types.hh:1302
void CLIP_OT_hide_tracks(wmOperatorType *ot)
void CLIP_OT_view_selected(wmOperatorType *ot)
Definition clip_ops.cc:1045
void CLIP_OT_slide_marker(wmOperatorType *ot)
static void clip_init(wmWindowManager *, ScrArea *area)
void CLIP_OT_set_plane(wmOperatorType *ot)
@ TH_TIME_SCRUB_BACKGROUND
static void clip_header_region_draw(const bContext *C, ARegion *region)
static void clip_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
void CLIP_OT_tracking_object_new(wmOperatorType *ot)
bool CTX_data_equals(const char *member, const char *str)
static void CLIP_GGT_navigate(wmGizmoGroupType *gzgt)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
void CLIP_OT_frame_jump(wmOperatorType *ot)
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
Definition lib_query.cc:133
void CLIP_OT_slide_plane_marker(wmOperatorType *ot)
void CLIP_OT_mode_set(wmOperatorType *ot)
Definition clip_ops.cc:1612
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
Definition clip_ops.cc:782
void GPU_matrix_mul(const float m[4][4])
void CLIP_OT_select_lasso(wmOperatorType *ot)
void GPU_matrix_scale_2f(float x, float y)
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
static void clip_gizmos()
static void clip_properties_region_draw(const bContext *C, ARegion *region)
void CLIP_OT_graph_select(wmOperatorType *ot)
void CLIP_OT_add_marker_at_click(wmOperatorType *ot)
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
static bool clip_tools_region_poll(const RegionPollParams *params)
void CLIP_OT_detect_features(wmOperatorType *ot)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.hh:207
static void clip_area_sync_frame_from_scene(ScrArea *area, const Scene *scene)
void CLIP_OT_delete_track(wmOperatorType *ot)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBaseT< wmEventHandler > *handlers, ListBaseT< wmDropBox > *dropboxes)
void IMB_freeImBuf(ImBuf *ibuf)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
static void clip_scopes_check_gpencil_change(ScrArea *area)
void CLIP_OT_prefetch(wmOperatorType *ot)
Definition clip_ops.cc:1724
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:73
static void clip_channels_region_draw(const bContext *C, ARegion *region)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(wmGizmoGroupType *))
void CLIP_OT_apply_solution_scale(wmOperatorType *ot)
void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *region)
BMesh const char void * data
static void clip_properties_region_init(wmWindowManager *wm, ARegion *region)
void CLIP_OT_view_center_cursor(wmOperatorType *ot)
Definition clip_ops.cc:1013
void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
static void clip_main_region_draw(const bContext *C, ARegion *region)
bool ED_clip_view_selection(const bContext *C, const ARegion *region, bool fit)
void ED_clip_buttons_register(ARegionType *art)
void CLIP_OT_stabilize_2d_rotation_select(wmOperatorType *ot)
static int clip_context(const bContext *C, const char *member, bContextDataResult *result)
void clip_draw_grease_pencil(bContext *C, int onlyv2d)
void clip_draw_cache_and_notes(const bContext *C, SpaceClip *sc, ARegion *region)
ImBuf * ED_space_clip_get_stable_buffer(const SpaceClip *sc, float loc[2], float *scale, float *angle)
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3999
static void init_preview_region(const Scene *scene, const ScrArea *area, const SpaceClip *sc, ARegion *region)
Definition space_clip.cc:65
void CLIP_OT_graph_center_current_frame(wmOperatorType *ot)
bool ED_time_scrub_event_in_region_poll(const wmWindow *, const ScrArea *, const ARegion *region, const wmEvent *event)
void BKE_movieclip_update_scopes(MovieClip *clip, const MovieClipUser *user, MovieClipScopes *scopes)
static void clip_operatortypes()
void ED_mask_get_size(ScrArea *area, int *r_width, int *r_height)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:935
rcti ED_time_scrub_clamp_scroller_mask(const rcti &scroller_mask)
Mask * CTX_data_edit_mask(const bContext *C)
void CLIP_OT_open(wmOperatorType *ot)
Definition clip_ops.cc:304
void CLIP_OT_graph_view_all(wmOperatorType *ot)
const char * clip_context_dir[]
void CLIP_OT_clear_track_path(wmOperatorType *ot)
static void clip_channels_region_init(wmWindowManager *wm, ARegion *region)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
static void clip_channels_region_listener(const wmRegionListenerParams *)
ARegion * BKE_area_region_new()
Definition screen.cc:522
void CLIP_OT_select(wmOperatorType *ot)
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
Definition clip_ops.cc:839
void GPU_matrix_translate_2f(float x, float y)
static SpaceLink * clip_duplicate(SpaceLink *sl)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.hh:203
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition clip_ops.cc:716
static void clip_props_region_listener(const wmRegionListenerParams *params)
bool CTX_data_dir(const char *member)
void CLIP_OT_select_all(wmOperatorType *ot)
@ ED_KEYMAP_UI
Definition ED_screen.hh:852
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:858
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:860
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:855
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:857
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:853
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:974
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:891
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
static void clip_tools_region_init(wmWindowManager *wm, ARegion *region)
static void graph_region_draw(const bContext *C, ARegion *region)
wmEventHandler_Keymap * WM_event_add_keymap_handler_poll(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
Definition rct.cc:428
int WM_drag_get_path_file_type(const wmDrag *drag)
@ DRAWCFRA_UNIT_SECONDS
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:1024
static void clip_keymap(wmKeyConfig *keyconf)
void CLIP_OT_paste_tracks(wmOperatorType *ot)
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_SCROLL_VERTICAL_HANDLES
void CLIP_OT_refine_markers(wmOperatorType *ot)
void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot)
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
void CLIP_OT_new_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_reload(wmOperatorType *ot)
Definition clip_ops.cc:351
static void clip_refresh(const bContext *C, ScrArea *area)
static void clip_id_remap(ScrArea *, SpaceLink *slink, const bke::id::IDRemapper &mappings)
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
void CLIP_OT_set_solver_keyframe(wmOperatorType *ot)
void CLIP_OT_set_origin(wmOperatorType *ot)
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:379
void CLIP_OT_set_scale(wmOperatorType *ot)
static void dopesheet_region_draw(const bContext *C, ARegion *region)
static void clip_main_region_listener(const wmRegionListenerParams *params)
static void clip_space_blend_write(BlendWriter *writer, SpaceLink *sl)
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
void ED_area_hud_region_set_padding_flag(ScrArea *area, ARegion *changed_region, const bool set_padding=false)
Definition area.cc:851
void ED_region_header_init(ARegion *region)
Definition area.cc:4406
void CLIP_OT_set_solution_scale(wmOperatorType *ot)
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
void CLIP_OT_delete_marker(wmOperatorType *ot)
void CLIP_OT_update_image_from_plane_marker(wmOperatorType *ot)
void CLIP_OT_track_copy_color(wmOperatorType *ot)
void ED_spacetype_clip()
Scene * CTX_data_scene(const bContext *C)
static void clip_preview_region_listener(const wmRegionListenerParams *)
static void clip_properties_region_listener(const wmRegionListenerParams *params)
static void clip_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
static bool clip_main_region_poll(const RegionPollParams *params)
void BKE_autotrack_context_sync_user(AutoTrackContext *context, MovieClipUser *user)
@ CTX_RESULT_MEMBER_NOT_FOUND
void CLIP_OT_disable_markers(wmOperatorType *ot)
void CLIP_OT_graph_select_box(wmOperatorType *ot)
@ ID_REMAP_APPLY_ENSURE_REAL
@ IDWALK_CB_DIRECT_WEAK_LINK
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1867
void clip_draw_dopesheet_channels(const bContext *C, ARegion *region)
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1765
void CLIP_OT_dopesheet_view_all(wmOperatorType *ot)
void CLIP_OT_select_box(wmOperatorType *ot)
void GPU_matrix_pop()
static bool clip_preview_region_poll(const RegionPollParams *params)
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:4391
static void clip_drop_copy(bContext *, wmDrag *drag, wmDropBox *drop)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
static void clip_dropboxes()
static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
void CLIP_OT_graph_delete_curve(wmOperatorType *ot)
void CLIP_OT_clean_tracks(wmOperatorType *ot)
void ED_space_clip_get_zoom(const SpaceClip *sc, const ARegion *region, float *r_zoomx, float *r_zoomy)
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:4006
void ED_mask_draw_region(Depsgraph *depsgraph, Mask *mask, ARegion *region, bool show_overlays, MaskDrawFlag draw_flag, MaskDrawType draw_type, MaskOverlayMode 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:642
void CLIP_OT_set_axis(wmOperatorType *ot)
void CLIP_OT_graph_disable_markers(wmOperatorType *ot)
static void clip_scopes_tag_refresh(ScrArea *area)
void BKE_tracking_dopesheet_update(MovieTracking *tracking)
Definition tracking.cc:3362
void CLIP_OT_select_circle(wmOperatorType *ot)
static void movieclip_main_area_set_view2d(const bContext *C, ARegion *region)
void CLIP_OT_cursor_set(wmOperatorType *ot)
Definition clip_ops.cc:1817
MINLINE int round_db_to_int(double a)
void GPU_matrix_push()
void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
@ WM_GIZMOMAP_DRAWSTEP_2D
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void CLIP_OT_hide_tracks_clear(wmOperatorType *ot)
void CLIP_OT_graph_delete_knot(wmOperatorType *ot)
void CLIP_OT_view_pan(wmOperatorType *ot)
Definition clip_ops.cc:509
void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *region, Scene *scene)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ARegionTypeFlag flag
int(*) snap_size(const ARegion *region, int size, int axis)
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
bool(*) poll(const RegionPollParams *params)
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
eRegion_Type regiontype
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
MaskOverlayMode overlay_mode
struct MovieTracking tracking
MovieTrackingStabilization stabilization
struct RenderData r
ListBaseT< struct wmEventHandler > handlers
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
struct MovieClip * clip
eSpaceClip_Flag flag
eSpaceClip_View view
MaskSpaceInfo mask_info
eSpaceClip_GPencil_Source gpencil_src
eSpaceClip_Mode mode
struct MovieClipScopes scopes
eSpaceClip_Gizmo_Flag gizmo_flag
struct MovieClipUser user
eView3D_Around around
struct SpaceClipOverlay overlay
ListBaseT< ARegion > regionbase
eView2D_KeepTot keeptot
eView2D_KeepOfs keepofs
eView2D_KeepZoom keepzoom
eView2D_Scroll scroll
eView2D_Align align
ListBaseT< wmEventHandler > handlers
eWM_DragDataType type
Definition WM_types.hh:1424
PointerRNA * ptr
Definition WM_types.hh:1524
unsigned int action
Definition WM_types.hh:371
unsigned int category
Definition WM_types.hh:371
unsigned int data
Definition WM_types.hh:371