Blender V4.5
clip_buttons.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 <cstdio>
10#include <cstring>
11
12#include "MEM_guardedalloc.h"
13
14#include "DNA_scene_types.h"
15#include "DNA_screen_types.h"
16#include "DNA_space_types.h"
17
18#include "BLI_listbase.h"
19#include "BLI_math_vector.h"
20#include "BLI_path_utils.hh"
21#include "BLI_string.h"
22#include "BLI_utildefines.h"
23
24#include "BLT_translation.hh"
25
26#include "BKE_context.hh"
27#include "BKE_movieclip.h"
28#include "BKE_screen.hh"
29#include "BKE_tracking.h"
30
31#include "DEG_depsgraph.hh"
32
33#include "ED_clip.hh"
34#include "ED_screen.hh"
35
36#include "UI_interface.hh"
37#include "UI_resources.hh"
38
39#include "RNA_access.hh"
40
41#include "WM_api.hh"
42#include "WM_types.hh"
43
44#include "IMB_imbuf.hh"
45#include "IMB_imbuf_types.hh"
46
47#include "MOV_read.hh"
48
49#include "clip_intern.hh" /* own include */
50
52
53/* Panels */
54
55static bool metadata_panel_context_poll(const bContext *C, PanelType * /*pt*/)
56{
57 return ED_space_clip_poll((bContext *)C);
58}
59
60static void metadata_panel_context_draw(const bContext *C, Panel *panel)
61{
62 SpaceClip *space_clip = CTX_wm_space_clip(C);
63 /* NOTE: This might not be exactly the same image buffer as shown in the
64 * clip editor itself, since that might be coming from proxy, or being
65 * postprocessed (stabilized or undistorted).
66 * Ideally we need to query metadata from an original image or movie without
67 * reading actual pixels to speed up the process. */
68 ImBuf *ibuf = ED_space_clip_get_buffer(space_clip);
69 if (ibuf != nullptr) {
71 IMB_freeImBuf(ibuf);
72 }
73}
74
76{
77 PanelType *pt;
78
79 pt = MEM_callocN<PanelType>("spacetype clip panel metadata");
80 STRNCPY(pt->idname, "CLIP_PT_metadata");
81 STRNCPY(pt->label, N_("Metadata"));
82 STRNCPY(pt->category, "Footage");
87 BLI_addtail(&art->paneltypes, pt);
88}
89
90/********************* MovieClip Template ************************/
91
93 bContext *C,
95 const blender::StringRefNull propname,
96 bool compact)
97{
98 if (!ptr->data) {
99 return;
100 }
101
102 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
103 if (!prop) {
104 printf("%s: property not found: %s.%s\n",
105 __func__,
107 propname.c_str());
108 return;
109 }
110
111 if (RNA_property_type(prop) != PROP_POINTER) {
112 printf("%s: expected pointer property for %s.%s\n",
113 __func__,
115 propname.c_str());
116 return;
117 }
118
119 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
120 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
121
122 uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr);
123
124 if (!compact) {
125 uiTemplateID(layout, C, ptr, propname, nullptr, "CLIP_OT_open", nullptr);
126 }
127
128 if (clip) {
129 uiLayout *row = &layout->row(false);
130 uiBlock *block = uiLayoutGetBlock(row);
131 uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, nullptr, 0, 0, "");
132
133 row = &layout->row(false);
134 uiLayout *split = &row->split(0.0f, false);
135 row = &split->row(true);
136
137 row->prop(&clipptr, "filepath", UI_ITEM_NONE, "", ICON_NONE);
138 row->op("clip.reload", "", ICON_FILE_REFRESH);
139
140 uiLayout *col = &layout->column(false);
141 uiTemplateColorspaceSettings(col, &clipptr, "colorspace_settings");
142 }
143}
144
145/********************* Track Template ************************/
146
147void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname)
148{
149 if (!ptr->data) {
150 return;
151 }
152
153 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
154 if (!prop) {
155 printf("%s: property not found: %s.%s\n",
156 __func__,
158 propname.c_str());
159 return;
160 }
161
162 if (RNA_property_type(prop) != PROP_POINTER) {
163 printf("%s: expected pointer property for %s.%s\n",
164 __func__,
166 propname.c_str());
167 return;
168 }
169
170 PointerRNA scopesptr = RNA_property_pointer_get(ptr, prop);
171 MovieClipScopes *scopes = (MovieClipScopes *)scopesptr.data;
172
173 if (scopes->track_preview_height < UI_UNIT_Y) {
175 }
176 else if (scopes->track_preview_height > UI_UNIT_Y * 20) {
177 scopes->track_preview_height = UI_UNIT_Y * 20;
178 }
179
180 uiLayout *col = &layout->column(true);
181 uiBlock *block = uiLayoutGetBlock(col);
182
183 uiDefBut(block,
185 0,
186 "",
187 0,
188 0,
189 UI_UNIT_X * 10,
190 scopes->track_preview_height,
191 scopes,
192 0,
193 0,
194 "");
195
196 /* Resize grip. */
197 uiDefIconButI(block,
199 0,
200 ICON_GRIP,
201 0,
202 0,
203 UI_UNIT_X * 10,
204 short(UI_UNIT_Y * 0.8f),
205 &scopes->track_preview_height,
206 UI_UNIT_Y,
207 UI_UNIT_Y * 20.0f,
208 "");
209}
210
211/********************* Marker Template ************************/
212
213#define B_MARKER_POS 3
214#define B_MARKER_OFFSET 4
215#define B_MARKER_PAT_DIM 5
216#define B_MARKER_SEARCH_POS 6
217#define B_MARKER_SEARCH_DIM 7
218#define B_MARKER_FLAG 8
219
243
244static void to_pixel_space(float r[2], const float a[2], int width, int height)
245{
246 copy_v2_v2(r, a);
247 r[0] *= width;
248 r[1] *= height;
249}
250
251static void marker_update_cb(bContext *C, void *arg_cb, void * /*arg*/)
252{
253 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
254
255 if (!cb->compact) {
256 return;
257 }
258
259 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
260 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
261 marker->flag = cb->marker_flag;
262
264}
265
266static void marker_block_handler(bContext *C, void *arg_cb, int event)
267{
268 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
269 int width, height;
270 bool ok = false;
271
272 BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
273
274 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
275 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
276
277 if (event == B_MARKER_POS) {
278 marker->pos[0] = cb->marker_pos[0] / width;
279 marker->pos[1] = cb->marker_pos[1] / height;
280
281 /* to update position of "parented" objects */
282 DEG_id_tag_update(&cb->clip->id, 0);
284
285 ok = true;
286 }
287 else if (event == B_MARKER_PAT_DIM) {
288 float dim[2], pat_dim[2], pat_min[2], pat_max[2];
289
290 BKE_tracking_marker_pattern_minmax(cb->marker, pat_min, pat_max);
291
292 sub_v2_v2v2(pat_dim, pat_max, pat_min);
293
294 dim[0] = cb->marker_pat[0] / width;
295 dim[1] = cb->marker_pat[1] / height;
296
297 float scale_x = dim[0] / pat_dim[0];
298 float scale_y = dim[1] / pat_dim[1];
299
300 for (int a = 0; a < 4; a++) {
301 cb->marker->pattern_corners[a][0] *= scale_x;
302 cb->marker->pattern_corners[a][1] *= scale_y;
303 }
304
306
307 ok = true;
308 }
309 else if (event == B_MARKER_SEARCH_POS) {
310 float delta[2], side[2];
311
313 mul_v2_fl(side, 0.5f);
314
315 delta[0] = cb->marker_search_pos[0] / width;
316 delta[1] = cb->marker_search_pos[1] / height;
317
318 sub_v2_v2v2(cb->marker->search_min, delta, side);
319 add_v2_v2v2(cb->marker->search_max, delta, side);
320
322
323 ok = true;
324 }
325 else if (event == B_MARKER_SEARCH_DIM) {
326 float dim[2], search_dim[2];
327
328 sub_v2_v2v2(search_dim, cb->marker->search_max, cb->marker->search_min);
329
330 dim[0] = cb->marker_search[0] / width;
331 dim[1] = cb->marker_search[1] / height;
332
333 sub_v2_v2(dim, search_dim);
334 mul_v2_fl(dim, 0.5f);
335
336 cb->marker->search_min[0] -= dim[0];
337 cb->marker->search_min[1] -= dim[1];
338
339 cb->marker->search_max[0] += dim[0];
340 cb->marker->search_max[1] += dim[1];
341
343
344 ok = true;
345 }
346 else if (event == B_MARKER_FLAG) {
347 marker->flag = cb->marker_flag;
348
349 ok = true;
350 }
351 else if (event == B_MARKER_OFFSET) {
352 float offset[2], delta[2];
353
354 offset[0] = cb->track_offset[0] / width;
355 offset[1] = cb->track_offset[1] / height;
356
357 sub_v2_v2v2(delta, offset, cb->track->offset);
358 copy_v2_v2(cb->track->offset, offset);
359
360 for (int i = 0; i < cb->track->markersnr; i++) {
361 sub_v2_v2(cb->track->markers[i].pos, delta);
362 }
363
364 /* to update position of "parented" objects */
365 DEG_id_tag_update(&cb->clip->id, 0);
367
368 ok = true;
369 }
370
371 if (ok) {
373 }
374}
375
378 const StringRefNull propname,
379 PointerRNA *userptr,
380 PointerRNA *trackptr,
381 bool compact)
382{
383 if (!ptr->data) {
384 return;
385 }
386
387 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
388 if (!prop) {
389 printf("%s: property not found: %s.%s\n",
390 __func__,
392 propname.c_str());
393 return;
394 }
395
396 if (RNA_property_type(prop) != PROP_POINTER) {
397 printf("%s: expected pointer property for %s.%s\n",
398 __func__,
400 propname.c_str());
401 return;
402 }
403
404 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
405 MovieClip *clip = (MovieClip *)clipptr.data;
406 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
407 MovieTrackingTrack *track = static_cast<MovieTrackingTrack *>(trackptr->data);
408
409 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
410 MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
411
412 MarkerUpdateCb *cb = MEM_callocN<MarkerUpdateCb>("uiTemplateMarker update_cb");
413 cb->compact = compact;
414 cb->clip = clip;
415 cb->user = user;
416 cb->track = track;
417 cb->marker = marker;
418 cb->marker_flag = marker->flag;
419 cb->framenr = user->framenr;
420
421 if (compact) {
422 uiBlock *block = uiLayoutGetBlock(layout);
423
425 if (cb->marker_flag & MARKER_DISABLED) {
426 tip = TIP_("Marker is disabled at current frame");
427 }
428 else {
429 tip = TIP_("Marker is enabled at current frame");
430 }
431
432 uiBut *bt = uiDefIconButBitI(block,
435 0,
436 ICON_HIDE_OFF,
437 0,
438 0,
439 UI_UNIT_X,
440 UI_UNIT_Y,
441 &cb->marker_flag,
442 0,
443 0,
444 tip);
445 UI_but_funcN_set(bt, marker_update_cb, cb, nullptr);
447 }
448 else {
449 int width, height;
450
451 BKE_movieclip_get_size(clip, user, &width, &height);
452
453 if (track->flag & TRACK_LOCKED) {
454 uiLayoutSetActive(layout, false);
455 uiBlock *block = layout->absolute_block();
456 uiDefBut(block,
458 0,
459 IFACE_("Track is locked"),
460 0,
461 0,
462 UI_UNIT_X * 15.0f,
463 UI_UNIT_Y,
464 nullptr,
465 0,
466 0,
467 "");
468 MEM_freeN(cb);
469 return;
470 }
471
472 float pat_min[2], pat_max[2];
473 float pat_dim[2], search_dim[2], search_pos[2];
474
475 BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
476
477 sub_v2_v2v2(pat_dim, pat_max, pat_min);
478 sub_v2_v2v2(search_dim, marker->search_max, marker->search_min);
479
480 add_v2_v2v2(search_pos, marker->search_max, marker->search_min);
481 mul_v2_fl(search_pos, 0.5);
482
483 to_pixel_space(cb->marker_pos, marker->pos, width, height);
484 to_pixel_space(cb->marker_pat, pat_dim, width, height);
485 to_pixel_space(cb->marker_search, search_dim, width, height);
486 to_pixel_space(cb->marker_search_pos, search_pos, width, height);
487 to_pixel_space(cb->track_offset, track->offset, width, height);
488
489 cb->marker_flag = marker->flag;
490
491 uiBlock *block = layout->absolute_block();
493 UI_block_funcN_set(block, marker_update_cb, cb, nullptr);
494
496 int step = 100;
497 int digits = 2;
498
499 if (cb->marker_flag & MARKER_DISABLED) {
500 tip = TIP_("Marker is disabled at current frame");
501 }
502 else {
503 tip = TIP_("Marker is enabled at current frame");
504 }
505
506 uiDefButBitI(block,
510 IFACE_("Enabled"),
511 0.5 * UI_UNIT_X,
512 9.5 * UI_UNIT_Y,
513 7.25 * UI_UNIT_X,
514 UI_UNIT_Y,
515 &cb->marker_flag,
516 0,
517 0,
518 tip);
519
520 uiLayout *col = &layout->column(true);
522
523 block = col->absolute_block();
525
526 uiDefBut(block,
528 0,
529 IFACE_("Position:"),
530 0,
531 10 * UI_UNIT_Y,
532 15 * UI_UNIT_X,
533 UI_UNIT_Y,
534 nullptr,
535 0,
536 0,
537 "");
538 uiBut *bt = uiDefButF(block,
541 IFACE_("X:"),
542 0.5 * UI_UNIT_X,
543 9 * UI_UNIT_Y,
544 7.25 * UI_UNIT_X,
545 UI_UNIT_Y,
546 &cb->marker_pos[0],
547 -10 * width,
548 10.0 * width,
549 TIP_("X-position of marker at frame in screen coordinates"));
551 UI_but_number_precision_set(bt, digits);
552 bt = uiDefButF(block,
555 IFACE_("Y:"),
556 8.25 * UI_UNIT_X,
557 9 * UI_UNIT_Y,
558 7.25 * UI_UNIT_X,
559 UI_UNIT_Y,
560 &cb->marker_pos[1],
561 -10 * height,
562 10.0 * height,
563 TIP_("Y-position of marker at frame in screen coordinates"));
565 UI_but_number_precision_set(bt, digits);
566
567 uiDefBut(block,
569 0,
570 IFACE_("Offset:"),
571 0,
572 8 * UI_UNIT_Y,
573 15 * UI_UNIT_X,
574 UI_UNIT_Y,
575 nullptr,
576 0,
577 0,
578 "");
579 bt = uiDefButF(block,
582 IFACE_("X:"),
583 0.5 * UI_UNIT_X,
584 7 * UI_UNIT_Y,
585 7.25 * UI_UNIT_X,
586 UI_UNIT_Y,
587 &cb->track_offset[0],
588 -10 * width,
589 10.0 * width,
590 TIP_("X-offset to parenting point"));
592 UI_but_number_precision_set(bt, digits);
593 bt = uiDefButF(block,
596 IFACE_("Y:"),
597 8.25 * UI_UNIT_X,
598 7 * UI_UNIT_Y,
599 7.25 * UI_UNIT_X,
600 UI_UNIT_Y,
601 &cb->track_offset[1],
602 -10 * height,
603 10.0 * height,
604 TIP_("Y-offset to parenting point"));
606 UI_but_number_precision_set(bt, digits);
607
608 uiDefBut(block,
610 0,
611 IFACE_("Pattern Area:"),
612 0,
613 6 * UI_UNIT_Y,
614 15 * UI_UNIT_X,
615 UI_UNIT_Y,
616 nullptr,
617 0,
618 0,
619 "");
620 bt = uiDefButF(block,
623 IFACE_("Width:"),
624 0.5 * UI_UNIT_X,
625 5 * UI_UNIT_Y,
626 15 * UI_UNIT_X,
627 UI_UNIT_Y,
628 &cb->marker_pat[0],
629 3.0f,
630 10.0 * width,
631 TIP_("Width of marker's pattern in screen coordinates"));
633 UI_but_number_precision_set(bt, digits);
634 bt = uiDefButF(block,
637 IFACE_("Height:"),
638 0.5 * UI_UNIT_X,
639 4 * UI_UNIT_Y,
640 15 * UI_UNIT_X,
641 UI_UNIT_Y,
642 &cb->marker_pat[1],
643 3.0f,
644 10.0 * height,
645 TIP_("Height of marker's pattern in screen coordinates"));
647 UI_but_number_precision_set(bt, digits);
648
649 uiDefBut(block,
651 0,
652 IFACE_("Search Area:"),
653 0,
654 3 * UI_UNIT_Y,
655 15 * UI_UNIT_X,
656 UI_UNIT_Y,
657 nullptr,
658 0,
659 0,
660 "");
661 bt = uiDefButF(block,
664 IFACE_("X:"),
665 0.5 * UI_UNIT_X,
666 2 * UI_UNIT_Y,
667 7.25 * UI_UNIT_X,
668 UI_UNIT_Y,
669 &cb->marker_search_pos[0],
670 -width,
671 width,
672 TIP_("X-position of search at frame relative to marker's position"));
674 UI_but_number_precision_set(bt, digits);
675 bt = uiDefButF(block,
678 IFACE_("Y:"),
679 8.25 * UI_UNIT_X,
680 2 * UI_UNIT_Y,
681 7.25 * UI_UNIT_X,
682 UI_UNIT_Y,
683 &cb->marker_search_pos[1],
684 -height,
685 height,
686 TIP_("Y-position of search at frame relative to marker's position"));
688 UI_but_number_precision_set(bt, digits);
689 bt = uiDefButF(block,
692 IFACE_("Width:"),
693 0.5 * UI_UNIT_X,
694 1 * UI_UNIT_Y,
695 15 * UI_UNIT_X,
696 UI_UNIT_Y,
697 &cb->marker_search[0],
698 3.0f,
699 10.0 * width,
700 TIP_("Width of marker's search in screen coordinates"));
702 UI_but_number_precision_set(bt, digits);
703 bt = uiDefButF(block,
706 IFACE_("Height:"),
707 0.5 * UI_UNIT_X,
708 0 * UI_UNIT_Y,
709 15 * UI_UNIT_X,
710 UI_UNIT_Y,
711 &cb->marker_search[1],
712 3.0f,
713 10.0 * height,
714 TIP_("Height of marker's search in screen coordinates"));
716 UI_but_number_precision_set(bt, digits);
717
718 UI_block_align_end(block);
719 }
720}
721
722/********************* Footage Information Template ************************/
723
726 const StringRefNull propname,
727 PointerRNA *userptr)
728{
729 if (!ptr->data) {
730 return;
731 }
732
733 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
734 if (!prop) {
735 printf("%s: property not found: %s.%s\n",
736 __func__,
738 propname.c_str());
739 return;
740 }
741
742 if (RNA_property_type(prop) != PROP_POINTER) {
743 printf("%s: expected pointer property for %s.%s\n",
744 __func__,
746 propname.c_str());
747 return;
748 }
749
750 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
751 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
752 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
753
754 uiLayout *col = &layout->column(false);
756
757 /* NOTE: Put the frame to cache. If the panel is drawn, the display will also be shown, as well
758 * as metadata panel. So if the cache is skipped here it is not really a memory saver, but
759 * skipping the cache could lead to a performance impact depending on the order in which panels
760 * and the main area is drawn. Basically, if it is this template drawn first and then the main
761 * area it will lead to frame read and processing happening twice. */
762 ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, 0);
763
764 int width, height;
765 /* Display frame dimensions, channels number and buffer type. */
766 BKE_movieclip_get_size(clip, user, &width, &height);
767
768 char str[1024];
769 size_t ofs = 0;
770 ofs += BLI_snprintf_rlen(str + ofs, sizeof(str) - ofs, RPT_("%d x %d"), width, height);
771
772 if (ibuf) {
773 if (ibuf->float_buffer.data) {
774 if (ibuf->channels != 4) {
775 ofs += BLI_snprintf_rlen(
776 str + ofs, sizeof(str) - ofs, RPT_(", %d float channel(s)"), ibuf->channels);
777 }
778 else if (ibuf->planes == R_IMF_PLANES_RGBA) {
779 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGBA float"), sizeof(str) - ofs);
780 }
781 else {
782 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGB float"), sizeof(str) - ofs);
783 }
784 }
785 else {
786 if (ibuf->planes == R_IMF_PLANES_RGBA) {
787 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGBA byte"), sizeof(str) - ofs);
788 }
789 else {
790 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGB byte"), sizeof(str) - ofs);
791 }
792 }
793
794 if (clip->anim != nullptr) {
795 float fps = MOV_get_fps(clip->anim);
796 if (fps > 0.0f) {
797 ofs += BLI_snprintf_rlen(str + ofs, sizeof(str) - ofs, RPT_(", %.2f fps"), fps);
798 }
799 }
800 }
801 else {
802 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", failed to load"), sizeof(str) - ofs);
803 }
804 UNUSED_VARS(ofs);
805
806 col->label(str, ICON_NONE);
807
808 /* Display current frame number. */
809 int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
810 if (framenr <= clip->len) {
811 SNPRINTF(str, RPT_("Frame: %d / %d"), framenr, clip->len);
812 }
813 else {
814 SNPRINTF(str, RPT_("Frame: - / %d"), clip->len);
815 }
816 col->label(str, ICON_NONE);
817
818 /* Display current file name if it's a sequence clip. */
819 if (clip->source == MCLIP_SRC_SEQUENCE) {
820 char filepath[FILE_MAX];
821 const char *file;
822
823 if (framenr <= clip->len) {
824 BKE_movieclip_filepath_for_frame(clip, user, filepath);
825 file = BLI_path_basename(filepath);
826 }
827 else {
828 file = "-";
829 }
830
831 SNPRINTF(str, RPT_("File: %s"), file);
832
833 col->label(str, ICON_NONE);
834 }
835
836 IMB_freeImBuf(ibuf);
837}
SpaceClip * CTX_wm_space_clip(const bContext *C)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
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)
struct ImBuf * BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, const struct MovieClipUser *user, int flag, int cache_flag)
@ PANEL_TYPE_DEFAULT_CLOSED
struct MovieTrackingMarker * BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1401
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1357
void BKE_tracking_marker_clamp_search_position(struct MovieTrackingMarker *marker)
Definition tracking.cc:1337
void BKE_tracking_marker_clamp_search_size(struct MovieTrackingMarker *marker)
Definition tracking.cc:1326
void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2])
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define FILE_MAX
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:599
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define UNUSED_VARS(...)
#define RPT_(msgid)
#define TIP_(msgid)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
void DEG_id_tag_update(ID *id, unsigned int flags)
@ MCLIP_SRC_SEQUENCE
@ R_IMF_PLANES_RGBA
@ MARKER_DISABLED
@ TRACK_LOCKED
bool ED_space_clip_poll(bContext *C)
ImBuf * ED_space_clip_get_buffer(const SpaceClip *sc)
void ED_region_image_metadata_panel_draw(ImBuf *ibuf, uiLayout *layout)
Definition area.cc:3963
static void split(const char *text, const char *seps, char ***str, int *count)
void IMB_freeImBuf(ImBuf *ibuf)
Read Guarded memory(de)allocation.
@ PROP_POINTER
Definition RNA_types.hh:155
#define C
Definition RandGen.cpp:29
#define UI_UNIT_Y
uiBut * uiDefButBitI(uiBlock *block, int type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
@ UI_BUT_ICON_REVERSE
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_but_number_step_size_set(uiBut *but, float step_size)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, std::optional< blender::StringRef > text=std::nullopt)
void UI_block_align_begin(uiBlock *block)
uiBut * uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void UI_but_number_precision_set(uiBut *but, float precision)
#define UI_UNIT_X
@ UI_BTYPE_TOGGLE_N
@ UI_BTYPE_LABEL
@ UI_BTYPE_CHECKBOX_N
@ UI_BTYPE_NUM
@ UI_BTYPE_TRACK_PREVIEW
@ UI_BTYPE_GRIP
void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, blender::StringRefNull propname)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
uiBut * uiDefButF(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, float *poin, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_align_end(uiBlock *block)
void uiLayoutSetContextPointer(uiLayout *layout, blender::StringRef name, PointerRNA *ptr)
void uiLayoutSetActive(uiLayout *layout, bool active)
@ UI_LAYOUT_ALIGN_RIGHT
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
#define UI_ITEM_NONE
#define NC_MOVIECLIP
Definition WM_types.hh:394
#define NA_EDITED
Definition WM_types.hh:581
#define ND_SPACE_VIEW3D
Definition WM_types.hh:525
#define NC_SPACE
Definition WM_types.hh:389
constexpr const char * c_str() const
#define B_MARKER_POS
#define B_MARKER_SEARCH_DIM
static void marker_block_handler(bContext *C, void *arg_cb, int event)
void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, PointerRNA *userptr)
void ED_clip_buttons_register(ARegionType *art)
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, PointerRNA *userptr, PointerRNA *trackptr, bool compact)
#define B_MARKER_SEARCH_POS
void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const blender::StringRefNull propname, bool compact)
void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname)
#define B_MARKER_OFFSET
#define B_MARKER_PAT_DIM
#define B_MARKER_FLAG
static void marker_update_cb(bContext *C, void *arg_cb, void *)
static void to_pixel_space(float r[2], const float a[2], int width, int height)
static bool metadata_panel_context_poll(const bContext *C, PanelType *)
static void metadata_panel_context_draw(const bContext *C, Panel *panel)
#define str(s)
uint col
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
#define printf(...)
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
float MOV_get_fps(const MovieReader *anim)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
ListBase paneltypes
ImBufFloatBuffer float_buffer
unsigned char planes
MovieTrackingMarker * marker
MovieTrackingTrack * track
float track_offset[2]
float marker_search_pos[2]
MovieClip * clip
float marker_search[2]
float marker_pat[2]
float marker_pos[2]
MovieClipUser * user
struct MovieReader * anim
MovieTrackingMarker * markers
void(* draw)(const bContext *C, Panel *panel)
char idname[BKE_ST_MAXNAME]
bool(* poll)(const bContext *C, PanelType *pt)
char translation_context[BKE_ST_MAXNAME]
char category[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
struct uiLayout * layout
void * data
Definition RNA_types.hh:53
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, wmOperatorCallContext context, eUI_Item_Flag flag)
uiBlock * absolute_block()
uiLayout & column(bool align)
uiLayout & row(bool align)
uiLayout & split(float percentage, bool align)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
i
Definition text_draw.cc:230
uint len
#define N_(msgid)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4226