Blender V5.0
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_string_utf8.h"
23#include "BLI_utildefines.h"
24
25#include "BLT_translation.hh"
26
27#include "BKE_context.hh"
28#include "BKE_movieclip.h"
29#include "BKE_screen.hh"
30#include "BKE_tracking.h"
31
32#include "DEG_depsgraph.hh"
33
34#include "ED_clip.hh"
35#include "ED_screen.hh"
36
37#include "UI_interface.hh"
39#include "UI_resources.hh"
40
41#include "RNA_access.hh"
42
43#include "WM_api.hh"
44#include "WM_types.hh"
45
46#include "IMB_imbuf.hh"
47#include "IMB_imbuf_types.hh"
48
49#include "MOV_read.hh"
50
51#include "clip_intern.hh" /* own include */
52
54
55/* Panels */
56
57static bool metadata_panel_context_poll(const bContext *C, PanelType * /*pt*/)
58{
59 return ED_space_clip_poll((bContext *)C);
60}
61
62static void metadata_panel_context_draw(const bContext *C, Panel *panel)
63{
64 SpaceClip *space_clip = CTX_wm_space_clip(C);
65 /* NOTE: This might not be exactly the same image buffer as shown in the
66 * clip editor itself, since that might be coming from proxy, or being
67 * postprocessed (stabilized or undistorted).
68 * Ideally we need to query metadata from an original image or movie without
69 * reading actual pixels to speed up the process. */
70 ImBuf *ibuf = ED_space_clip_get_buffer(space_clip);
71 if (ibuf != nullptr) {
73 IMB_freeImBuf(ibuf);
74 }
75}
76
78{
79 PanelType *pt;
80
81 pt = MEM_callocN<PanelType>("spacetype clip panel metadata");
82 STRNCPY_UTF8(pt->idname, "CLIP_PT_metadata");
83 STRNCPY_UTF8(pt->label, N_("Metadata"));
84 STRNCPY_UTF8(pt->category, "Footage");
89 BLI_addtail(&art->paneltypes, pt);
90}
91
92/********************* MovieClip Template ************************/
93
95 bContext *C,
97 const blender::StringRefNull propname,
98 bool compact)
99{
100 if (!ptr->data) {
101 return;
102 }
103
104 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
105 if (!prop) {
106 printf("%s: property not found: %s.%s\n",
107 __func__,
109 propname.c_str());
110 return;
111 }
112
113 if (RNA_property_type(prop) != PROP_POINTER) {
114 printf("%s: expected pointer property for %s.%s\n",
115 __func__,
117 propname.c_str());
118 return;
119 }
120
121 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
122 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
123
124 layout->context_ptr_set("edit_movieclip", &clipptr);
125
126 if (!compact) {
127 uiTemplateID(layout, C, ptr, propname, nullptr, "CLIP_OT_open", nullptr);
128 }
129
130 if (clip) {
131 uiLayout *row = &layout->row(false);
132 uiBlock *block = row->block();
133 uiDefBut(block, ButType::Label, 0, IFACE_("File Path:"), 0, 19, 145, 19, nullptr, 0, 0, "");
134
135 row = &layout->row(false);
136 uiLayout *split = &row->split(0.0f, false);
137 row = &split->row(true);
138
139 row->prop(&clipptr, "filepath", UI_ITEM_NONE, "", ICON_NONE);
140 row->op("clip.reload", "", ICON_FILE_REFRESH);
141
142 uiLayout *col = &layout->column(false);
143 uiTemplateColorspaceSettings(col, &clipptr, "colorspace_settings");
144 }
145}
146
147/********************* Track Template ************************/
148
149void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname)
150{
151 if (!ptr->data) {
152 return;
153 }
154
155 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
156 if (!prop) {
157 printf("%s: property not found: %s.%s\n",
158 __func__,
160 propname.c_str());
161 return;
162 }
163
164 if (RNA_property_type(prop) != PROP_POINTER) {
165 printf("%s: expected pointer property for %s.%s\n",
166 __func__,
168 propname.c_str());
169 return;
170 }
171
172 PointerRNA scopesptr = RNA_property_pointer_get(ptr, prop);
173 MovieClipScopes *scopes = (MovieClipScopes *)scopesptr.data;
174
175 if (scopes->track_preview_height < UI_UNIT_Y) {
177 }
178 else if (scopes->track_preview_height > UI_UNIT_Y * 20) {
179 scopes->track_preview_height = UI_UNIT_Y * 20;
180 }
181
182 uiLayout *col = &layout->column(true);
183 uiBlock *block = col->block();
184
185 uiDefBut(block,
187 0,
188 "",
189 0,
190 0,
191 UI_UNIT_X * 10,
192 scopes->track_preview_height,
193 scopes,
194 0,
195 0,
196 "");
197
198 /* Resize grip. */
199 uiDefIconButI(block,
201 0,
202 ICON_GRIP,
203 0,
204 0,
205 UI_UNIT_X * 10,
206 short(UI_UNIT_Y * 0.8f),
207 &scopes->track_preview_height,
208 UI_UNIT_Y,
209 UI_UNIT_Y * 20.0f,
210 "");
211}
212
213/********************* Marker Template ************************/
214
215#define B_MARKER_POS 3
216#define B_MARKER_OFFSET 4
217#define B_MARKER_PAT_DIM 5
218#define B_MARKER_SEARCH_POS 6
219#define B_MARKER_SEARCH_DIM 7
220#define B_MARKER_FLAG 8
221
245
246static void to_pixel_space(float r[2], const float a[2], int width, int height)
247{
248 copy_v2_v2(r, a);
249 r[0] *= width;
250 r[1] *= height;
251}
252
253static void marker_update_cb(bContext *C, void *arg_cb, void * /*arg*/)
254{
255 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
256
257 if (!cb->compact) {
258 return;
259 }
260
261 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
262 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
263 marker->flag = cb->marker_flag;
264
266}
267
268static void marker_block_handler(bContext *C, void *arg_cb, int event)
269{
270 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
271 int width, height;
272 bool ok = false;
273
274 BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
275
276 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
277 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
278
279 if (event == B_MARKER_POS) {
280 marker->pos[0] = cb->marker_pos[0] / width;
281 marker->pos[1] = cb->marker_pos[1] / height;
282
283 /* to update position of "parented" objects */
284 DEG_id_tag_update(&cb->clip->id, 0);
286
287 ok = true;
288 }
289 else if (event == B_MARKER_PAT_DIM) {
290 float dim[2], pat_dim[2], pat_min[2], pat_max[2];
291
292 BKE_tracking_marker_pattern_minmax(cb->marker, pat_min, pat_max);
293
294 sub_v2_v2v2(pat_dim, pat_max, pat_min);
295
296 dim[0] = cb->marker_pat[0] / width;
297 dim[1] = cb->marker_pat[1] / height;
298
299 float scale_x = dim[0] / pat_dim[0];
300 float scale_y = dim[1] / pat_dim[1];
301
302 for (int a = 0; a < 4; a++) {
303 cb->marker->pattern_corners[a][0] *= scale_x;
304 cb->marker->pattern_corners[a][1] *= scale_y;
305 }
306
308
309 ok = true;
310 }
311 else if (event == B_MARKER_SEARCH_POS) {
312 float delta[2], side[2];
313
315 mul_v2_fl(side, 0.5f);
316
317 delta[0] = cb->marker_search_pos[0] / width;
318 delta[1] = cb->marker_search_pos[1] / height;
319
320 sub_v2_v2v2(cb->marker->search_min, delta, side);
321 add_v2_v2v2(cb->marker->search_max, delta, side);
322
324
325 ok = true;
326 }
327 else if (event == B_MARKER_SEARCH_DIM) {
328 float dim[2], search_dim[2];
329
330 sub_v2_v2v2(search_dim, cb->marker->search_max, cb->marker->search_min);
331
332 dim[0] = cb->marker_search[0] / width;
333 dim[1] = cb->marker_search[1] / height;
334
335 sub_v2_v2(dim, search_dim);
336 mul_v2_fl(dim, 0.5f);
337
338 cb->marker->search_min[0] -= dim[0];
339 cb->marker->search_min[1] -= dim[1];
340
341 cb->marker->search_max[0] += dim[0];
342 cb->marker->search_max[1] += dim[1];
343
345
346 ok = true;
347 }
348 else if (event == B_MARKER_FLAG) {
349 marker->flag = cb->marker_flag;
350
351 ok = true;
352 }
353 else if (event == B_MARKER_OFFSET) {
354 float offset[2], delta[2];
355
356 offset[0] = cb->track_offset[0] / width;
357 offset[1] = cb->track_offset[1] / height;
358
359 sub_v2_v2v2(delta, offset, cb->track->offset);
360 copy_v2_v2(cb->track->offset, offset);
361
362 for (int i = 0; i < cb->track->markersnr; i++) {
363 sub_v2_v2(cb->track->markers[i].pos, delta);
364 }
365
366 /* to update position of "parented" objects */
367 DEG_id_tag_update(&cb->clip->id, 0);
369
370 ok = true;
371 }
372
373 if (ok) {
375 }
376}
377
380 const StringRefNull propname,
381 PointerRNA *userptr,
382 PointerRNA *trackptr,
383 bool compact)
384{
385 if (!ptr->data) {
386 return;
387 }
388
389 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
390 if (!prop) {
391 printf("%s: property not found: %s.%s\n",
392 __func__,
394 propname.c_str());
395 return;
396 }
397
398 if (RNA_property_type(prop) != PROP_POINTER) {
399 printf("%s: expected pointer property for %s.%s\n",
400 __func__,
402 propname.c_str());
403 return;
404 }
405
406 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
407 MovieClip *clip = (MovieClip *)clipptr.data;
408 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
409 MovieTrackingTrack *track = static_cast<MovieTrackingTrack *>(trackptr->data);
410
411 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
412 MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
413
414 MarkerUpdateCb *cb = MEM_callocN<MarkerUpdateCb>("uiTemplateMarker update_cb");
415 cb->compact = compact;
416 cb->clip = clip;
417 cb->user = user;
418 cb->track = track;
419 cb->marker = marker;
420 cb->marker_flag = marker->flag;
421 cb->framenr = user->framenr;
422
423 if (compact) {
424 uiBlock *block = layout->block();
425
427 if (cb->marker_flag & MARKER_DISABLED) {
428 tip = TIP_("Marker is disabled at current frame");
429 }
430 else {
431 tip = TIP_("Marker is enabled at current frame");
432 }
433
434 uiBut *bt = uiDefIconButBitI(block,
437 0,
438 ICON_HIDE_OFF,
439 0,
440 0,
441 UI_UNIT_X,
442 UI_UNIT_Y,
443 &cb->marker_flag,
444 0,
445 0,
446 tip);
447 UI_but_funcN_set(bt, marker_update_cb, cb, nullptr);
449 }
450 else {
451 int width, height;
452
453 BKE_movieclip_get_size(clip, user, &width, &height);
454
455 if (track->flag & TRACK_LOCKED) {
456 layout->active_set(false);
457 uiBlock *block = layout->absolute_block();
458 uiDefBut(block,
460 0,
461 IFACE_("Track is locked"),
462 0,
463 0,
464 UI_UNIT_X * 15.0f,
465 UI_UNIT_Y,
466 nullptr,
467 0,
468 0,
469 "");
470 MEM_freeN(cb);
471 return;
472 }
473
474 float pat_min[2], pat_max[2];
475 float pat_dim[2], search_dim[2], search_pos[2];
476
477 BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
478
479 sub_v2_v2v2(pat_dim, pat_max, pat_min);
480 sub_v2_v2v2(search_dim, marker->search_max, marker->search_min);
481
482 add_v2_v2v2(search_pos, marker->search_max, marker->search_min);
483 mul_v2_fl(search_pos, 0.5);
484
485 to_pixel_space(cb->marker_pos, marker->pos, width, height);
486 to_pixel_space(cb->marker_pat, pat_dim, width, height);
487 to_pixel_space(cb->marker_search, search_dim, width, height);
488 to_pixel_space(cb->marker_search_pos, search_pos, width, height);
489 to_pixel_space(cb->track_offset, track->offset, width, height);
490
491 cb->marker_flag = marker->flag;
492
493 uiBlock *block = layout->absolute_block();
495 UI_block_funcN_set(block, marker_update_cb, cb, nullptr);
496
498 int step = 100;
499 int digits = 2;
500
501 if (cb->marker_flag & MARKER_DISABLED) {
502 tip = TIP_("Marker is disabled at current frame");
503 }
504 else {
505 tip = TIP_("Marker is enabled at current frame");
506 }
507
508 uiDefButBitI(block,
512 IFACE_("Enabled"),
513 0.5 * UI_UNIT_X,
514 9.5 * UI_UNIT_Y,
515 7.25 * UI_UNIT_X,
516 UI_UNIT_Y,
517 &cb->marker_flag,
518 0,
519 0,
520 tip);
521
522 uiLayout *col = &layout->column(true);
523 col->active_set((cb->marker_flag & MARKER_DISABLED) == 0);
524
525 block = col->absolute_block();
527
528 uiDefBut(block,
530 0,
531 IFACE_("Position:"),
532 0,
533 10 * UI_UNIT_Y,
534 15 * UI_UNIT_X,
535 UI_UNIT_Y,
536 nullptr,
537 0,
538 0,
539 "");
540 uiBut *bt = uiDefButF(block,
543 IFACE_("X:"),
544 0.5 * UI_UNIT_X,
545 9 * UI_UNIT_Y,
546 7.25 * UI_UNIT_X,
547 UI_UNIT_Y,
548 &cb->marker_pos[0],
549 -10 * width,
550 10.0 * width,
551 TIP_("X-position of marker at frame in screen coordinates"));
553 UI_but_number_precision_set(bt, digits);
554 bt = uiDefButF(block,
557 IFACE_("Y:"),
558 8.25 * UI_UNIT_X,
559 9 * UI_UNIT_Y,
560 7.25 * UI_UNIT_X,
561 UI_UNIT_Y,
562 &cb->marker_pos[1],
563 -10 * height,
564 10.0 * height,
565 TIP_("Y-position of marker at frame in screen coordinates"));
567 UI_but_number_precision_set(bt, digits);
568
569 uiDefBut(block,
571 0,
572 IFACE_("Offset:"),
573 0,
574 8 * UI_UNIT_Y,
575 15 * UI_UNIT_X,
576 UI_UNIT_Y,
577 nullptr,
578 0,
579 0,
580 "");
581 bt = uiDefButF(block,
584 IFACE_("X:"),
585 0.5 * UI_UNIT_X,
586 7 * UI_UNIT_Y,
587 7.25 * UI_UNIT_X,
588 UI_UNIT_Y,
589 &cb->track_offset[0],
590 -10 * width,
591 10.0 * width,
592 TIP_("X-offset to parenting point"));
594 UI_but_number_precision_set(bt, digits);
595 bt = uiDefButF(block,
598 IFACE_("Y:"),
599 8.25 * UI_UNIT_X,
600 7 * UI_UNIT_Y,
601 7.25 * UI_UNIT_X,
602 UI_UNIT_Y,
603 &cb->track_offset[1],
604 -10 * height,
605 10.0 * height,
606 TIP_("Y-offset to parenting point"));
608 UI_but_number_precision_set(bt, digits);
609
610 uiDefBut(block,
612 0,
613 IFACE_("Pattern Area:"),
614 0,
615 6 * UI_UNIT_Y,
616 15 * UI_UNIT_X,
617 UI_UNIT_Y,
618 nullptr,
619 0,
620 0,
621 "");
622 bt = uiDefButF(block,
625 IFACE_("Width:"),
626 0.5 * UI_UNIT_X,
627 5 * UI_UNIT_Y,
628 15 * UI_UNIT_X,
629 UI_UNIT_Y,
630 &cb->marker_pat[0],
631 3.0f,
632 10.0 * width,
633 TIP_("Width of marker's pattern in screen coordinates"));
635 UI_but_number_precision_set(bt, digits);
636 bt = uiDefButF(block,
639 IFACE_("Height:"),
640 0.5 * UI_UNIT_X,
641 4 * UI_UNIT_Y,
642 15 * UI_UNIT_X,
643 UI_UNIT_Y,
644 &cb->marker_pat[1],
645 3.0f,
646 10.0 * height,
647 TIP_("Height of marker's pattern in screen coordinates"));
649 UI_but_number_precision_set(bt, digits);
650
651 uiDefBut(block,
653 0,
654 IFACE_("Search Area:"),
655 0,
656 3 * UI_UNIT_Y,
657 15 * UI_UNIT_X,
658 UI_UNIT_Y,
659 nullptr,
660 0,
661 0,
662 "");
663 bt = uiDefButF(block,
666 IFACE_("X:"),
667 0.5 * UI_UNIT_X,
668 2 * UI_UNIT_Y,
669 7.25 * UI_UNIT_X,
670 UI_UNIT_Y,
671 &cb->marker_search_pos[0],
672 -width,
673 width,
674 TIP_("X-position of search at frame relative to marker's position"));
676 UI_but_number_precision_set(bt, digits);
677 bt = uiDefButF(block,
680 IFACE_("Y:"),
681 8.25 * UI_UNIT_X,
682 2 * UI_UNIT_Y,
683 7.25 * UI_UNIT_X,
684 UI_UNIT_Y,
685 &cb->marker_search_pos[1],
686 -height,
687 height,
688 TIP_("Y-position of search at frame relative to marker's position"));
690 UI_but_number_precision_set(bt, digits);
691 bt = uiDefButF(block,
694 IFACE_("Width:"),
695 0.5 * UI_UNIT_X,
696 1 * UI_UNIT_Y,
697 15 * UI_UNIT_X,
698 UI_UNIT_Y,
699 &cb->marker_search[0],
700 3.0f,
701 10.0 * width,
702 TIP_("Width of marker's search in screen coordinates"));
704 UI_but_number_precision_set(bt, digits);
705 bt = uiDefButF(block,
708 IFACE_("Height:"),
709 0.5 * UI_UNIT_X,
710 0 * UI_UNIT_Y,
711 15 * UI_UNIT_X,
712 UI_UNIT_Y,
713 &cb->marker_search[1],
714 3.0f,
715 10.0 * height,
716 TIP_("Height of marker's search in screen coordinates"));
718 UI_but_number_precision_set(bt, digits);
719
720 UI_block_align_end(block);
721 }
722}
723
724/********************* Footage Information Template ************************/
725
728 const StringRefNull propname,
729 PointerRNA *userptr)
730{
731 if (!ptr->data) {
732 return;
733 }
734
735 PropertyRNA *prop = RNA_struct_find_property(ptr, propname.c_str());
736 if (!prop) {
737 printf("%s: property not found: %s.%s\n",
738 __func__,
740 propname.c_str());
741 return;
742 }
743
744 if (RNA_property_type(prop) != PROP_POINTER) {
745 printf("%s: expected pointer property for %s.%s\n",
746 __func__,
748 propname.c_str());
749 return;
750 }
751
752 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
753 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
754 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
755
756 uiLayout *col = &layout->column(false);
757 col->alignment_set(blender::ui::LayoutAlign::Right);
758
759 /* NOTE: Put the frame to cache. If the panel is drawn, the display will also be shown, as well
760 * as metadata panel. So if the cache is skipped here it is not really a memory saver, but
761 * skipping the cache could lead to a performance impact depending on the order in which panels
762 * and the main area is drawn. Basically, if it is this template drawn first and then the main
763 * area it will lead to frame read and processing happening twice. */
764 ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, 0);
765
766 int width, height;
767 /* Display frame dimensions, channels number and buffer type. */
768 BKE_movieclip_get_size(clip, user, &width, &height);
769
770 char str[1024];
771 size_t ofs = 0;
772 ofs += BLI_snprintf_utf8_rlen(str + ofs, sizeof(str) - ofs, RPT_("%d x %d"), width, height);
773
774 if (ibuf) {
775 if (ibuf->float_buffer.data) {
776 if (ibuf->channels != 4) {
778 str + ofs, sizeof(str) - ofs, RPT_(", %d float channel(s)"), ibuf->channels);
779 }
780 else if (ibuf->planes == R_IMF_PLANES_RGBA) {
781 ofs += BLI_strncpy_utf8_rlen(str + ofs, RPT_(", RGBA float"), sizeof(str) - ofs);
782 }
783 else {
784 ofs += BLI_strncpy_utf8_rlen(str + ofs, RPT_(", RGB float"), sizeof(str) - ofs);
785 }
786 }
787 else {
788 if (ibuf->planes == R_IMF_PLANES_RGBA) {
789 ofs += BLI_strncpy_utf8_rlen(str + ofs, RPT_(", RGBA byte"), sizeof(str) - ofs);
790 }
791 else {
792 ofs += BLI_strncpy_utf8_rlen(str + ofs, RPT_(", RGB byte"), sizeof(str) - ofs);
793 }
794 }
795
796 if (clip->anim != nullptr) {
797 float fps = MOV_get_fps(clip->anim);
798 if (fps > 0.0f) {
799 ofs += BLI_snprintf_utf8_rlen(str + ofs, sizeof(str) - ofs, RPT_(", %.2f fps"), fps);
800 }
801 }
802 }
803 else {
804 ofs += BLI_strncpy_utf8_rlen(str + ofs, RPT_(", failed to load"), sizeof(str) - ofs);
805 }
806 UNUSED_VARS(ofs);
807
808 col->label(str, ICON_NONE);
809
810 /* Display current frame number. */
811 int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
812 if (framenr <= clip->len) {
813 SNPRINTF_UTF8(str, RPT_("Frame: %d / %d"), framenr, clip->len);
814 }
815 else {
816 SNPRINTF_UTF8(str, RPT_("Frame: - / %d"), clip->len);
817 }
818 col->label(str, ICON_NONE);
819
820 /* Display current file name if it's a sequence clip. */
821 if (clip->source == MCLIP_SRC_SEQUENCE) {
822 char filepath[FILE_MAX];
823 const char *file;
824
825 if (framenr <= clip->len) {
826 BKE_movieclip_filepath_for_frame(clip, user, filepath);
827 file = BLI_path_basename(filepath);
828 }
829 else {
830 file = "-";
831 }
832
833 SNPRINTF(str, RPT_("File: %s"), file);
834
835 col->label(str, ICON_NONE);
836 }
837
838 IMB_freeImBuf(ibuf);
839}
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:1402
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1358
void BKE_tracking_marker_clamp_search_position(struct MovieTrackingMarker *marker)
Definition tracking.cc:1338
void BKE_tracking_marker_clamp_search_size(struct MovieTrackingMarker *marker)
Definition tracking.cc:1327
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:604
#define SNPRINTF_UTF8(dst, format,...)
char size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
size_t BLI_snprintf_utf8_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#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
@ TRACK_LOCKED
@ MARKER_DISABLED
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:4149
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:167
#define C
Definition RandGen.cpp:29
uiBut * uiDefButF(uiBlock *block, ButType 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)
#define UI_UNIT_Y
uiBut * uiDefIconButBitI(uiBlock *block, ButType 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_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)
uiBut * uiDefIconButI(uiBlock *block, ButType 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 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)
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_BUT_ICON_REVERSE
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 * uiDefButBitI(uiBlock *block, ButType 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)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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_block_align_end(uiBlock *block)
#define UI_ITEM_NONE
#define NC_MOVIECLIP
Definition WM_types.hh:397
#define NA_EDITED
Definition WM_types.hh:584
#define ND_SPACE_VIEW3D
Definition WM_types.hh:528
#define NC_SPACE
Definition WM_types.hh:392
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
#define printf(...)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
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
uiBlock * absolute_block()
uiBlock * block() const
uiLayout & column(bool align)
void active_set(bool active)
void context_ptr_set(blender::StringRef name, const PointerRNA *ptr)
uiLayout & row(bool align)
uiLayout & split(float percentage, bool align)
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
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:4238