Blender V4.3
space_sequencer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cmath>
10#include <cstdio>
11#include <cstring>
12
14#include "DNA_mask_types.h"
15#include "DNA_scene_types.h"
16
17#include "MEM_guardedalloc.h"
18
19#include "BLI_blenlib.h"
20#include "BLI_math_base.h"
21
22#include "BLF_api.hh"
23
24#include "BKE_global.hh"
25#include "BKE_lib_query.hh"
26#include "BKE_lib_remap.hh"
27#include "BKE_screen.hh"
29
30#include "GPU_state.hh"
31
32#include "ED_markers.hh"
33#include "ED_screen.hh"
34#include "ED_sequencer.hh"
35#include "ED_space_api.hh"
36#include "ED_time_scrub_ui.hh"
37#include "ED_transform.hh"
38#include "ED_view3d.hh"
39#include "ED_view3d_offscreen.hh" /* Only for sequencer view3d drawing callback. */
40
41#include "WM_api.hh"
42#include "WM_message.hh"
43
44#include "SEQ_retiming.hh"
45#include "SEQ_sequencer.hh"
46#include "SEQ_time.hh"
47#include "SEQ_transform.hh"
48#include "SEQ_utils.hh"
49
50#include "UI_interface.hh"
51#include "UI_view2d.hh"
52
53#include "BLO_read_write.hh"
54
55/* Only for cursor drawing. */
56#include "DRW_engine.hh"
57
58/* Own include. */
59#include "sequencer_intern.hh"
60
61/**************************** common state *****************************/
62
64{
65 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
66 sseq->runtime->scopes.reference_ibuf = nullptr;
67}
68
70
71/* ******************** manage regions ********************* */
72
73static ARegion *sequencer_find_region(ScrArea *area, short type)
74{
75
76 LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
77 if (region->regiontype == type) {
78 return region;
79 }
80 }
81 return nullptr;
82}
83
84/* ******************** default callbacks for sequencer space ***************** */
85
86static SpaceLink *sequencer_create(const ScrArea * /*area*/, const Scene *scene)
87{
88 ARegion *region;
89 SpaceSeq *sseq;
90
91 sseq = MEM_cnew<SpaceSeq>("initsequencer");
92 sseq->spacetype = SPACE_SEQ;
93 sseq->chanshown = 0;
94 sseq->view = SEQ_VIEW_SEQUENCE;
105
106 /* Header. */
107 region = MEM_cnew<ARegion>("header for sequencer");
108
109 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
110 region->regiontype = RGN_TYPE_HEADER;
111 region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
112
113 /* Tool header. */
114 region = MEM_cnew<ARegion>("tool header for sequencer");
115
116 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
117 region->regiontype = RGN_TYPE_TOOL_HEADER;
118 region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
120
121 /* Buttons/list view. */
122 region = MEM_cnew<ARegion>("buttons for sequencer");
123
124 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
125 region->regiontype = RGN_TYPE_UI;
126 region->alignment = RGN_ALIGN_RIGHT;
127 region->flag = RGN_FLAG_HIDDEN;
128
129 /* Toolbar. */
130 region = MEM_cnew<ARegion>("tools for sequencer");
131
132 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
133 region->regiontype = RGN_TYPE_TOOLS;
134 region->alignment = RGN_ALIGN_LEFT;
135
136 /* Channels. */
137 region = MEM_cnew<ARegion>("channels for sequencer");
138
139 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
140 region->regiontype = RGN_TYPE_CHANNELS;
141 region->alignment = RGN_ALIGN_LEFT;
142 region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
143
144 /* Preview region. */
145 /* NOTE: if you change values here, also change them in sequencer_init_preview_region. */
146 region = MEM_cnew<ARegion>("preview region for sequencer");
147 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
148 region->regiontype = RGN_TYPE_PREVIEW;
149 region->alignment = RGN_ALIGN_TOP;
150 /* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
151 region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
152 region->v2d.minzoom = 0.001f;
153 region->v2d.maxzoom = 1000.0f;
154 region->v2d.tot.xmin = -960.0f; /* 1920 width centered. */
155 region->v2d.tot.ymin = -540.0f; /* 1080 height centered. */
156 region->v2d.tot.xmax = 960.0f;
157 region->v2d.tot.ymax = 540.0f;
158 region->v2d.min[0] = 0.0f;
159 region->v2d.min[1] = 0.0f;
160 region->v2d.max[0] = 12000.0f;
161 region->v2d.max[1] = 12000.0f;
162 region->v2d.cur = region->v2d.tot;
163 region->v2d.align = V2D_ALIGN_FREE;
164 region->v2d.keeptot = V2D_KEEPTOT_FREE;
165
166 /* Main region. */
167 region = MEM_cnew<ARegion>("main region for sequencer");
168
169 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
170 region->regiontype = RGN_TYPE_WINDOW;
171
172 /* Seq space goes from (0,8) to (0, efra). */
173 region->v2d.tot.xmin = 0.0f;
174 region->v2d.tot.ymin = 0.0f;
175 region->v2d.tot.xmax = scene->r.efra;
176 region->v2d.tot.ymax = 8.5f;
177
178 region->v2d.cur = region->v2d.tot;
179
180 region->v2d.min[0] = 10.0f;
181 region->v2d.min[1] = 1.0f;
182
183 region->v2d.max[0] = MAXFRAMEF;
184 region->v2d.max[1] = SEQ_MAX_CHANNELS;
185
186 region->v2d.minzoom = 0.01f;
187 region->v2d.maxzoom = 100.0f;
188
189 region->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
190 region->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HANDLES);
191 region->v2d.keepzoom = 0;
192 region->v2d.keeptot = 0;
193 region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
194 region->v2d.align = V2D_ALIGN_NO_NEG_Y;
195
196 return (SpaceLink *)sseq;
197}
198
199/* Not spacelink itself. */
200static void sequencer_free(SpaceLink *sl)
201{
202 SpaceSeq *sseq = (SpaceSeq *)sl;
203 MEM_delete(sseq->runtime);
204
205#if 0
206 if (sseq->gpd) {
208 }
209#endif
210}
211
212/* Space-type init callback. */
213static void sequencer_init(wmWindowManager * /*wm*/, ScrArea *area)
214{
215 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
216 if (sseq->runtime == nullptr) {
217 sseq->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
218 }
219}
220
221static void sequencer_refresh(const bContext *C, ScrArea *area)
222{
224 wmWindow *window = CTX_wm_window(C);
225 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
226 ARegion *region_main = sequencer_find_region(area, RGN_TYPE_WINDOW);
227 ARegion *region_preview = sequencer_find_region(area, RGN_TYPE_PREVIEW);
228 bool view_changed = false;
229
230 switch (sseq->view) {
231 case SEQ_VIEW_PREVIEW:
232 /* Reset scrolling when preview region just appears. */
233 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
234 region_preview->v2d.cur = region_preview->v2d.tot;
235 /* Only redraw, don't re-init. */
236 ED_area_tag_redraw(area);
237 }
238 if (region_preview->alignment != RGN_ALIGN_NONE) {
239 region_preview->alignment = RGN_ALIGN_NONE;
240 view_changed = true;
241 }
242 break;
244 /* Get available height (without DPI correction). */
245 const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
246
247 /* We reuse hidden region's size, allows to find same layout as before if we just switch
248 * between one 'full window' view and the combined one. This gets lost if we switch to both
249 * 'full window' views before, though... Better than nothing. */
250 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
251 region_preview->v2d.cur = region_preview->v2d.tot;
252 region_main->sizey = int(height - region_preview->sizey);
253 region_preview->sizey = int(height - region_main->sizey);
254 view_changed = true;
255 }
256 if (region_preview->alignment != RGN_ALIGN_TOP) {
257 region_preview->alignment = RGN_ALIGN_TOP;
258 view_changed = true;
259 }
260 /* Final check that both preview and main height are reasonable. */
261 if (region_preview->sizey < 10 || region_main->sizey < 10 ||
262 region_preview->sizey + region_main->sizey > height)
263 {
264 region_preview->sizey = roundf(height * 0.4f);
265 region_main->sizey = int(height - region_preview->sizey);
266 view_changed = true;
267 }
268 break;
269 }
271 break;
272 }
273
274 if (view_changed) {
275 ED_area_init(wm, window, area);
276 ED_area_tag_redraw(area);
277 }
278}
279
281{
282 SpaceSeq *sseqn = static_cast<SpaceSeq *>(MEM_dupallocN(sl));
283 sseqn->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
284
285 /* Clear or remove stuff from old. */
286 // sseq->gpd = gpencil_data_duplicate(sseq->gpd, false);
287
288 return (SpaceLink *)sseqn;
289}
290
292{
293 ScrArea *area = params->area;
294 const wmNotifier *wmn = params->notifier;
295
296 /* Context changes. */
297 switch (wmn->category) {
298 case NC_SCENE:
299 switch (wmn->data) {
300 case ND_FRAME:
301 case ND_SEQUENCER:
303 break;
304 }
305 break;
306 case NC_WINDOW:
307 case NC_SPACE:
308 if (wmn->data == ND_SPACE_SEQUENCER) {
310 }
311 break;
312 case NC_GPENCIL:
313 if (wmn->data & ND_GPENCIL_EDITMODE) {
314 ED_area_tag_redraw(area);
315 }
316 break;
317 }
318}
319
320/* DO NOT make this static, this hides the symbol and breaks API generation script. */
321extern "C" const char *sequencer_context_dir[]; /* Quiet warning. */
322const char *sequencer_context_dir[] = {"edit_mask", nullptr};
323
324static int /*eContextResult*/ sequencer_context(const bContext *C,
325 const char *member,
326 bContextDataResult *result)
327{
328 Scene *scene = CTX_data_scene(C);
329
330 if (CTX_data_dir(member)) {
332
333 return CTX_RESULT_OK;
334 }
335 if (CTX_data_equals(member, "edit_mask")) {
336 Mask *mask = SEQ_active_mask_get(scene);
337 if (mask) {
338 CTX_data_id_pointer_set(result, &mask->id);
339 }
340 return CTX_RESULT_OK;
341 }
342
344}
345
347{
348 VIEW2D_GGT_navigate_impl(gzgt, "SEQUENCER_GGT_navigate");
349}
350
352{
353 gzgt->name = "Sequencer Transform Gizmo";
354 gzgt->idname = "SEQUENCER_GGT_gizmo2d";
355
358
361
363}
364
366{
367 gzgt->name = "Sequencer Translate Gizmo";
368 gzgt->idname = "SEQUENCER_GGT_gizmo2d_translate";
369
372
375
377}
378
380{
381 gzgt->name = "Sequencer Transform Gizmo Resize";
382 gzgt->idname = "SEQUENCER_GGT_gizmo2d_resize";
383
386
389
391}
392
394{
395 gzgt->name = "Sequencer Transform Gizmo Resize";
396 gzgt->idname = "SEQUENCER_GGT_gizmo2d_rotate";
397
400
403
405}
406
418
419/* *********************** sequencer (main) region ************************ */
420
422{
423 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
425}
426
427/* Add handlers, stuff you only do once or on area/region changes. */
429{
430 wmKeyMap *keymap;
431 ListBase *lb;
432
433 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
434
435#if 0
436 keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
437 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
438#endif
439
440 keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, RGN_TYPE_WINDOW);
441 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
442
443 /* Own keymap. */
444 keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
445 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
446
447 /* Add drop boxes. */
448 lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
449
450 WM_event_add_dropbox_handler(&region->handlers, lb);
451}
452
453/* Strip editing timeline. */
454static void sequencer_main_region_draw(const bContext *C, ARegion *region)
455{
456 draw_timeline_seq(C, region);
457}
458
459/* Strip editing timeline. */
461{
462 draw_timeline_seq_display(C, region);
463}
464
465static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
466{
467 SpaceSeq *sseq = CTX_wm_space_seq(C);
468
469 if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
470 return;
471 }
472
473 View2D *v2d = &region->v2d;
474 Scene *scene = CTX_data_scene(C);
475
476 /* Transformation uses edge panning to move view. Also if smooth view is running, don't apply
477 * clamping to prevent overriding this functionality. */
478 if (G.moving || v2d->smooth_timer != nullptr) {
479 return;
480 }
481
482 rctf strip_boundbox;
483 /* Initialize default view with 7 channels, that are visible even if empty. */
484 SEQ_timeline_init_boundbox(scene, &strip_boundbox);
485 Editing *ed = SEQ_editing_get(scene);
486 if (ed != nullptr) {
487 SEQ_timeline_expand_boundbox(scene, ed->seqbasep, &strip_boundbox);
488 }
489 /* We need to calculate how much the current view is padded and add this padding to our
490 * strip bounding box. Without this, the scrub-bar or other overlays would occlude the
491 * displayed strips in the timeline.
492 */
493 float pad_top, pad_bottom;
494 SEQ_get_timeline_region_padding(C, &pad_top, &pad_bottom);
495 const float pixel_view_size_y = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
496 /* Add padding to be able to scroll the view so that the collapsed redo panel doesn't occlude any
497 * strips. */
498 float bottom_channel_padding = UI_MARKER_MARGIN_Y * pixel_view_size_y;
499 if (bottom_channel_padding < 1.0f) {
500 /* Make sure that we can always scroll off at least by one channel. */
501 bottom_channel_padding = 1.0f;
502 }
503 /* Add the padding and make sure we have a margin of one channel in each direction.*/
504 strip_boundbox.ymax += 1.0f + pad_top * pixel_view_size_y;
505 strip_boundbox.ymin -= bottom_channel_padding;
506
507 /* If a strip has been deleted, don't move the view automatically, keep current range until it is
508 * changed. */
509 strip_boundbox.ymax = max_ff(sseq->runtime->timeline_clamp_custom_range, strip_boundbox.ymax);
510
511 rctf view_clamped = v2d->cur;
512 float range_y = BLI_rctf_size_y(&view_clamped);
513 if (view_clamped.ymax > strip_boundbox.ymax) {
514 view_clamped.ymax = strip_boundbox.ymax;
515 view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
516 }
517 else if (view_clamped.ymin < strip_boundbox.ymin) {
518 view_clamped.ymin = strip_boundbox.ymin;
519 view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
520 }
521
522 v2d->cur = view_clamped;
523}
524
526{
527 SpaceSeq *sseq = CTX_wm_space_seq(C);
528 View2D *v2d = &region->v2d;
529
530 if ((v2d->flag & V2D_IS_NAVIGATING) == 0) {
532 }
533}
534
535static void sequencer_main_region_layout(const bContext *C, ARegion *region)
536{
538 sequencer_main_clamp_view(C, region);
539}
540
546
548{
549 ARegion *region = params->region;
550 const wmNotifier *wmn = params->notifier;
551
552 /* Context changes. */
553 switch (wmn->category) {
554 case NC_SCENE:
555 switch (wmn->data) {
556 case ND_FRAME:
557 case ND_FRAME_RANGE:
558 case ND_MARKERS:
559 case ND_RENDER_OPTIONS: /* For FPS and FPS Base. */
560 case ND_SEQUENCER:
561 case ND_RENDER_RESULT:
562 ED_region_tag_redraw(region);
563 WM_gizmomap_tag_refresh(region->gizmo_map);
564 break;
565 }
566 break;
567 case NC_ANIMATION:
568 switch (wmn->data) {
569 case ND_KEYFRAME:
570 ED_region_tag_redraw(region);
571 break;
572 }
573 break;
574 case NC_SPACE:
575 if (wmn->data == ND_SPACE_SEQUENCER) {
576 ED_region_tag_redraw(region);
577 WM_gizmomap_tag_refresh(region->gizmo_map);
578 }
579 break;
580 case NC_ID:
581 if (wmn->action == NA_RENAME) {
582 ED_region_tag_redraw(region);
583 }
584 break;
585 case NC_SCREEN:
586 if (ELEM(wmn->data, ND_ANIMPLAY)) {
587 ED_region_tag_redraw(region);
588 WM_gizmomap_tag_refresh(region->gizmo_map);
589 }
590 break;
591 }
592}
593
595{
596 wmMsgBus *mbus = params->message_bus;
597 Scene *scene = params->scene;
598 ARegion *region = params->region;
599
600 wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
601 msg_sub_value_region_tag_redraw.owner = region;
602 msg_sub_value_region_tag_redraw.user_data = region;
603 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
604
605 /* Timeline depends on scene properties. */
606 {
607 bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
608 const PropertyRNA *props[] = {
609 use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
610 use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
611 &rna_Scene_use_preview_range,
612 &rna_Scene_frame_current,
613 };
614
615 PointerRNA idptr = RNA_id_pointer_create(&scene->id);
616
617 for (int i = 0; i < ARRAY_SIZE(props); i++) {
618 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
619 }
620 }
621
622 {
623 StructRNA *type_array[] = {
624 &RNA_SequenceEditor,
625
626 &RNA_Sequence,
627 /* Members of 'Sequence'. */
628 &RNA_SequenceCrop,
629 &RNA_SequenceTransform,
630 &RNA_SequenceModifier,
631 &RNA_SequenceColorBalanceData,
632 };
633 wmMsgParams_RNA msg_key_params = {{nullptr}};
634 for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
635 msg_key_params.ptr.type = type_array[i];
637 mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
638 }
639 }
640}
641
642static bool is_mouse_over_retiming_key(const Scene *scene,
643 const Sequence *seq,
644 const View2D *v2d,
645 const ScrArea *area,
646 float mouse_co_region[2])
647{
648 const SpaceSeq *sseq = static_cast<SpaceSeq *>(area->spacedata.first);
649
651 return false;
652 }
653
654 rctf retiming_keys_box = seq_retiming_keys_box_get(scene, v2d, seq);
655 return BLI_rctf_isect_pt_v(&retiming_keys_box, mouse_co_region);
656}
657
658static void sequencer_main_cursor(wmWindow *win, ScrArea *area, ARegion *region)
659{
660 int wmcursor = WM_CURSOR_DEFAULT;
661
662 const bToolRef *tref = area->runtime.tool;
663 if (!STRPREFIX(tref->idname, "builtin.select")) {
664 WM_cursor_set(win, wmcursor);
665 return;
666 }
667
668 rcti scrub_rect = region->winrct;
669 scrub_rect.ymin = scrub_rect.ymax - UI_TIME_SCRUB_MARGIN_Y;
670 if (BLI_rcti_isect_pt_v(&scrub_rect, win->eventstate->xy)) {
671 WM_cursor_set(win, wmcursor);
672 return;
673 }
674
675 if ((U.sequencer_editor_flag & USER_SEQ_ED_SIMPLE_TWEAKING) == 0) {
676 WM_cursor_set(win, wmcursor);
677 return;
678 }
679
680 float mouse_co_region[2] = {float(win->eventstate->xy[0] - region->winrct.xmin),
681 float(win->eventstate->xy[1] - region->winrct.ymin)};
682 float mouse_co_view[2];
684 &region->v2d, mouse_co_region[0], mouse_co_region[1], &mouse_co_view[0], &mouse_co_view[1]);
685
686 const Scene *scene = win->scene;
687 const Editing *ed = SEQ_editing_get(scene);
688
689 if (ed == nullptr) {
690 WM_cursor_set(win, wmcursor);
691 return;
692 }
693
695 scene, &region->v2d, mouse_co_view);
696
697 if (selection.seq1 == nullptr) {
698 WM_cursor_set(win, wmcursor);
699 return;
700 }
701
702 if (is_mouse_over_retiming_key(scene, selection.seq1, &region->v2d, area, mouse_co_region)) {
703 WM_cursor_set(win, wmcursor);
704 return;
705 }
706
707 const View2D *v2d = &region->v2d;
708 const float scale_y = UI_view2d_scale_get_y(v2d);
709
710 if (!ED_sequencer_can_select_handle(scene, selection.seq1, v2d) || scale_y < 16 * U.pixelsize) {
711 WM_cursor_set(win, wmcursor);
712 return;
713 }
714
715 if (selection.seq1 != nullptr && selection.seq2 != nullptr) {
716 wmcursor = WM_CURSOR_BOTH_HANDLES;
717 }
718 else if (selection.handle == SEQ_HANDLE_LEFT) {
719 wmcursor = WM_CURSOR_LEFT_HANDLE;
720 }
721 else if (selection.handle == SEQ_HANDLE_RIGHT) {
722 wmcursor = WM_CURSOR_RIGHT_HANDLE;
723 }
724
725 WM_cursor_set(win, wmcursor);
726}
727
728/* *********************** header region ************************ */
729/* Add handlers, stuff you only do once or on area/region changes. */
731{
732 ED_region_header_init(region);
733}
734
735static void sequencer_header_region_draw(const bContext *C, ARegion *region)
736{
737 ED_region_header(C, region);
738}
739
740/* *********************** toolbar region ************************ */
741/* Add handlers, stuff you only do once or on area/region changes. */
743{
744 wmKeyMap *keymap;
745
746 region->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
747 ED_region_panels_init(wm, region);
748
749 keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, RGN_TYPE_WINDOW);
750 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
751}
752
753static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
754{
755 ScrArea *area = CTX_wm_area(C);
757
758 LISTBASE_FOREACH (ARegion *, ar, &area->regionbase) {
759 if (ar->regiontype == RGN_TYPE_PREVIEW && region->regiontype == RGN_TYPE_TOOLS) {
760 op_context = WM_OP_INVOKE_REGION_PREVIEW;
761 break;
762 }
763 }
764
765 if (region->regiontype == RGN_TYPE_CHANNELS) {
766 op_context = WM_OP_INVOKE_REGION_CHANNELS;
767 }
768
769 ED_region_panels_ex(C, region, op_context, nullptr);
770}
771/* *********************** preview region ************************ */
772
774{
775 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
777}
778
780{
781 wmKeyMap *keymap;
782
783 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
784
785#if 0
786 keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
787 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
788#endif
789
790 keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, RGN_TYPE_WINDOW);
791 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
792
793 /* Own keymap. */
794 keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, RGN_TYPE_WINDOW);
795 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
796
798 WM_event_add_dropbox_handler(&region->handlers, lb);
799}
800
802{
803 SpaceSeq *sseq = CTX_wm_space_seq(C);
804
805 if (sseq->flag & SEQ_ZOOM_TO_FIT) {
806 View2D *v2d = &region->v2d;
807 v2d->cur = v2d->tot;
808 }
809}
810
812{
813 SpaceSeq *sseq = CTX_wm_space_seq(C);
814 sseq->flag &= ~SEQ_ZOOM_TO_FIT;
815}
816
817static bool is_cursor_visible(const SpaceSeq *sseq)
818{
819 if (G.moving & G_TRANSFORM_CURSOR) {
820 return true;
821 }
822
823 if ((sseq->flag & SEQ_SHOW_OVERLAY) &&
825 {
826 return true;
827 }
828 return false;
829}
830
831static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
832{
833 ScrArea *area = CTX_wm_area(C);
834 SpaceSeq *sseq = static_cast<SpaceSeq *>(area->spacedata.first);
835 Scene *scene = CTX_data_scene(C);
837 const bool draw_overlay = sseq->flag & SEQ_SHOW_OVERLAY;
838 const bool draw_frame_overlay = (scene->ed &&
839 (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_SHOW) &&
840 draw_overlay);
841 const bool is_playing = ED_screen_animation_playing(wm);
842
843 if (!(draw_frame_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) {
844 sequencer_draw_preview(C, scene, region, sseq, scene->r.cfra, 0, false, false);
845 }
846
847 if (draw_frame_overlay && sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_CURRENT) {
848 int over_cfra;
849
850 if (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) {
851 over_cfra = scene->ed->overlay_frame_abs;
852 }
853 else {
854 over_cfra = scene->r.cfra + scene->ed->overlay_frame_ofs;
855 }
856
857 if ((over_cfra != scene->r.cfra) || (sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_RECT))
858 {
860 C, scene, region, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false);
861 }
862 }
863
864 /* No need to show the cursor for scopes. */
865 if ((is_playing == false) && (sseq->mainb == SEQ_DRAW_IMG_IMBUF) && is_cursor_visible(sseq)) {
866 GPU_color_mask(true, true, true, true);
867 GPU_depth_mask(false);
869
870 float cursor_pixel[2];
871 SEQ_image_preview_unit_to_px(scene, sseq->cursor, cursor_pixel);
872
873 DRW_draw_cursor_2d_ex(region, cursor_pixel);
874 }
875
876 if ((is_playing == false) && (sseq->gizmo_flag & SEQ_GIZMO_HIDE) == 0) {
877 WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D);
878 }
879
880 if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) {
881 const rcti *rect = ED_region_visible_rect(region);
882 int xoffset = rect->xmin + U.widget_unit;
883 int yoffset = rect->ymax;
884
885 /* #ED_scene_draw_fps does not set text/shadow colors, except when
886 * frame-rate is too low, then it sets text color to red.
887 * Make sure the "normal case" also has legible colors. */
888 const int font_id = BLF_default();
889 float text_color[4] = {1, 1, 1, 1}, shadow_color[4] = {0, 0, 0, 0.8f};
890 BLF_color4fv(font_id, text_color);
891 BLF_enable(font_id, BLF_SHADOW);
892 BLF_shadow_offset(font_id, 0, 0);
893 BLF_shadow(font_id, FontShadowType::Outline, shadow_color);
894
895 ED_scene_draw_fps(scene, xoffset, &yoffset);
896
897 BLF_disable(font_id, BLF_SHADOW);
898 }
899}
900
902{
903 ARegion *region = params->region;
904 const wmNotifier *wmn = params->notifier;
905
906 WM_gizmomap_tag_refresh(region->gizmo_map);
907
908 /* Context changes. */
909 switch (wmn->category) {
910 case NC_GPENCIL:
911 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
912 ED_region_tag_redraw(region);
913 }
914 break;
915 case NC_SCENE:
916 switch (wmn->data) {
917 case ND_FRAME:
918 case ND_MARKERS:
919 case ND_SEQUENCER:
922 ED_region_tag_redraw(region);
923 break;
924 }
925 break;
926 case NC_ANIMATION:
927 switch (wmn->data) {
928 case ND_KEYFRAME:
929 ED_region_tag_redraw(region);
930 break;
931 }
932 break;
933 case NC_SPACE:
934 if (wmn->data == ND_SPACE_SEQUENCER) {
935 ED_region_tag_redraw(region);
936 }
937 break;
938 case NC_ID:
939 switch (wmn->data) {
940 case NA_RENAME:
941 ED_region_tag_redraw(region);
942 break;
943 }
944 break;
945 case NC_MASK:
946 if (wmn->action == NA_EDITED) {
947 ED_region_tag_redraw(region);
948 }
949 break;
950 }
951}
952
953/* *********************** buttons region ************************ */
954
955/* Add handlers, stuff you only do once or on area/region changes. */
957{
958 wmKeyMap *keymap;
959
960 keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, RGN_TYPE_WINDOW);
961 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
962
964 ED_region_panels_init(wm, region);
965}
966
967static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
968{
969 ED_region_panels(C, region);
970}
971
973{
974 ARegion *region = params->region;
975 const wmNotifier *wmn = params->notifier;
976
977 /* Context changes. */
978 switch (wmn->category) {
979 case NC_GPENCIL:
980 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
981 ED_region_tag_redraw(region);
982 }
983 break;
984 case NC_SCENE:
985 switch (wmn->data) {
986 case ND_FRAME:
987 case ND_SEQUENCER:
988 ED_region_tag_redraw(region);
989 break;
990 }
991 break;
992 case NC_SPACE:
993 if (wmn->data == ND_SPACE_SEQUENCER) {
994 ED_region_tag_redraw(region);
995 }
996 break;
997 case NC_ID:
998 if (wmn->action == NA_RENAME) {
999 ED_region_tag_redraw(region);
1000 }
1001 break;
1002 }
1003}
1004
1005static void sequencer_id_remap(ScrArea * /*area*/,
1006 SpaceLink *slink,
1007 const blender::bke::id::IDRemapper &mappings)
1008{
1009 SpaceSeq *sseq = (SpaceSeq *)slink;
1010 mappings.apply(reinterpret_cast<ID **>(&sseq->gpd), ID_REMAP_APPLY_DEFAULT);
1011}
1012
1014{
1015 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(space_link);
1017}
1018
1019/* ************************************* */
1020
1022{
1023 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
1024 return ELEM(sseq->view, SEQ_VIEW_SEQUENCE);
1025}
1026
1027/* add handlers, stuff you only do once or on area/region changes */
1029{
1030 wmKeyMap *keymap;
1031
1032 region->alignment = RGN_ALIGN_LEFT;
1033
1034 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
1035
1036 keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer Channels", SPACE_SEQ, RGN_TYPE_WINDOW);
1037 WM_event_add_keymap_handler_v2d_mask(&region->handlers, keymap);
1038}
1039
1040static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
1041{
1042 draw_channels(C, region);
1043}
1044
1046{
1047 SpaceSeq *sseq = (SpaceSeq *)sl;
1048
1049 sseq->runtime = nullptr;
1050
1051 /* grease pencil data is not a direct data and can't be linked from direct_link*
1052 * functions, it should be linked from lib_link* functions instead
1053 *
1054 * otherwise it'll lead to lost grease data on open because it'll likely be
1055 * read from file after all other users of grease pencil and newdataadr would
1056 * simple return nullptr here (sergey)
1057 */
1058#if 0
1059 if (sseq->gpd) {
1060 sseq->gpd = newdataadr(fd, sseq->gpd);
1062 }
1063#endif
1064}
1065
1067{
1068 BLO_write_struct(writer, SpaceSeq, sl);
1069}
1070
1072{
1073 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1074 ARegionType *art;
1075
1076 st->spaceid = SPACE_SEQ;
1077 STRNCPY(st->name, "Sequencer");
1078
1079 st->create = sequencer_create;
1080 st->free = sequencer_free;
1081 st->init = sequencer_init;
1082 st->duplicate = sequencer_duplicate;
1083 st->operatortypes = sequencer_operatortypes;
1084 st->keymap = sequencer_keymap;
1085 st->context = sequencer_context;
1086 st->gizmos = sequencer_gizmos;
1087 st->dropboxes = sequencer_dropboxes;
1088 st->refresh = sequencer_refresh;
1089 st->listener = sequencer_listener;
1090 st->id_remap = sequencer_id_remap;
1091 st->foreach_id = sequencer_foreach_id;
1092 st->blend_read_data = sequencer_space_blend_read_data;
1093 st->blend_read_after_liblink = nullptr;
1094 st->blend_write = sequencer_space_blend_write;
1095
1096 /* Create regions: */
1097 /* Main window. */
1098 art = MEM_cnew<ARegionType>("spacetype sequencer region");
1111 art->event_cursor = true;
1112 art->clip_gizmo_events_by_ui = true;
1113 BLI_addhead(&st->regiontypes, art);
1114
1115 /* Preview. */
1116 art = MEM_cnew<ARegionType>("spacetype sequencer region");
1126 BLI_addhead(&st->regiontypes, art);
1127
1128 /* List-view/buttons. */
1129 art = MEM_cnew<ARegionType>("spacetype sequencer region");
1130 art->regionid = RGN_TYPE_UI;
1131 art->prefsizex = UI_SIDEBAR_PANEL_WIDTH * 1.3f;
1137 BLI_addhead(&st->regiontypes, art);
1138
1140 /* Toolbar. */
1141 art = MEM_cnew<ARegionType>("spacetype sequencer tools region");
1142 art->regionid = RGN_TYPE_TOOLS;
1144 art->prefsizey = 50; /* XXX */
1151 BLI_addhead(&st->regiontypes, art);
1152
1153 /* Channels. */
1154 art = MEM_cnew<ARegionType>("spacetype sequencer channels");
1157 art->keymapflag = ED_KEYMAP_UI;
1162 BLI_addhead(&st->regiontypes, art);
1163
1164 /* Tool header. */
1165 art = MEM_cnew<ARegionType>("spacetype sequencer tool header region");
1167 art->prefsizey = HEADERY;
1173 BLI_addhead(&st->regiontypes, art);
1174
1175 /* Header. */
1176 art = MEM_cnew<ARegionType>("spacetype sequencer region");
1178 art->prefsizey = HEADERY;
1180
1184 BLI_addhead(&st->regiontypes, art);
1185
1186 /* HUD. */
1187 art = ED_area_type_hud(st->spaceid);
1188 BLI_addhead(&st->regiontypes, art);
1189
1190 BKE_spacetype_register(std::move(st));
1191
1192 /* Set the sequencer callback when not in background mode. */
1193 if (G.background == 0) {
1194 sequencer_view3d_fn = reinterpret_cast<SequencerDrawView>(
1196 }
1197}
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
bool CTX_data_equals(const char *member, const char *str)
bool CTX_data_dir(const char *member)
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
@ CTX_RESULT_MEMBER_NOT_FOUND
@ CTX_RESULT_OK
Scene * CTX_data_scene(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
@ G_TRANSFORM_CURSOR
void BKE_gpencil_free_data(struct bGPdata *gpd, bool free_all)
void BKE_gpencil_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
@ IDWALK_CB_USER
@ IDWALK_CB_DIRECT_WEAK_LINK
@ ID_REMAP_APPLY_DEFAULT
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:268
SequencerDrawView sequencer_view3d_fn
Definition render.cc:87
struct ImBuf *(* SequencerDrawView)(struct Depsgraph *depsgraph, struct Scene *scene, struct View3DShading *shading_override, eDrawType drawtype, struct Object *camera, int width, int height, enum eImBufFlags flag, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, struct GPUOffScreen *ofs, struct GPUViewport *viewport, char err_out[256])
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
Definition blf.cc:902
void BLF_color4fv(int fontid, const float rgba[4])
Definition blf.cc:488
void BLF_shadow_offset(int fontid, int x, int y)
Definition blf.cc:914
void BLF_disable(int fontid, int option)
Definition blf.cc:321
int BLF_default()
void BLF_enable(int fontid, int option)
Definition blf.cc:312
@ BLF_SHADOW
Definition BLF_api.hh:363
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:90
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:193
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:201
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define STRPREFIX(a, b)
#define ARRAY_SIZE(arr)
#define ELEM(...)
#define BLO_write_struct(writer, struct_name, data_ptr)
@ SCER_PRV_RANGE
#define MAXFRAMEF
#define HEADERY
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_ALIGN_NONE
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ SEQ_EDIT_OVERLAY_FRAME_ABS
@ SEQ_EDIT_OVERLAY_FRAME_SHOW
@ SPACE_SEQ
@ SPACE_EMPTY
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_RETIMING
@ SEQ_TIMELINE_WAVEFORMS_HALF
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_SEQUENCE
@ SEQ_VIEW_PREVIEW
@ SEQ_PREVIEW_SHOW_GPENCIL
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_2D_CURSOR
@ SEQ_DRAW_TRANSFORM_PREVIEW
@ SEQ_OVERLAY_FRAME_TYPE_RECT
@ SEQ_OVERLAY_FRAME_TYPE_CURRENT
@ SEQ_OVERLAY_FRAME_TYPE_REFERENCE
@ SEQ_CACHE_SHOW
@ SEQ_CACHE_SHOW_FINAL_OUT
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_SHOW_MARKERS
@ SEQ_USE_ALPHA
@ SEQ_ZOOM_TO_FIT
@ SEQ_CLAMP_VIEW
@ SEQ_SHOW_OVERLAY
@ SEQ_GIZMO_HIDE
@ USER_SHOW_FPS
@ USER_HEADER_BOTTOM
#define UI_SCALE_FAC
@ USER_SEQ_ED_SIMPLE_TWEAKING
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_FREE
@ V2D_IS_NAVIGATING
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_KEEPTOT_FREE
@ V2D_LIMITZOOM
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
void DRW_draw_cursor_2d_ex(const ARegion *region, const float cursor[2])
void ED_area_do_mgs_subscribe_for_tool_header(const wmRegionMessageSubscribeParams *params)
Definition area.cc:414
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:708
ARegionType * ED_area_type_hud(int space_type)
void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams *params)
Definition area.cc:429
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3336
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3646
const rcti * ED_region_visible_rect(ARegion *region)
Definition area.cc:4010
void ED_region_header_init(ARegion *region)
Definition area.cc:3661
bScreen * ED_screen_animation_no_scrub(const wmWindowManager *wm)
int ED_area_headersize()
Definition area.cc:3666
int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:41
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_region_generic_tools_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition area_utils.cc:29
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:3343
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:634
@ ED_KEYMAP_UI
Definition ED_screen.hh:725
@ ED_KEYMAP_ANIMATION
Definition ED_screen.hh:729
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:731
@ ED_KEYMAP_TOOL
Definition ED_screen.hh:727
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:733
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:726
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:728
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:730
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:381
void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area)
Definition area.cc:2036
void ED_region_panels_ex(const bContext *C, ARegion *region, wmOperatorCallContext op_context, const char *contexts[])
Definition area.cc:3326
StripSelection ED_sequencer_pick_strip_and_handle(const struct Scene *scene, const View2D *v2d, float mouse_co[2])
bool ED_sequencer_can_select_handle(const Scene *scene, const Sequence *seq, const View2D *v2d)
@ SEQ_HANDLE_LEFT
@ SEQ_HANDLE_RIGHT
void ED_spacetype_sequencer()
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt)
void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
ImBuf * ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, eImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
void GPU_depth_mask(bool depth)
Definition gpu_state.cc:110
void GPU_color_mask(bool r, bool g, bool b, bool a)
Definition gpu_state.cc:98
@ GPU_DEPTH_NONE
Definition GPU_state.hh:108
void GPU_depth_test(eGPUDepthTest test)
Definition gpu_state.cc:68
Read Guarded memory(de)allocation.
constexpr int SEQ_MAX_CHANNELS
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_TOOLBAR_WIDTH
#define UI_COMPACT_PANEL_WIDTH
void UI_panel_category_active_set_default(ARegion *region, const char *idname)
#define UI_MARKER_MARGIN_Y
Definition UI_view2d.hh:471
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:212
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:472
float UI_view2d_scale_get_y(const View2D *v2d)
Definition view2d.cc:1920
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
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:35
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:31
@ WM_GIZMOMAP_DRAWSTEP_2D
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
#define ND_SEQUENCER
Definition WM_types.hh:404
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:501
#define NC_WINDOW
Definition WM_types.hh:342
#define NC_ID
Definition WM_types.hh:362
#define ND_RENDER_RESULT
Definition WM_types.hh:413
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:470
#define ND_RENDER_OPTIONS
Definition WM_types.hh:402
#define NC_ANIMATION
Definition WM_types.hh:355
#define NC_SCREEN
Definition WM_types.hh:344
#define ND_ANIMPLAY
Definition WM_types.hh:391
#define NC_SCENE
Definition WM_types.hh:345
#define NA_EDITED
Definition WM_types.hh:550
#define ND_FRAME_RANGE
Definition WM_types.hh:418
#define ND_MARKERS
Definition WM_types.hh:400
#define ND_FRAME
Definition WM_types.hh:401
#define NC_GPENCIL
Definition WM_types.hh:366
wmOperatorCallContext
Definition WM_types.hh:216
@ WM_OP_INVOKE_REGION_WIN
Definition WM_types.hh:219
@ WM_OP_INVOKE_REGION_PREVIEW
Definition WM_types.hh:221
@ WM_OP_INVOKE_REGION_CHANNELS
Definition WM_types.hh:220
#define NC_MASK
Definition WM_types.hh:365
#define NA_RENAME
Definition WM_types.hh:554
#define ND_KEYFRAME
Definition WM_types.hh:461
#define NC_SPACE
Definition WM_types.hh:359
#define NA_SELECTED
Definition WM_types.hh:555
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:437
unsigned int U
Definition btGjkEpa3.h:78
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
static bool is_cursor_visible(const DRWContextState *draw_ctx, Scene *scene, ViewLayer *view_layer)
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
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_dupallocN)(const void *vmemh)
Definition mallocn.cc:39
#define G(x, y, z)
static void * newdataadr(FileData *fd, const void *adr)
Definition readfile.cc:1467
PointerRNA RNA_id_pointer_create(ID *id)
Mask * SEQ_active_mask_get(Scene *scene)
Editing * SEQ_editing_get(const Scene *scene)
Definition sequencer.cc:262
void sequencer_buttons_register(ARegionType *art)
void draw_channels(const bContext *C, ARegion *region)
void sequencer_dropboxes()
void SEQ_get_timeline_region_padding(const bContext *C, float *r_pad_top, float *r_pad_bottom)
void draw_timeline_seq_display(const bContext *C, ARegion *region)
void sequencer_draw_preview(const bContext *C, Scene *scene, ARegion *region, SpaceSeq *sseq, int timeline_frame, int offset, bool draw_overlay, bool draw_backdrop)
void sequencer_keymap(wmKeyConfig *keyconf)
void draw_timeline_seq(const bContext *C, ARegion *region)
bool retiming_keys_can_be_displayed(const SpaceSeq *sseq)
rctf seq_retiming_keys_box_get(const Scene *scene, const View2D *v2d, const Sequence *seq)
void sequencer_operatortypes()
static void sequencer_main_region_view2d_changed(const bContext *C, ARegion *region)
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
static bool is_mouse_over_retiming_key(const Scene *scene, const Sequence *seq, const View2D *v2d, const ScrArea *area, float mouse_co_region[2])
static void SEQUENCER_GGT_gizmo2d(wmGizmoGroupType *gzgt)
static void sequencer_preview_region_listener(const wmRegionListenerParams *params)
static SpaceLink * sequencer_duplicate(SpaceLink *sl)
static bool sequencer_channel_region_poll(const RegionPollParams *params)
static void SEQUENCER_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
static void sequencer_listener(const wmSpaceTypeListenerParams *params)
static void sequencer_main_region_layout(const bContext *C, ARegion *region)
static void sequencer_id_remap(ScrArea *, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
const char * sequencer_context_dir[]
static SpaceLink * sequencer_create(const ScrArea *, const Scene *scene)
static bool sequencer_preview_region_poll(const RegionPollParams *params)
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
static void sequencer_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void sequencer_init(wmWindowManager *, ScrArea *area)
static void sequencer_main_region_listener(const wmRegionListenerParams *params)
static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
static void sequencer_header_region_draw(const bContext *C, ARegion *region)
static void sequencer_preview_region_view2d_changed(const bContext *C, ARegion *)
static void sequencer_main_region_draw_overlay(const bContext *C, ARegion *region)
static void sequencer_free(SpaceLink *sl)
static void sequencer_buttons_region_listener(const wmRegionListenerParams *params)
static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
static ARegion * sequencer_find_region(ScrArea *area, short type)
static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
static void SEQUENCER_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
static void sequencer_main_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
static void sequencer_scopes_tag_refresh(ScrArea *area)
static void sequencer_space_blend_write(BlendWriter *writer, SpaceLink *sl)
static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void sequencer_gizmos()
static void sequencer_refresh(const bContext *C, ScrArea *area)
static void sequencer_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
static int sequencer_context(const bContext *C, const char *member, bContextDataResult *result)
static void SEQUENCER_GGT_navigate(wmGizmoGroupType *gzgt)
static bool sequencer_main_region_poll(const RegionPollParams *params)
static void sequencer_header_region_init(wmWindowManager *, ARegion *region)
static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *region)
static void sequencer_main_region_clamp_custom_set(const bContext *C, ARegion *region)
static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
static void sequencer_main_cursor(wmWindow *win, ScrArea *area, ARegion *region)
static void sequencer_tools_region_init(wmWindowManager *wm, ARegion *region)
bool SEQ_retiming_data_is_editable(const Sequence *seq)
void SEQ_timeline_expand_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
void SEQ_timeline_init_boundbox(const Scene *scene, rctf *r_rect)
void SEQ_image_preview_unit_to_px(const Scene *scene, const float co_src[2], float co_dst[2])
bool(* poll)(const RegionPollParams *params)
bool clip_gizmo_events_by_ui
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
void(* cursor)(wmWindow *win, ScrArea *area, ARegion *region)
void(* listener)(const wmRegionListenerParams *params)
void(* on_view2d_changed)(const bContext *C, ARegion *region)
void(* draw)(const bContext *C, ARegion *region)
void(* layout)(const bContext *C, ARegion *region)
short event_cursor
void(* draw_overlay)(const bContext *C, ARegion *region)
int(* snap_size)(const ARegion *region, int size, int axis)
void(* init)(wmWindowManager *wm, ARegion *region)
ListBase * seqbasep
Definition DNA_ID.h:413
StructRNA * type
Definition RNA_types.hh:41
char overlay_frame_type
float cursor[2]
struct bGPdata * gpd
struct SequencerCacheOverlay cache_overlay
struct SequencerTimelineOverlay timeline_overlay
ListBase regionbase
SpaceSeq_Runtime * runtime
struct SequencerPreviewOverlay preview_overlay
struct wmTimer * smooth_timer
bToolRef_Runtime * runtime
float ymax
float ymin
int ymin
int ymax
int xmin
int xy[2]
Definition WM_types.hh:726
const char * idname
wmGizmoMapType_Params gzmap_params
eWM_GizmoFlagGroupTypeFlag flag
unsigned int data
Definition WM_types.hh:325
unsigned int action
Definition WM_types.hh:325
unsigned int category
Definition WM_types.hh:325
struct wmKeyConfig * defaultconf
struct wmEvent * eventstate
struct Scene * scene
void WM_cursor_set(wmWindow *win, int curs)
@ WM_CURSOR_DEFAULT
Definition wm_cursors.hh:15
@ WM_CURSOR_RIGHT_HANDLE
Definition wm_cursors.hh:64
@ WM_CURSOR_BOTH_HANDLES
Definition wm_cursors.hh:65
@ WM_CURSOR_LEFT_HANDLE
Definition wm_cursors.hh:63
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(wmGizmoGroupType *))
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(wmGizmoGroupType *))
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:897
void WM_msg_subscribe_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)