Blender V4.3
clip_ops.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cerrno>
10#include <fcntl.h>
11#include <sys/types.h>
12
13#ifndef WIN32
14# include <unistd.h>
15#else
16# include <io.h>
17#endif
18
19#include "MEM_guardedalloc.h"
20
21#include "DNA_defaults.h"
22#include "DNA_scene_types.h" /* min/max frames */
23#include "DNA_userdef_types.h"
24
25#include "BLI_fileops.h"
26#include "BLI_math_vector.h"
27#include "BLI_path_utils.hh"
28#include "BLI_rect.h"
29#include "BLI_string.h"
30#include "BLI_task.h"
31#include "BLI_time.h"
32#include "BLI_utildefines.h"
33
34#include "BLT_translation.hh"
35
36#include "BKE_context.hh"
37#include "BKE_global.hh"
38#include "BKE_lib_id.hh"
39#include "BKE_main.hh"
40#include "BKE_movieclip.h"
41#include "BKE_report.hh"
42#include "BKE_tracking.h"
43
44#include "WM_api.hh"
45#include "WM_types.hh"
46
47#include "IMB_imbuf.hh"
48#include "IMB_imbuf_types.hh"
49
50#include "ED_clip.hh"
51#include "ED_screen.hh"
52
53#include "UI_interface.hh"
54
55#include "RNA_access.hh"
56#include "RNA_define.hh"
57#include "RNA_enum_types.hh"
58
59#include "UI_view2d.hh"
60
61#include "DEG_depsgraph.hh"
63
64#include "clip_intern.hh" /* own include */
65
66/* -------------------------------------------------------------------- */
70static void sclip_zoom_set(const bContext *C,
71 float zoom,
72 const float location[2],
73 const bool zoom_to_pos)
74{
76 ARegion *region = CTX_wm_region(C);
77
78 float oldzoom = sc->zoom;
79 int width, height;
80
81 sc->zoom = zoom;
82
83 if (sc->zoom < 0.1f || sc->zoom > 4.0f) {
84 /* check zoom limits */
85 ED_space_clip_get_size(sc, &width, &height);
86
87 width *= sc->zoom;
88 height *= sc->zoom;
89
90 if ((width < 4) && (height < 4) && sc->zoom < oldzoom) {
91 sc->zoom = oldzoom;
92 }
93 else if (BLI_rcti_size_x(&region->winrct) <= sc->zoom) {
94 sc->zoom = oldzoom;
95 }
96 else if (BLI_rcti_size_y(&region->winrct) <= sc->zoom) {
97 sc->zoom = oldzoom;
98 }
99 }
100
101 if (zoom_to_pos && location) {
102 float aspx, aspy, w, h, dx, dy;
103
104 ED_space_clip_get_size(sc, &width, &height);
105 ED_space_clip_get_aspect(sc, &aspx, &aspy);
106
107 w = width * aspx;
108 h = height * aspy;
109
110 dx = ((location[0] - 0.5f) * w - sc->xof) * (sc->zoom - oldzoom) / sc->zoom;
111 dy = ((location[1] - 0.5f) * h - sc->yof) * (sc->zoom - oldzoom) / sc->zoom;
112
114 sc->xlockof += dx;
115 sc->ylockof += dy;
116 }
117 else {
118 sc->xof += dx;
119 sc->yof += dy;
120 }
121 }
122}
123
124static void sclip_zoom_set_factor(const bContext *C,
125 float zoomfac,
126 const float location[2],
127 const bool zoom_to_pos)
128{
130
131 sclip_zoom_set(C, sc->zoom * zoomfac, location, zoom_to_pos);
132}
133
134static void sclip_zoom_set_factor_exec(bContext *C, const wmEvent *event, float factor)
135{
136 ARegion *region = CTX_wm_region(C);
137
138 float location[2], *mpos = nullptr;
139
140 if (event) {
142
143 ED_clip_mouse_pos(sc, region, event->mval, location);
144 mpos = location;
145 }
146
147 sclip_zoom_set_factor(C, factor, mpos, mpos ? (U.uiflag & USER_ZOOM_TO_MOUSEPOS) : false);
148
149 ED_region_tag_redraw(region);
150}
151
154/* -------------------------------------------------------------------- */
158static void clip_filesel(bContext *C, wmOperator *op, const char *dirpath)
159{
160 RNA_string_set(op->ptr, "directory", dirpath);
161
163}
164
165static void open_init(bContext *C, wmOperator *op)
166{
167 PropertyPointerRNA *pprop;
168
169 op->customdata = pprop = MEM_new<PropertyPointerRNA>("OpenPropertyPointerRNA");
171}
172
173static void open_cancel(bContext * /*C*/, wmOperator *op)
174{
175 if (op->customdata) {
176 PropertyPointerRNA *pprop = static_cast<PropertyPointerRNA *>(op->customdata);
177 op->customdata = nullptr;
178 MEM_delete(pprop);
179 }
180}
181
182static int open_exec(bContext *C, wmOperator *op)
183{
185 bScreen *screen = CTX_wm_screen(C);
186 Main *bmain = CTX_data_main(C);
187 PropertyPointerRNA *pprop;
188 MovieClip *clip = nullptr;
189 char filepath[FILE_MAX];
190
191 if (!RNA_collection_is_empty(op->ptr, "files")) {
192 PointerRNA fileptr;
193 PropertyRNA *prop;
194 char dir_only[FILE_MAX], file_only[FILE_MAX];
195 bool relative = RNA_boolean_get(op->ptr, "relative_path");
196
197 RNA_string_get(op->ptr, "directory", dir_only);
198 if (relative) {
199 BLI_path_rel(dir_only, bmain->filepath);
200 }
201
202 prop = RNA_struct_find_property(op->ptr, "files");
203 RNA_property_collection_lookup_int(op->ptr, prop, 0, &fileptr);
204 RNA_string_get(&fileptr, "name", file_only);
205
206 BLI_path_join(filepath, sizeof(filepath), dir_only, file_only);
207 }
208 else {
209 BKE_report(op->reports, RPT_ERROR, "No files selected to be opened");
210
211 return OPERATOR_CANCELLED;
212 }
213
214 /* default to frame 1 if there's no scene in context */
215
216 errno = 0;
217
218 clip = BKE_movieclip_file_add_exists(bmain, filepath);
219
220 if (!clip) {
221 if (op->customdata) {
222 pprop = static_cast<PropertyPointerRNA *>(op->customdata);
223 op->customdata = nullptr;
224 MEM_delete(pprop);
225 }
226
228 RPT_ERROR,
229 "Cannot read '%s': %s",
230 filepath,
231 errno ? strerror(errno) : RPT_("unsupported movie clip format"));
232
233 return OPERATOR_CANCELLED;
234 }
235
236 if (!op->customdata) {
237 open_init(C, op);
238 }
239
240 /* hook into UI */
241 pprop = static_cast<PropertyPointerRNA *>(op->customdata);
242
243 if (pprop->prop) {
244 /* when creating new ID blocks, use is already 1, but RNA
245 * pointer use also increases user, so this compensates it */
246 id_us_min(&clip->id);
247
248 PointerRNA idptr = RNA_id_pointer_create(&clip->id);
249 RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr, nullptr);
250 RNA_property_update(C, &pprop->ptr, pprop->prop);
251 }
252 else if (sc) {
253 ED_space_clip_set_clip(C, screen, sc, clip);
254 }
255
257
259 op->customdata = nullptr;
260 MEM_delete(pprop);
261
262 return OPERATOR_FINISHED;
263}
264
265static int open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
266{
268 char dirpath[FILE_MAX];
269 MovieClip *clip = nullptr;
270
271 if (sc) {
272 clip = ED_space_clip_get_clip(sc);
273 }
274
275 if (clip) {
276 STRNCPY(dirpath, clip->filepath);
277
278 BLI_path_abs(dirpath, CTX_data_main(C)->filepath);
279 BLI_path_parent_dir(dirpath);
280 }
281 else {
282 STRNCPY(dirpath, U.textudir);
283 }
284
285 if (RNA_struct_property_is_set(op->ptr, "files")) {
286 return open_exec(C, op);
287 }
288
289 if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
290 RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS) != 0);
291 }
292
293 open_init(C, op);
294
295 clip_filesel(C, op, dirpath);
296
298}
299
301{
302 /* identifiers */
303 ot->name = "Open Clip";
304 ot->description = "Load a sequence of frames or a movie file";
305 ot->idname = "CLIP_OT_open";
306
307 /* api callbacks */
308 ot->exec = open_exec;
311
312 /* flags */
314
315 /* properties */
323}
324
327/* -------------------------------------------------------------------- */
331static int reload_exec(bContext *C, wmOperator * /*op*/)
332{
334
335 if (!clip) {
336 return OPERATOR_CANCELLED;
337 }
338
341
343
344 return OPERATOR_FINISHED;
345}
346
348{
349 /* identifiers */
350 ot->name = "Reload Clip";
351 ot->description = "Reload clip";
352 ot->idname = "CLIP_OT_reload";
353
354 /* api callbacks */
356}
357
360/* -------------------------------------------------------------------- */
365 float x, y;
366 float xof, yof, xorig, yorig;
369 float *vec;
370};
371
372static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
373{
374 wmWindow *win = CTX_wm_window(C);
376 ViewPanData *vpd;
377
378 op->customdata = vpd = MEM_cnew<ViewPanData>("ClipViewPanData");
379
380 /* Grab will be set when running from gizmo. */
381 vpd->own_cursor = (win->grabcursor == 0);
382 if (vpd->own_cursor) {
384 }
385
386 vpd->x = event->xy[0];
387 vpd->y = event->xy[1];
388
390 vpd->vec = &sc->xlockof;
391 }
392 else {
393 vpd->vec = &sc->xof;
394 }
395
396 copy_v2_v2(&vpd->xof, vpd->vec);
397 copy_v2_v2(&vpd->xorig, &vpd->xof);
398
400
402}
403
404static void view_pan_exit(bContext *C, wmOperator *op, bool cancel)
405{
406 ViewPanData *vpd = static_cast<ViewPanData *>(op->customdata);
407
408 if (cancel) {
409 copy_v2_v2(vpd->vec, &vpd->xorig);
410
412 }
413
414 if (vpd->own_cursor) {
416 }
418}
419
421{
423 float offset[2];
424
425 RNA_float_get_array(op->ptr, "offset", offset);
426
428 sc->xlockof += offset[0];
429 sc->ylockof += offset[1];
430 }
431 else {
432 sc->xof += offset[0];
433 sc->yof += offset[1];
434 }
435
437
438 return OPERATOR_FINISHED;
439}
440
441static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event)
442{
443 if (event->type == MOUSEPAN) {
445 float offset[2];
446
447 offset[0] = (event->prev_xy[0] - event->xy[0]) / sc->zoom;
448 offset[1] = (event->prev_xy[1] - event->xy[1]) / sc->zoom;
449
450 RNA_float_set_array(op->ptr, "offset", offset);
451
452 view_pan_exec(C, op);
453
454 return OPERATOR_FINISHED;
455 }
456
457 view_pan_init(C, op, event);
458
460}
461
462static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
463{
465 ViewPanData *vpd = static_cast<ViewPanData *>(op->customdata);
466 float offset[2];
467
468 switch (event->type) {
469 case MOUSEMOVE:
470 copy_v2_v2(vpd->vec, &vpd->xorig);
471 offset[0] = (vpd->x - event->xy[0]) / sc->zoom;
472 offset[1] = (vpd->y - event->xy[1]) / sc->zoom;
473 RNA_float_set_array(op->ptr, "offset", offset);
474 view_pan_exec(C, op);
475 break;
476 case EVT_ESCKEY:
477 view_pan_exit(C, op, true);
478
479 return OPERATOR_CANCELLED;
480 case EVT_SPACEKEY:
481 view_pan_exit(C, op, false);
482
483 return OPERATOR_FINISHED;
484 default:
485 if (event->type == vpd->launch_event && event->val == KM_RELEASE) {
486 view_pan_exit(C, op, false);
487
488 return OPERATOR_FINISHED;
489 }
490 break;
491 }
492
494}
495
497{
498 view_pan_exit(C, op, true);
499}
500
502{
503 /* identifiers */
504 ot->name = "Pan View";
505 ot->idname = "CLIP_OT_view_pan";
506 ot->description = "Pan the view";
507
508 /* api callbacks */
514
515 /* flags */
517
518 /* properties */
520 "offset",
521 2,
522 nullptr,
523 -FLT_MAX,
524 FLT_MAX,
525 "Offset",
526 "Offset in floating-point units, 1.0 is the width and height of the image",
527 -FLT_MAX,
528 FLT_MAX);
529}
530
533/* -------------------------------------------------------------------- */
538 float x, y;
539 float zoom;
541 float location[2];
545};
546
547static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
548{
549 wmWindow *win = CTX_wm_window(C);
551 ARegion *region = CTX_wm_region(C);
552 ViewZoomData *vpd;
553
554 op->customdata = vpd = MEM_cnew<ViewZoomData>("ClipViewZoomData");
555
556 /* Grab will be set when running from gizmo. */
557 vpd->own_cursor = (win->grabcursor == 0);
558 if (vpd->own_cursor) {
560 }
561
562 if (U.viewzoom == USER_ZOOM_CONTINUE) {
563 /* needs a timer to continue redrawing */
566 }
567
568 vpd->x = event->xy[0];
569 vpd->y = event->xy[1];
570 vpd->zoom = sc->zoom;
572
573 ED_clip_mouse_pos(sc, region, event->mval, vpd->location);
574
576}
577
578static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
579{
581 ViewZoomData *vpd = static_cast<ViewZoomData *>(op->customdata);
582
583 if (cancel) {
584 sc->zoom = vpd->zoom;
586 }
587
588 if (vpd->timer) {
590 }
591
592 if (vpd->own_cursor) {
594 }
596}
597
599{
600 sclip_zoom_set_factor(C, RNA_float_get(op->ptr, "factor"), nullptr, false);
601
603
604 return OPERATOR_FINISHED;
605}
606
607static int view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
608{
609 if (ELEM(event->type, MOUSEZOOM, MOUSEPAN)) {
610 float delta, factor;
611
612 delta = event->prev_xy[0] - event->xy[0] + event->prev_xy[1] - event->xy[1];
613
614 if (U.uiflag & USER_ZOOM_INVERT) {
615 delta *= -1;
616 }
617
618 factor = 1.0f + delta / 300.0f;
619 RNA_float_set(op->ptr, "factor", factor);
620
621 sclip_zoom_set_factor_exec(C, event, factor);
622
623 return OPERATOR_FINISHED;
624 }
625
626 view_zoom_init(C, op, event);
627
629}
630
631static void view_zoom_apply(
632 bContext *C, ViewZoomData *vpd, wmOperator *op, const wmEvent *event, const bool zoom_to_pos)
633{
634 float factor;
635 float delta;
636
637 if (U.viewzoom != USER_ZOOM_SCALE) {
638 if (U.uiflag & USER_ZOOM_HORIZ) {
639 delta = float(event->xy[0] - vpd->x);
640 }
641 else {
642 delta = float(event->xy[1] - vpd->y);
643 }
644 }
645 else {
646 delta = event->xy[0] - vpd->x + event->xy[1] - vpd->y;
647 }
648
649 delta /= U.pixelsize;
650
651 if (U.uiflag & USER_ZOOM_INVERT) {
652 delta = -delta;
653 }
654
655 if (U.viewzoom == USER_ZOOM_CONTINUE) {
656 SpaceClip *sclip = CTX_wm_space_clip(C);
657 double time = BLI_time_now_seconds();
658 float time_step = float(time - vpd->timer_lastdraw);
659 float zfac;
660
661 zfac = 1.0f + ((delta / 20.0f) * time_step);
662 vpd->timer_lastdraw = time;
663 factor = (sclip->zoom * zfac) / vpd->zoom;
664 }
665 else {
666 factor = 1.0f + delta / 300.0f;
667 }
668
669 RNA_float_set(op->ptr, "factor", factor);
670 sclip_zoom_set(C, vpd->zoom * factor, vpd->location, zoom_to_pos);
672}
673
674static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
675{
676 ViewZoomData *vpd = static_cast<ViewZoomData *>(op->customdata);
677 const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init");
678 switch (event->type) {
679 case TIMER:
680 if (event->customdata == vpd->timer) {
681 view_zoom_apply(C, vpd, op, event, use_cursor_init && (U.uiflag & USER_ZOOM_TO_MOUSEPOS));
682 }
683 break;
684 case MOUSEMOVE:
685 view_zoom_apply(C, vpd, op, event, use_cursor_init && (U.uiflag & USER_ZOOM_TO_MOUSEPOS));
686 break;
687 default:
688 if (event->type == vpd->launch_event && event->val == KM_RELEASE) {
689 view_zoom_exit(C, op, false);
690
691 return OPERATOR_FINISHED;
692 }
693 break;
694 }
695
697}
698
700{
701 view_zoom_exit(C, op, true);
702}
703
705{
706 PropertyRNA *prop;
707
708 /* identifiers */
709 ot->name = "View Zoom";
710 ot->idname = "CLIP_OT_view_zoom";
711 ot->description = "Zoom in/out the view";
712
713 /* api callbacks */
719
720 /* flags */
722
723 /* properties */
724 prop = RNA_def_float(ot->srna,
725 "factor",
726 0.0f,
727 -FLT_MAX,
728 FLT_MAX,
729 "Factor",
730 "Zoom factor, values higher than 1.0 zoom in, lower values zoom out",
731 -FLT_MAX,
732 FLT_MAX);
734
736}
737
740/* -------------------------------------------------------------------- */
745{
746 float location[2];
747
748 RNA_float_get_array(op->ptr, "location", location);
749
750 sclip_zoom_set_factor(C, powf(2.0f, 1.0f / 3.0f), location, U.uiflag & USER_ZOOM_TO_MOUSEPOS);
751
753
754 return OPERATOR_FINISHED;
755}
756
757static int view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event)
758{
760 ARegion *region = CTX_wm_region(C);
761
762 float location[2];
763
764 ED_clip_mouse_pos(sc, region, event->mval, location);
765 RNA_float_set_array(op->ptr, "location", location);
766
767 return view_zoom_in_exec(C, op);
768}
769
771{
772 PropertyRNA *prop;
773
774 /* identifiers */
775 ot->name = "Zoom In";
776 ot->idname = "CLIP_OT_view_zoom_in";
777 ot->description = "Zoom in the view";
778
779 /* api callbacks */
783
784 /* flags */
786
787 /* properties */
789 "location",
790 2,
791 nullptr,
792 -FLT_MAX,
793 FLT_MAX,
794 "Location",
795 "Cursor location in screen coordinates",
796 -10.0f,
797 10.0f);
799}
800
802{
803 float location[2];
804
805 RNA_float_get_array(op->ptr, "location", location);
806
807 sclip_zoom_set_factor(C, powf(0.5f, 1.0f / 3.0f), location, U.uiflag & USER_ZOOM_TO_MOUSEPOS);
808
810
811 return OPERATOR_FINISHED;
812}
813
814static int view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event)
815{
817 ARegion *region = CTX_wm_region(C);
818
819 float location[2];
820
821 ED_clip_mouse_pos(sc, region, event->mval, location);
822 RNA_float_set_array(op->ptr, "location", location);
823
824 return view_zoom_out_exec(C, op);
825}
826
828{
829 PropertyRNA *prop;
830
831 /* identifiers */
832 ot->name = "Zoom Out";
833 ot->idname = "CLIP_OT_view_zoom_out";
834 ot->description = "Zoom out the view";
835
836 /* api callbacks */
840
841 /* flags */
843
844 /* properties */
846 "location",
847 2,
848 nullptr,
849 -FLT_MAX,
850 FLT_MAX,
851 "Location",
852 "Cursor location in normalized (0.0 to 1.0) coordinates",
853 -10.0f,
854 10.0f);
856}
857
860/* -------------------------------------------------------------------- */
865{
867
868 sclip_zoom_set(C, RNA_float_get(op->ptr, "ratio"), nullptr, false);
869
870 /* ensure pixel exact locations for draw */
871 sc->xof = int(sc->xof);
872 sc->yof = int(sc->yof);
873
875
876 return OPERATOR_FINISHED;
877}
878
880{
881 /* identifiers */
882 ot->name = "View Zoom Ratio";
883 ot->idname = "CLIP_OT_view_zoom_ratio";
884 ot->description = "Set the zoom ratio (based on clip size)";
885
886 /* api callbacks */
889
890 /* flags */
892
893 /* properties */
895 "ratio",
896 0.0f,
897 -FLT_MAX,
898 FLT_MAX,
899 "Ratio",
900 "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out",
901 -FLT_MAX,
902 FLT_MAX);
903}
904
907/* -------------------------------------------------------------------- */
912{
913 SpaceClip *sc;
914 ARegion *region;
915 int w, h, width, height;
916 float aspx, aspy;
917 bool fit_view = RNA_boolean_get(op->ptr, "fit_view");
918 float zoomx, zoomy;
919
920 /* retrieve state */
921 sc = CTX_wm_space_clip(C);
922 region = CTX_wm_region(C);
923
924 ED_space_clip_get_size(sc, &w, &h);
925 ED_space_clip_get_aspect(sc, &aspx, &aspy);
926
927 w = w * aspx;
928 h = h * aspy;
929
930 /* check if the image will fit in the image with zoom == 1 */
931 width = BLI_rcti_size_x(&region->winrct) + 1;
932 height = BLI_rcti_size_y(&region->winrct) + 1;
933
934 if (fit_view) {
935 const int margin = 5; /* margin from border */
936
937 zoomx = float(width) / (w + 2 * margin);
938 zoomy = float(height) / (h + 2 * margin);
939
940 sclip_zoom_set(C, min_ff(zoomx, zoomy), nullptr, false);
941 }
942 else {
943 if ((w >= width || h >= height) && (width > 0 && height > 0)) {
944 zoomx = float(width) / w;
945 zoomy = float(height) / h;
946
947 /* find the zoom value that will fit the image in the image space */
948 sclip_zoom_set(C, 1.0f / power_of_2(1.0f / min_ff(zoomx, zoomy)), nullptr, false);
949 }
950 else {
951 sclip_zoom_set(C, 1.0f, nullptr, false);
952 }
953 }
954
955 sc->xof = sc->yof = 0.0f;
956
957 ED_region_tag_redraw(region);
958
959 return OPERATOR_FINISHED;
960}
961
963{
964 PropertyRNA *prop;
965
966 /* identifiers */
967 ot->name = "Frame All";
968 ot->idname = "CLIP_OT_view_all";
969 ot->description = "View whole image with markers";
970
971 /* api callbacks */
974
975 /* flags */
977
978 /* properties */
979 prop = RNA_def_boolean(ot->srna, "fit_view", false, "Fit View", "Fit frame to the viewport");
981}
982
985/* -------------------------------------------------------------------- */
990{
992 ARegion *region = CTX_wm_region(C);
993
994 clip_view_center_to_point(sc, sc->cursor[0], sc->cursor[1]);
995
996 ED_region_tag_redraw(region);
997
998 return OPERATOR_FINISHED;
999}
1000
1002{
1003 /* identifiers */
1004 ot->name = "Center View to Cursor";
1005 ot->description = "Center the view so that the cursor is in the middle of the view";
1006 ot->idname = "CLIP_OT_view_center_cursor";
1007
1008 /* api callbacks */
1011}
1012
1015/* -------------------------------------------------------------------- */
1020{
1022 ARegion *region = CTX_wm_region(C);
1023
1024 sc->xlockof = 0.0f;
1025 sc->ylockof = 0.0f;
1026
1027 ED_clip_view_selection(C, region, true);
1028 ED_region_tag_redraw(region);
1029
1030 return OPERATOR_FINISHED;
1031}
1032
1034{
1035 /* identifiers */
1036 ot->name = "Frame Selected";
1037 ot->idname = "CLIP_OT_view_selected";
1038 ot->description = "View all selected elements";
1039
1040 /* api callbacks */
1043
1044 /* flags */
1046}
1047
1050/* -------------------------------------------------------------------- */
1055{
1056 /* prevent changes during render */
1057 if (G.is_rendering) {
1058 return false;
1059 }
1060 SpaceClip *space_clip = CTX_wm_space_clip(C);
1061 return space_clip != nullptr;
1062}
1063
1065{
1066 Scene *scene = CTX_data_scene(C);
1067
1068 /* set the new frame number */
1069 scene->r.cfra = RNA_int_get(op->ptr, "frame");
1070 FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
1071 scene->r.subframe = 0.0f;
1072
1073 /* do updates */
1076}
1077
1079{
1080 change_frame_apply(C, op);
1081
1082 return OPERATOR_FINISHED;
1083}
1084
1085static int frame_from_event(bContext *C, const wmEvent *event)
1086{
1087 ARegion *region = CTX_wm_region(C);
1088 Scene *scene = CTX_data_scene(C);
1089 int framenr = 0;
1090
1091 if (region->regiontype == RGN_TYPE_WINDOW) {
1092 float sfra = scene->r.sfra, efra = scene->r.efra, framelen = region->winx / (efra - sfra + 1);
1093
1094 framenr = sfra + event->mval[0] / framelen;
1095 }
1096 else {
1097 float viewx, viewy;
1098
1099 UI_view2d_region_to_view(&region->v2d, event->mval[0], event->mval[1], &viewx, &viewy);
1100
1101 framenr = round_fl_to_int(viewx);
1102 }
1103
1104 return framenr;
1105}
1106
1107static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event)
1108{
1109 ARegion *region = CTX_wm_region(C);
1110
1111 if (region->regiontype == RGN_TYPE_WINDOW) {
1112 if (event->mval[1] > 16 * UI_SCALE_FAC) {
1113 return OPERATOR_PASS_THROUGH;
1114 }
1115 }
1116
1117 RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
1118
1119 change_frame_apply(C, op);
1120
1121 /* add temp handler */
1123
1125}
1126
1127static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
1128{
1129 switch (event->type) {
1130 case EVT_ESCKEY:
1131 return OPERATOR_FINISHED;
1132
1133 case MOUSEMOVE:
1134 RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
1135 change_frame_apply(C, op);
1136 break;
1137
1138 case LEFTMOUSE:
1139 case RIGHTMOUSE:
1140 if (event->val == KM_RELEASE) {
1141 return OPERATOR_FINISHED;
1142 }
1143 break;
1144 }
1145
1147}
1148
1150{
1151 /* identifiers */
1152 ot->name = "Change Frame";
1153 ot->idname = "CLIP_OT_change_frame";
1154 ot->description = "Interactively change the current frame number";
1155
1156 /* api callbacks */
1161
1162 /* flags */
1164
1165 /* rna */
1166 RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME);
1167}
1168
1171/* -------------------------------------------------------------------- */
1183
1184static void proxy_freejob(void *pjv)
1185{
1186 ProxyJob *pj = static_cast<ProxyJob *>(pjv);
1187
1188 MEM_freeN(pj);
1189}
1190
1191static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undistort)
1192{
1193 int build_count = 0;
1194 const int size_flags[2][4] = {
1200 int size_nr = undistort ? 1 : 0;
1201
1202 if (size_flag & size_flags[size_nr][0]) {
1203 build_sizes[build_count++] = MCLIP_PROXY_RENDER_SIZE_25;
1204 }
1205
1206 if (size_flag & size_flags[size_nr][1]) {
1207 build_sizes[build_count++] = MCLIP_PROXY_RENDER_SIZE_50;
1208 }
1209
1210 if (size_flag & size_flags[size_nr][2]) {
1211 build_sizes[build_count++] = MCLIP_PROXY_RENDER_SIZE_75;
1212 }
1213
1214 if (size_flag & size_flags[size_nr][3]) {
1215 build_sizes[build_count++] = MCLIP_PROXY_RENDER_SIZE_100;
1216 }
1217
1218 return build_count;
1219}
1220
1221/* simple case for movies -- handle frame-by-frame, do threading within single frame */
1222static void do_movie_proxy(void *pjv,
1223 int * /*build_sizes*/,
1224 int /*build_count*/,
1225 const int *build_undistort_sizes,
1226 int build_undistort_count,
1227 bool *stop,
1228 bool *do_update,
1229 float *progress)
1230{
1231 ProxyJob *pj = static_cast<ProxyJob *>(pjv);
1232 MovieClip *clip = pj->clip;
1233 MovieDistortion *distortion = nullptr;
1234
1235 if (pj->index_context) {
1236 IMB_anim_index_rebuild(pj->index_context, stop, do_update, progress);
1237 }
1238
1239 if (!build_undistort_count) {
1240 if (*stop) {
1241 pj->stop = true;
1242 }
1243
1244 return;
1245 }
1246
1247 const int sfra = 1;
1248 const int efra = clip->len;
1249
1250 if (build_undistort_count) {
1251 int threads = BLI_system_thread_count();
1252 int width, height;
1253
1254 BKE_movieclip_get_size(clip, nullptr, &width, &height);
1255
1256 distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
1257 BKE_tracking_distortion_set_threads(distortion, threads);
1258 }
1259
1260 for (int cfra = sfra; cfra <= efra; cfra++) {
1262 clip, pj->clip_flag, distortion, cfra, build_undistort_sizes, build_undistort_count, true);
1263
1264 if (*stop || G.is_break) {
1265 break;
1266 }
1267
1268 *do_update = true;
1269 *progress = (float(cfra) - sfra) / (efra - sfra);
1270 }
1271
1272 if (distortion) {
1273 BKE_tracking_distortion_free(distortion);
1274 }
1275
1276 if (*stop) {
1277 pj->stop = true;
1278 }
1279}
1280
1281/* *****
1282 * special case for sequences -- handle different frames in different threads,
1283 * loading from disk happens in critical section, decoding frame happens from
1284 * thread for maximal speed
1285 */
1286
1288 int cfra;
1289 int sfra;
1290 int efra;
1292
1293 const bool *stop;
1295 float *progress;
1296};
1297
1304
1306 MovieClip *clip,
1307 size_t *r_size,
1308 int *r_cfra)
1309{
1310 uchar *mem = nullptr;
1311
1312 BLI_spin_lock(&queue->spin);
1313 if (!*queue->stop && queue->cfra <= queue->efra) {
1315 char filepath[FILE_MAX];
1316 int file;
1317
1318 user.framenr = queue->cfra;
1319
1320 BKE_movieclip_filepath_for_frame(clip, &user, filepath);
1321
1322 file = BLI_open(filepath, O_BINARY | O_RDONLY, 0);
1323 if (file < 0) {
1324 BLI_spin_unlock(&queue->spin);
1325 return nullptr;
1326 }
1327
1328 const size_t size = BLI_file_descriptor_size(file);
1329 if (UNLIKELY(ELEM(size, 0, size_t(-1)))) {
1330 close(file);
1331 BLI_spin_unlock(&queue->spin);
1332 return nullptr;
1333 }
1334
1335 mem = MEM_cnew_array<uchar>(size, "movieclip proxy memory file");
1336
1337 if (BLI_read(file, mem, size) != size) {
1338 close(file);
1339 BLI_spin_unlock(&queue->spin);
1340 MEM_freeN(mem);
1341 return nullptr;
1342 }
1343
1344 *r_size = size;
1345 *r_cfra = queue->cfra;
1346
1347 queue->cfra++;
1348 close(file);
1349
1350 *queue->do_update = true;
1351 *queue->progress = float(queue->cfra - queue->sfra) / (queue->efra - queue->sfra);
1352 }
1353 BLI_spin_unlock(&queue->spin);
1354
1355 return mem;
1356}
1357
1358static void proxy_task_func(TaskPool *__restrict pool, void *task_data)
1359{
1360 ProxyThread *data = (ProxyThread *)task_data;
1362 uchar *mem;
1363 size_t size;
1364 int cfra;
1365
1366 while ((mem = proxy_thread_next_frame(queue, data->clip, &size, &cfra))) {
1367 ImBuf *ibuf;
1368
1369 ibuf = IMB_ibImageFromMemory(mem,
1370 size,
1372 data->clip->colorspace_settings.name,
1373 "proxy frame");
1374
1376 data->clip, ibuf, nullptr, cfra, data->build_sizes, data->build_count, false);
1377
1379 ibuf,
1380 data->distortion,
1381 cfra,
1382 data->build_undistort_sizes,
1383 data->build_undistort_count,
1384 true);
1385
1386 IMB_freeImBuf(ibuf);
1387
1388 MEM_freeN(mem);
1389 }
1390}
1391
1392static void do_sequence_proxy(void *pjv,
1393 int *build_sizes,
1394 int build_count,
1395 int *build_undistort_sizes,
1396 int build_undistort_count,
1397 /* Cannot be const, because it is assigned to a non-const variable.
1398 * NOLINTNEXTLINE: readability-non-const-parameter. */
1399 bool *stop,
1400 bool *do_update,
1401 float *progress)
1402{
1403 ProxyJob *pj = static_cast<ProxyJob *>(pjv);
1404 MovieClip *clip = pj->clip;
1405 Scene *scene = pj->scene;
1406 int sfra = scene->r.sfra, efra = scene->r.efra;
1408 int tot_thread = BLI_task_scheduler_num_threads();
1409 int width, height;
1410
1411 if (build_undistort_count) {
1412 BKE_movieclip_get_size(clip, nullptr, &width, &height);
1413 }
1414
1415 ProxyQueue queue;
1416 BLI_spin_init(&queue.spin);
1417
1418 queue.cfra = sfra;
1419 queue.sfra = sfra;
1420 queue.efra = efra;
1421 queue.stop = stop;
1422 queue.do_update = do_update;
1423 queue.progress = progress;
1424
1426 handles = MEM_cnew_array<ProxyThread>(tot_thread, "proxy threaded handles");
1427 for (int i = 0; i < tot_thread; i++) {
1428 ProxyThread *handle = &handles[i];
1429
1430 handle->clip = clip;
1431
1432 handle->build_count = build_count;
1433 handle->build_sizes = build_sizes;
1434
1435 handle->build_undistort_count = build_undistort_count;
1436 handle->build_undistort_sizes = build_undistort_sizes;
1437
1438 if (build_undistort_count) {
1439 handle->distortion = BKE_tracking_distortion_new(&clip->tracking, width, height);
1440 }
1441
1442 BLI_task_pool_push(task_pool, proxy_task_func, handle, false, nullptr);
1443 }
1444
1447
1448 if (build_undistort_count) {
1449 for (int i = 0; i < tot_thread; i++) {
1450 ProxyThread *handle = &handles[i];
1451 BKE_tracking_distortion_free(handle->distortion);
1452 }
1453 }
1454
1455 BLI_spin_end(&queue.spin);
1456 MEM_freeN(handles);
1457}
1458
1459static void proxy_startjob(void *pjv, wmJobWorkerStatus *worker_status)
1460{
1461 ProxyJob *pj = static_cast<ProxyJob *>(pjv);
1462 MovieClip *clip = pj->clip;
1463
1464 short size_flag;
1465 int build_sizes[4], build_count = 0;
1466 int build_undistort_sizes[4], build_undistort_count = 0;
1467
1468 size_flag = clip->proxy.build_size_flag;
1469
1470 build_count = proxy_bitflag_to_array(size_flag, build_sizes, 0);
1471 build_undistort_count = proxy_bitflag_to_array(size_flag, build_undistort_sizes, 1);
1472
1473 if (clip->source == MCLIP_SRC_MOVIE) {
1474 do_movie_proxy(pjv,
1475 build_sizes,
1476 build_count,
1477 build_undistort_sizes,
1478 build_undistort_count,
1479 &worker_status->stop,
1480 &worker_status->do_update,
1481 &worker_status->progress);
1482 }
1483 else {
1485 build_sizes,
1486 build_count,
1487 build_undistort_sizes,
1488 build_undistort_count,
1489 &worker_status->stop,
1490 &worker_status->do_update,
1491 &worker_status->progress);
1492 }
1493}
1494
1495static void proxy_endjob(void *pjv)
1496{
1497 ProxyJob *pj = static_cast<ProxyJob *>(pjv);
1498
1499 if (pj->clip->anim) {
1501 }
1502
1503 if (pj->index_context) {
1505 }
1506
1507 if (pj->clip->source == MCLIP_SRC_MOVIE) {
1508 /* Time-code might have changed, so do a full reload to deal with this. */
1510 }
1511 else {
1512 /* For image sequences we'll preserve original cache. */
1514 }
1515
1517}
1518
1520{
1521 wmJob *wm_job;
1522 ProxyJob *pj;
1523 Scene *scene = CTX_data_scene(C);
1524 ScrArea *area = CTX_wm_area(C);
1527
1528 if ((clip->flag & MCLIP_USE_PROXY) == 0) {
1529 return OPERATOR_CANCELLED;
1530 }
1531
1532 wm_job = WM_jobs_get(CTX_wm_manager(C),
1533 CTX_wm_window(C),
1534 scene,
1535 "Building Proxies",
1538
1539 pj = MEM_cnew<ProxyJob>("proxy rebuild job");
1540 pj->scene = scene;
1541 pj->main = CTX_data_main(C);
1542 pj->clip = clip;
1543 pj->clip_flag = clip->flag & MCLIP_TIMECODE_FLAGS;
1544
1545 if (clip->anim) {
1547 clip->anim,
1548 IMB_Timecode_Type(clip->proxy.build_tc_flag),
1549 IMB_Proxy_Size(clip->proxy.build_size_flag),
1550 clip->proxy.quality,
1551 true,
1552 nullptr,
1553 false);
1554 }
1555
1557 WM_jobs_timer(wm_job, 0.2, NC_MOVIECLIP | ND_DISPLAY, 0);
1558 WM_jobs_callbacks(wm_job, proxy_startjob, nullptr, nullptr, proxy_endjob);
1559
1560 G.is_break = false;
1561 WM_jobs_start(CTX_wm_manager(C), wm_job);
1562
1563 ED_area_tag_redraw(area);
1564
1565 return OPERATOR_FINISHED;
1566}
1567
1569{
1570 /* identifiers */
1571 ot->name = "Rebuild Proxy and Timecode Indices";
1572 ot->idname = "CLIP_OT_rebuild_proxy";
1573 ot->description = "Rebuild all selected proxies and timecode indices in the background";
1574
1575 /* api callbacks */
1578
1579 /* flags */
1581}
1582
1585/* -------------------------------------------------------------------- */
1590{
1592 int mode = RNA_enum_get(op->ptr, "mode");
1593
1594 sc->mode = mode;
1595
1596 if (sc->mode == SC_MODE_MASKEDIT && sc->view != SC_VIEW_CLIP) {
1597 /* Make sure we are in the right view for mask editing */
1598 sc->view = SC_VIEW_CLIP;
1599 }
1600
1602
1603 return OPERATOR_FINISHED;
1604}
1605
1607{
1608 /* identifiers */
1609 ot->name = "Set Clip Mode";
1610 ot->description = "Set the clip interaction mode";
1611 ot->idname = "CLIP_OT_mode_set";
1612
1613 /* api callbacks */
1615
1617
1618 /* properties */
1619 ot->prop = RNA_def_enum(
1622}
1623
1626#ifdef WITH_INPUT_NDOF
1627
1628/* -------------------------------------------------------------------- */
1632/* Combined pan/zoom from a 3D mouse device.
1633 * Z zooms, XY pans
1634 * "view" (not "paper") control -- user moves the viewpoint, not the image being viewed
1635 * that explains the negative signs in the code below
1636 */
1637
1638static int clip_view_ndof_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event)
1639{
1640 if (event->type != NDOF_MOTION) {
1641 return OPERATOR_CANCELLED;
1642 }
1643
1645 ARegion *region = CTX_wm_region(C);
1646 float pan_vec[3];
1647
1648 const wmNDOFMotionData *ndof = static_cast<wmNDOFMotionData *>(event->customdata);
1649 const float pan_speed = NDOF_PIXELS_PER_SECOND;
1650
1651 WM_event_ndof_pan_get(ndof, pan_vec, true);
1652
1653 mul_v3_fl(pan_vec, ndof->dt);
1654 mul_v2_fl(pan_vec, pan_speed / sc->zoom);
1655
1656 sclip_zoom_set_factor(C, max_ff(0.0f, 1.0f - pan_vec[2]), nullptr, false);
1657 sc->xof += pan_vec[0];
1658 sc->yof += pan_vec[1];
1659
1660 ED_region_tag_redraw(region);
1661
1662 return OPERATOR_FINISHED;
1663}
1664
1665void CLIP_OT_view_ndof(wmOperatorType *ot)
1666{
1667 /* identifiers */
1668 ot->name = "NDOF Pan/Zoom";
1669 ot->idname = "CLIP_OT_view_ndof";
1670 ot->description = "Use a 3D mouse device to pan/zoom the view";
1671
1672 /* api callbacks */
1673 ot->invoke = clip_view_ndof_invoke;
1675
1676 /* flags */
1678}
1679
1682#endif /* WITH_INPUT_NDOF */
1683
1684/* -------------------------------------------------------------------- */
1688static int clip_prefetch_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event)
1689{
1690 /* no running blender, remove handler and pass through */
1693 }
1694
1695 /* running render */
1696 switch (event->type) {
1697 case EVT_ESCKEY:
1699 }
1700
1701 return OPERATOR_PASS_THROUGH;
1702}
1703
1704static int clip_prefetch_invoke(bContext *C, wmOperator *op, const wmEvent * /*_event*/)
1705{
1707
1708 /* add modal handler for ESC */
1710
1712}
1713
1715{
1716 /* identifiers */
1717 ot->name = "Prefetch Frames";
1718 ot->idname = "CLIP_OT_prefetch";
1719 ot->description = "Prefetch frames from disk for faster playback/tracking";
1720
1721 /* api callbacks */
1725}
1726
1729/* -------------------------------------------------------------------- */
1734{
1736 Scene *scene = CTX_data_scene(C);
1737 int clip_length;
1738
1739 if (ELEM(nullptr, scene, clip)) {
1740 return OPERATOR_CANCELLED;
1741 }
1742
1743 clip_length = BKE_movieclip_get_duration(clip);
1744
1745 scene->r.sfra = clip->start_frame;
1746 scene->r.efra = scene->r.sfra + clip_length - 1;
1747
1748 scene->r.efra = max_ii(scene->r.sfra, scene->r.efra);
1749
1751
1752 return OPERATOR_FINISHED;
1753}
1754
1756{
1757 /* identifiers */
1758 ot->name = "Set Scene Frames";
1759 ot->idname = "CLIP_OT_set_scene_frames";
1760 ot->description = "Set scene's start and end frame to match clip's start frame and length";
1761
1762 /* api callbacks */
1765}
1766
1769/* -------------------------------------------------------------------- */
1774{
1775 SpaceClip *sclip = CTX_wm_space_clip(C);
1776 bool show_cursor = false;
1777
1778 show_cursor |= sclip->mode == SC_MODE_MASKEDIT;
1779 show_cursor |= sclip->around == V3D_AROUND_CURSOR;
1780
1781 if (!show_cursor) {
1782 return OPERATOR_CANCELLED;
1783 }
1784
1785 RNA_float_get_array(op->ptr, "location", sclip->cursor);
1786
1788
1789 /* Use pass-through to allow click-drag to transform the cursor. */
1791}
1792
1793static int clip_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
1794{
1795 ARegion *region = CTX_wm_region(C);
1796 SpaceClip *sclip = CTX_wm_space_clip(C);
1797 float location[2];
1798
1799 ED_clip_mouse_pos(sclip, region, event->mval, location);
1800 RNA_float_set_array(op->ptr, "location", location);
1801
1802 return clip_set_2d_cursor_exec(C, op);
1803}
1804
1806{
1807 /* identifiers */
1808 ot->name = "Set 2D Cursor";
1809 ot->description = "Set 2D cursor location";
1810 ot->idname = "CLIP_OT_cursor_set";
1811
1812 /* api callbacks */
1816
1817 /* flags */
1819
1820 /* properties */
1822 "location",
1823 2,
1824 nullptr,
1825 -FLT_MAX,
1826 FLT_MAX,
1827 "Location",
1828 "Cursor location in normalized clip coordinates",
1829 -10.0f,
1830 10.0f);
1831}
1832
1835/* -------------------------------------------------------------------- */
1840{
1841 SpaceClip *space_clip = CTX_wm_space_clip(C);
1842
1843 ClipViewLockState lock_state;
1844 ED_clip_view_lock_state_store(C, &lock_state);
1845
1846 space_clip->flag ^= SC_LOCK_SELECTION;
1847
1849
1851
1852 return OPERATOR_FINISHED;
1853}
1854
1856{
1857 /* identifiers */
1858 ot->name = "Toggle Lock Selection";
1859 ot->description = "Toggle Lock Selection option of the current clip editor";
1860 ot->idname = "CLIP_OT_lock_selection_toggle";
1861
1862 /* api callbacks */
1865
1866 /* flags */
1868}
1869
1872/* -------------------------------------------------------------------- */
1877{
1879 wmOperatorTypeMacro *otmacro;
1880
1881 ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move",
1882 "Add Marker and Move",
1883 "Add new marker and move it on movie",
1885 WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
1886 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
1887 RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
1888
1890 "CLIP_OT_add_marker_slide",
1891 "Add Marker and Slide",
1892 "Add new marker and slide it with mouse until mouse button release",
1894 WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
1895 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
1896 RNA_boolean_set(otmacro->ptr, "release_confirm", true);
1897}
1898
bScreen * CTX_wm_screen(const bContext *C)
MovieClip * CTX_data_edit_movieclip(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
SpaceClip * CTX_wm_space_clip(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void id_us_min(ID *id)
Definition lib_id.cc:359
void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion, int cfra, const int *build_sizes, int build_count, bool undistorted)
void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip)
void BKE_movieclip_build_proxy_frame_for_ibuf(struct MovieClip *clip, struct ImBuf *ibuf, struct MovieDistortion *distortion, int cfra, const int *build_sizes, int build_count, bool undistorted)
struct MovieClip * BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath)
int BKE_movieclip_get_duration(struct MovieClip *clip)
void BKE_movieclip_get_size(struct MovieClip *clip, const struct MovieClipUser *user, int *r_width, int *r_height)
void BKE_movieclip_filepath_for_frame(struct MovieClip *clip, const struct MovieClipUser *user, char *filepath)
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
void BKE_tracking_distortion_set_threads(struct MovieDistortion *distortion, int threads)
Definition tracking.cc:2308
void BKE_tracking_distortion_free(struct MovieDistortion *distortion)
Definition tracking.cc:2414
struct MovieDistortion * BKE_tracking_distortion_new(struct MovieTracking *tracking, int calibration_width, int calibration_height)
Definition tracking.cc:2263
File and directory operations.
#define O_BINARY
size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT
Definition storage.cc:206
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int64_t BLI_read(int fd, void *buf, size_t nbytes)
Definition fileops_c.cc:96
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float power_of_2(float f)
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
bool BLI_path_parent_dir(char *path) ATTR_NONNULL(1)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define FILE_MAX
#define BLI_path_join(...)
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:193
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
#define STRNCPY(dst, src)
Definition BLI_string.h:593
unsigned char uchar
int BLI_task_scheduler_num_threads(void)
@ TASK_PRIORITY_LOW
Definition BLI_task.h:56
void * BLI_task_pool_user_data(TaskPool *pool)
Definition task_pool.cc:516
void BLI_task_pool_work_and_wait(TaskPool *pool)
Definition task_pool.cc:471
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
Definition task_pool.cc:394
void BLI_task_pool_free(TaskPool *pool)
Definition task_pool.cc:431
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
Definition task_pool.cc:450
pthread_spinlock_t SpinLock
int BLI_system_thread_count(void)
Definition threads.cc:253
void BLI_spin_init(SpinLock *spin)
Definition threads.cc:391
void BLI_spin_unlock(SpinLock *spin)
Definition threads.cc:430
void BLI_spin_lock(SpinLock *spin)
Definition threads.cc:405
void BLI_spin_end(SpinLock *spin)
Definition threads.cc:445
Platform independent time functions.
double BLI_time_now_seconds(void)
Definition time.c:65
#define UNLIKELY(x)
#define ELEM(...)
#define RPT_(msgid)
#define BLT_I18NCONTEXT_ID_MOVIECLIP
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_FRAME_CHANGE
Definition DNA_ID.h:1092
@ ID_RECALC_SOURCE
Definition DNA_ID.h:1110
#define DNA_struct_default_get(struct_name)
@ MCLIP_PROXY_RENDER_SIZE_75
@ MCLIP_PROXY_RENDER_SIZE_100
@ MCLIP_PROXY_RENDER_SIZE_50
@ MCLIP_PROXY_RENDER_SIZE_25
@ MCLIP_SRC_MOVIE
@ MCLIP_PROXY_SIZE_75
@ MCLIP_PROXY_UNDISTORTED_SIZE_100
@ MCLIP_PROXY_UNDISTORTED_SIZE_75
@ MCLIP_PROXY_SIZE_25
@ MCLIP_PROXY_SIZE_100
@ MCLIP_PROXY_UNDISTORTED_SIZE_50
@ MCLIP_PROXY_SIZE_50
@ MCLIP_PROXY_UNDISTORTED_SIZE_25
@ MCLIP_TIMECODE_FLAGS
@ MCLIP_USE_PROXY
#define MINAFRAME
#define MAXFRAME
@ RGN_TYPE_WINDOW
@ FILE_SORT_DEFAULT
@ FILE_SPECIAL
@ FILE_TYPE_MOVIE
@ FILE_TYPE_FOLDER
@ FILE_TYPE_IMAGE
@ SC_VIEW_CLIP
@ SC_MODE_TRACKING
@ SC_MODE_MASKEDIT
@ SC_LOCK_SELECTION
@ FILE_DEFAULTDISPLAY
#define FRAMENUMBER_MIN_CLAMP(cfra)
@ USER_ZOOM_INVERT
@ USER_ZOOM_TO_MOUSEPOS
@ USER_ZOOM_HORIZ
#define NDOF_PIXELS_PER_SECOND
@ USER_RELPATHS
@ USER_ZOOM_SCALE
@ USER_ZOOM_CONTINUE
#define UI_SCALE_FAC
@ V3D_AROUND_CURSOR
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip)
void ED_clip_view_lock_state_restore_no_jump(const bContext *C, const ClipViewLockState *state)
MovieClip * ED_space_clip_get_clip(const SpaceClip *sc)
void ED_clip_mouse_pos(const SpaceClip *sc, const ARegion *region, const int mval[2], float r_co[2])
void ED_space_clip_get_size(const SpaceClip *sc, int *r_width, int *r_height)
bool ED_space_clip_maskedit_poll(bContext *C)
bool ED_space_clip_view_clip_poll(bContext *C)
void ED_space_clip_get_aspect(const SpaceClip *sc, float *r_aspx, float *r_aspy)
bool ED_space_clip_poll(bContext *C)
void ED_clip_view_lock_state_store(const bContext *C, ClipViewLockState *state)
bool ED_clip_view_selection(const bContext *C, const ARegion *region, bool fit)
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:708
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:634
void IMB_anim_index_rebuild(IndexBuildContext *context, bool *stop, bool *do_update, float *progress)
Definition indexer.cc:1283
void IMB_anim_index_rebuild_finish(IndexBuildContext *context, bool stop)
Definition indexer.cc:1301
IndexBuildContext * IMB_anim_index_rebuild_context(ImBufAnim *anim, IMB_Timecode_Type tcs_in_use, int proxy_sizes_in_use, int quality, const bool overwrite, GSet *file_list, bool build_only_on_bad_performance)
Definition indexer.cc:1212
void IMB_close_anim_proxies(ImBufAnim *anim)
Definition anim_movie.cc:85
IMB_Proxy_Size
IMB_Timecode_Type
Contains defines and structs used throughout the imbuf module.
@ IB_multilayer
@ IB_alphamode_detect
@ IB_rect
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ PROP_HIDDEN
Definition RNA_types.hh:239
void UI_context_active_but_prop_get_templateID(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1663
@ WM_FILESEL_FILES
Definition WM_api.hh:937
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:934
@ WM_FILESEL_RELPATH
Definition WM_api.hh:933
@ WM_JOB_TYPE_CLIP_BUILD_PROXY
Definition WM_api.hh:1588
@ WM_JOB_TYPE_CLIP_PREFETCH
Definition WM_api.hh:1591
@ WM_JOB_PROGRESS
Definition WM_api.hh:1566
@ FILE_OPENFILE
Definition WM_api.hh:945
@ OPTYPE_BLOCKING
Definition WM_types.hh:164
@ OPTYPE_LOCK_BYPASS
Definition WM_types.hh:185
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_GRAB_CURSOR_XY
Definition WM_types.hh:168
@ OPTYPE_REGISTER
Definition WM_types.hh:160
@ KM_RELEASE
Definition WM_types.hh:285
#define ND_DISPLAY
Definition WM_types.hh:458
#define NC_MOVIECLIP
Definition WM_types.hh:364
#define NC_SCENE
Definition WM_types.hh:345
#define NA_ADDED
Definition WM_types.hh:552
#define NA_EDITED
Definition WM_types.hh:550
#define ND_SPACE_CLIP
Definition WM_types.hh:505
#define ND_FRAME
Definition WM_types.hh:401
#define NC_SPACE
Definition WM_types.hh:359
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
unsigned int U
Definition btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
void clip_start_prefetch_job(const bContext *C)
void clip_view_center_to_point(SpaceClip *sc, float x, float y)
bool clip_view_has_locked_selection(const bContext *C)
static int view_zoom_ratio_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:864
void CLIP_OT_view_zoom_in(wmOperatorType *ot)
Definition clip_ops.cc:770
static void proxy_freejob(void *pjv)
Definition clip_ops.cc:1184
static int open_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:182
void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
Definition clip_ops.cc:879
static int clip_prefetch_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition clip_ops.cc:1704
static void sclip_zoom_set_factor_exec(bContext *C, const wmEvent *event, float factor)
Definition clip_ops.cc:134
void CLIP_OT_cursor_set(wmOperatorType *ot)
Definition clip_ops.cc:1805
static void sclip_zoom_set_factor(const bContext *C, float zoomfac, const float location[2], const bool zoom_to_pos)
Definition clip_ops.cc:124
static void view_pan_exit(bContext *C, wmOperator *op, bool cancel)
Definition clip_ops.cc:404
static void open_cancel(bContext *, wmOperator *op)
Definition clip_ops.cc:173
static void view_zoom_cancel(bContext *C, wmOperator *op)
Definition clip_ops.cc:699
static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:1107
static void view_pan_cancel(bContext *C, wmOperator *op)
Definition clip_ops.cc:496
static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
Definition clip_ops.cc:578
static int view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:607
static void proxy_startjob(void *pjv, wmJobWorkerStatus *worker_status)
Definition clip_ops.cc:1459
void CLIP_OT_mode_set(wmOperatorType *ot)
Definition clip_ops.cc:1606
static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:372
static int view_zoom_in_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:744
static int view_zoom_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:598
void CLIP_OT_view_zoom(wmOperatorType *ot)
Definition clip_ops.cc:704
void CLIP_OT_view_zoom_out(wmOperatorType *ot)
Definition clip_ops.cc:827
void CLIP_OT_open(wmOperatorType *ot)
Definition clip_ops.cc:300
void CLIP_OT_set_scene_frames(wmOperatorType *ot)
Definition clip_ops.cc:1755
void CLIP_OT_change_frame(wmOperatorType *ot)
Definition clip_ops.cc:1149
static void proxy_endjob(void *pjv)
Definition clip_ops.cc:1495
void CLIP_OT_view_selected(wmOperatorType *ot)
Definition clip_ops.cc:1033
static void sclip_zoom_set(const bContext *C, float zoom, const float location[2], const bool zoom_to_pos)
Definition clip_ops.cc:70
static void open_init(bContext *C, wmOperator *op)
Definition clip_ops.cc:165
static int view_pan_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:420
static void clip_filesel(bContext *C, wmOperator *op, const char *dirpath)
Definition clip_ops.cc:158
static int view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:757
static int frame_from_event(bContext *C, const wmEvent *event)
Definition clip_ops.cc:1085
static int clip_rebuild_proxy_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:1519
static int lock_selection_toggle_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:1839
void ED_operatormacros_clip()
Definition clip_ops.cc:1876
static void proxy_task_func(TaskPool *__restrict pool, void *task_data)
Definition clip_ops.cc:1358
static int change_frame_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:1078
void CLIP_OT_prefetch(wmOperatorType *ot)
Definition clip_ops.cc:1714
static int view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:814
static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:1773
static uchar * proxy_thread_next_frame(ProxyQueue *queue, MovieClip *clip, size_t *r_size, int *r_cfra)
Definition clip_ops.cc:1305
void CLIP_OT_view_center_cursor(wmOperatorType *ot)
Definition clip_ops.cc:1001
static int view_zoom_out_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:801
static int mode_set_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:1589
void CLIP_OT_rebuild_proxy(wmOperatorType *ot)
Definition clip_ops.cc:1568
void CLIP_OT_lock_selection_toggle(wmOperatorType *ot)
Definition clip_ops.cc:1855
static int view_selected_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:1019
static int clip_prefetch_modal(bContext *C, wmOperator *, const wmEvent *event)
Definition clip_ops.cc:1688
static int clip_set_scene_frames_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:1733
static int clip_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:1793
static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:1127
static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:674
static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:441
static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:462
static int view_center_cursor_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:989
static int view_all_exec(bContext *C, wmOperator *op)
Definition clip_ops.cc:911
static bool change_frame_poll(bContext *C)
Definition clip_ops.cc:1054
void CLIP_OT_view_pan(wmOperatorType *ot)
Definition clip_ops.cc:501
void CLIP_OT_view_all(wmOperatorType *ot)
Definition clip_ops.cc:962
static void do_movie_proxy(void *pjv, int *, int, const int *build_undistort_sizes, int build_undistort_count, bool *stop, bool *do_update, float *progress)
Definition clip_ops.cc:1222
static int reload_exec(bContext *C, wmOperator *)
Definition clip_ops.cc:331
static int open_invoke(bContext *C, wmOperator *op, const wmEvent *)
Definition clip_ops.cc:265
static void do_sequence_proxy(void *pjv, int *build_sizes, int build_count, int *build_undistort_sizes, int build_undistort_count, bool *stop, bool *do_update, float *progress)
Definition clip_ops.cc:1392
static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
Definition clip_ops.cc:547
static void change_frame_apply(bContext *C, wmOperator *op)
Definition clip_ops.cc:1064
void CLIP_OT_reload(wmOperatorType *ot)
Definition clip_ops.cc:347
static void view_zoom_apply(bContext *C, ViewZoomData *vpd, wmOperator *op, const wmEvent *event, const bool zoom_to_pos)
Definition clip_ops.cc:631
static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undistort)
Definition clip_ops.cc:1191
FILE * file
double time
#define powf(x, y)
TaskPool * task_pool
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
struct ImBuf * IMB_ibImageFromMemory(const unsigned char *, size_t, int, char[IM_MAX_SPACE], const char *)
void IMB_freeImBuf(ImBuf *)
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
#define G(x, y, z)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_collection_is_empty(PointerRNA *ptr, const char *name)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_id_pointer_create(ID *id)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
const EnumPropertyItem rna_enum_clip_editor_mode_items[]
Definition rna_space.cc:480
#define FLT_MAX
Definition stdcycles.h:14
char filepath[1024]
Definition BKE_main.hh:136
struct ImBufAnim * anim
struct MovieClipProxy proxy
PropertyRNA * prop
Definition RNA_types.hh:49
Main * main
Definition clip_ops.cc:1177
MovieClip * clip
Definition clip_ops.cc:1178
Scene * scene
Definition clip_ops.cc:1176
int clip_flag
Definition clip_ops.cc:1179
IndexBuildContext * index_context
Definition clip_ops.cc:1181
bool stop
Definition clip_ops.cc:1180
float * progress
Definition clip_ops.cc:1295
const bool * stop
Definition clip_ops.cc:1293
SpinLock spin
Definition clip_ops.cc:1291
bool * do_update
Definition clip_ops.cc:1294
int * build_sizes
Definition clip_ops.cc:1301
MovieClip * clip
Definition clip_ops.cc:1299
MovieDistortion * distortion
Definition clip_ops.cc:1300
int * build_undistort_sizes
Definition clip_ops.cc:1302
int build_undistort_count
Definition clip_ops.cc:1302
struct RenderData r
float cursor[2]
int launch_event
Definition clip_ops.cc:367
float * vec
Definition clip_ops.cc:369
float yorig
Definition clip_ops.cc:366
bool own_cursor
Definition clip_ops.cc:368
float xorig
Definition clip_ops.cc:366
float location[2]
Definition clip_ops.cc:541
double timer_lastdraw
Definition clip_ops.cc:543
wmTimer * timer
Definition clip_ops.cc:542
bool own_cursor
Definition clip_ops.cc:544
short val
Definition WM_types.hh:724
int xy[2]
Definition WM_types.hh:726
int mval[2]
Definition WM_types.hh:728
short type
Definition WM_types.hh:722
void * customdata
Definition WM_types.hh:772
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1036
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
PropertyRNA * prop
Definition WM_types.hh:1092
StructRNA * srna
Definition WM_types.hh:1080
void(* cancel)(bContext *C, wmOperator *op)
Definition WM_types.hh:1028
struct ReportList * reports
struct PointerRNA * ptr
wmWindow * win
Definition WM_types.hh:913
ParamHandle ** handles
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
@ WM_CURSOR_NSEW_SCROLL
Definition wm_cursors.hh:51
int WM_userdef_event_type_from_keymap_type(int kmitype)
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_main_add_notifier(uint type, void *reference)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
@ MOUSEPAN
@ RIGHTMOUSE
@ TIMER
@ MOUSEZOOM
@ EVT_SPACEKEY
@ MOUSEMOVE
@ LEFTMOUSE
@ NDOF_MOTION
@ EVT_ESCKEY
wmOperatorType * ot
Definition wm_files.cc:4125
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote)
Definition wm_jobs.cc:352
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:455
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
Definition wm_jobs.cc:597
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
Definition wm_jobs.cc:189
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
Definition wm_jobs.cc:364
bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
Definition wm_jobs.cc:223
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
Definition wm_jobs.cc:336
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
void WM_operator_properties_use_cursor_init(wmOperatorType *ot)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const int event_type, const double time_step)