Blender V5.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
8
9#include <algorithm>
10#include <cmath>
11#include <cstring>
12
14#include "DNA_mask_types.h"
15#include "DNA_scene_types.h"
16
17#include "BLI_listbase.hh"
18#include "BLI_math_base_c.hh"
19#include "BLI_rect.hh"
20#include "BLI_string_utf8.hh"
21
22#include "BKE_global.hh"
23#include "BKE_layer.hh"
24#include "BKE_lib_query.hh"
25#include "BKE_lib_remap.hh"
26#include "BKE_main.hh"
27#include "BKE_screen.hh"
28
29#include "ED_screen.hh"
30#include "ED_sequencer.hh"
31#include "ED_space_api.hh"
32#include "ED_transform.hh"
33#include "ED_util.hh"
35
36#include "WM_api.hh"
37#include "WM_message.hh"
38
39#include "SEQ_channels.hh"
40#include "SEQ_offscreen.hh"
41#include "SEQ_preview_cache.hh"
42#include "SEQ_retiming.hh"
43#include "SEQ_sequencer.hh"
45#include "SEQ_time.hh"
46#include "SEQ_transform.hh"
47#include "SEQ_utils.hh"
48
49#include "UI_interface.hh"
50#include "UI_view2d.hh"
51
52#include "BLO_read_write.hh"
53
54#include "sequencer_intern.hh"
55
56namespace blender::ed::vse {
57
58/**************************** common state *****************************/
59
60static void sequencer_scopes_tag_refresh(ScrArea *area, const Scene *scene)
61{
62 SpaceSeq *sseq = area->spacedata.first_as<SpaceSeq>();
63 sseq->runtime->scopes.cleanup();
64 seq::preview_cache_invalidate(const_cast<Scene *>(scene));
65}
66
68
69/* ******************** default callbacks for sequencer space ***************** */
70
71static SpaceLink *sequencer_create(const ScrArea * /*area*/, const Scene *scene)
72{
73 ARegion *region;
74 SpaceSeq *sseq;
75
76 sseq = MEM_new<SpaceSeq>("initsequencer");
77 sseq->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
78 sseq->spacetype = SPACE_SEQ;
79 sseq->chanshown = 0;
80 sseq->view = SEQ_VIEW_SEQUENCE;
90
93
94 /* Header. */
95 region = BKE_area_region_new();
96
97 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
100
101 /* Tool header. */
102 region = BKE_area_region_new();
103
104 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
108
109 /* Footer. */
110 region = BKE_area_region_new();
111
112 BLI_addtail(&sseq->regionbase, region);
113 region->regiontype = RGN_TYPE_FOOTER;
115
116 /* Scrubbing */
117 region = BKE_area_region_new();
118 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
121
122 /* Buttons/list view. */
123 region = BKE_area_region_new();
124
125 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
126 region->regiontype = RGN_TYPE_UI;
127 region->alignment = RGN_ALIGN_RIGHT;
128 region->flag = RGN_FLAG_HIDDEN;
129
130 /* Toolbar. */
131 region = BKE_area_region_new();
132
133 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
134 region->regiontype = RGN_TYPE_TOOLS;
135 region->alignment = RGN_ALIGN_LEFT;
136
137 /* Channels. */
138 region = BKE_area_region_new();
139
140 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
142 region->alignment = RGN_ALIGN_LEFT;
144
145 /* Preview region. */
146 /* NOTE: if you change values here, also change them in sequencer_init_preview_region. */
147 region = BKE_area_region_new();
148 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
150 region->alignment = RGN_ALIGN_TOP;
151 /* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
153 region->v2d.minzoom = 0.001f;
154 region->v2d.maxzoom = 1000.0f;
155 region->v2d.tot.xmin = -960.0f; /* 1920 width centered. */
156 region->v2d.tot.ymin = -540.0f; /* 1080 height centered. */
157 region->v2d.tot.xmax = 960.0f;
158 region->v2d.tot.ymax = 540.0f;
159 region->v2d.min[0] = 0.0f;
160 region->v2d.min[1] = 0.0f;
161 region->v2d.max[0] = 12000.0f;
162 region->v2d.max[1] = 12000.0f;
163 region->v2d.cur = region->v2d.tot;
164 region->v2d.align = V2D_ALIGN_FREE;
165 region->v2d.keeptot = V2D_KEEPTOT_FREE;
166
167 /* Main region. */
168 region = BKE_area_region_new();
169
170 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
171 region->regiontype = RGN_TYPE_WINDOW;
172
173 /* Seq space goes from (0,8) to (0, efra). */
174 region->v2d.tot.xmin = 0.0f;
175 region->v2d.tot.ymin = 0.0f;
176 region->v2d.tot.xmax = scene->r.efra;
177 region->v2d.tot.ymax = 8.5f;
178
179 region->v2d.cur = region->v2d.tot;
180
181 region->v2d.min[0] = 10.0f;
182 region->v2d.min[1] = 1.0f;
183
184 region->v2d.max[0] = MAXFRAMEF;
185 region->v2d.max[1] = seq::MAX_CHANNELS;
186
187 region->v2d.minzoom = 0.01f;
188 region->v2d.maxzoom = 100.0f;
189
192 region->v2d.keepzoom = V2D_KEEPZOOM;
194 region->v2d.keeptot = V2D_KEEPTOT_FREE;
196 region->v2d.align = V2D_ALIGN_NO_NEG_Y;
197
198 return reinterpret_cast<SpaceLink *>(sseq);
199}
200
201/* Not spacelink itself. */
202static void sequencer_free(SpaceLink *sl)
203{
204 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(sl);
205 MEM_delete(sseq->runtime);
206
207#if 0
208 if (sseq->gpd) {
210 }
211#endif
212}
213
214/* Space-type init callback. */
215static void sequencer_init(wmWindowManager * /*wm*/, ScrArea * /*area*/) {}
216
217static void sequencer_refresh(const bContext *C, ScrArea *area)
218{
219 const wmWindow *window = CTX_wm_window(C);
220 SpaceSeq *sseq = area->spacedata.first_as<SpaceSeq>();
222 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
223 bool view_changed = false;
224
225 switch (sseq->view) {
226 case SEQ_VIEW_PREVIEW:
227 /* Reset scrolling when preview region just appears. */
228 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
229 region_preview->v2d.cur = region_preview->v2d.tot;
230 /* Only redraw, don't re-init. */
231 ED_area_tag_redraw(area);
232 }
233 if (region_preview->alignment != RGN_ALIGN_NONE) {
234 region_preview->alignment = RGN_ALIGN_NONE;
235 view_changed = true;
236 }
237 break;
239 /* Get available height (without DPI correction). */
240 const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
241
242 /* We reuse hidden region's size, allows to find same layout as before if we just switch
243 * between one 'full window' view and the combined one. This gets lost if we switch to both
244 * 'full window' views before, though... Better than nothing. */
245 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
246 region_preview->v2d.cur = region_preview->v2d.tot;
247 region_main->sizey = int(height - region_preview->sizey);
248 region_preview->sizey = int(height - region_main->sizey);
249 view_changed = true;
250 }
251 if (region_preview->alignment != RGN_ALIGN_TOP) {
252 region_preview->alignment = RGN_ALIGN_TOP;
253 view_changed = true;
254 }
255 /* Final check that both preview and main height are reasonable. */
256 if (region_preview->sizey < 10 || region_main->sizey < 10 ||
257 region_preview->sizey + region_main->sizey > height)
258 {
259 region_preview->sizey = roundf(height * 0.4f);
260 region_main->sizey = int(height - region_preview->sizey);
261 view_changed = true;
262 }
263 break;
264 }
266 break;
267 }
268
269 if (view_changed) {
270 ED_area_init(const_cast<bContext *>(C), window, area);
271 ED_area_tag_redraw(area);
272 }
273
274 /* Render one pending scene strip thumbnail, if any. This needs to happen
275 * outside of regular drawing due to DRW/GPU locks. */
276 if (Scene *scene = CTX_data_sequencer_scene(C)) {
279 ED_area_tag_redraw(area);
280 }
281 }
282}
283
285{
286 SpaceSeq *sseqn = MEM_dupalloc(reinterpret_cast<SpaceSeq *>(sl));
287 sseqn->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
288
289 /* Clear or remove stuff from old. */
290 // sseq->gpd = gpencil_data_duplicate(sseq->gpd, false);
291
292 return reinterpret_cast<SpaceLink *>(sseqn);
293}
294
296{
297 wmWindowManager *wm = G_MAIN->wm.first();
298 wmWindow *win = wm ? WM_window_find_by_area(wm, area) : nullptr;
299 WorkSpace *workspace = win ? WM_window_get_active_workspace(win) : nullptr;
300 Scene *scene = workspace ? workspace->sequencer_scene : nullptr;
301 if (scene && scene->ed) {
302 scene->ed->edit_point_set(scene, std::nullopt);
303 }
304}
305
307{
308 ScrArea *area = params->area;
309 const wmNotifier *wmn = params->notifier;
310
311 /* Context changes. */
312 switch (wmn->category) {
313 case NC_SCENE:
314 switch (wmn->data) {
315 case ND_FRAME:
316 case ND_SEQUENCER:
317 sequencer_scopes_tag_refresh(area, params->scene);
318 break;
320 ED_area_tag_redraw(area);
321 break;
322 }
323 break;
324 case NC_WINDOW:
325 case NC_SPACE:
326 if (wmn->data == ND_SPACE_SEQUENCER) {
327 sequencer_scopes_tag_refresh(area, params->scene);
328 }
329 break;
330 case NC_GPENCIL:
331 if (wmn->data & ND_GPENCIL_EDITMODE) {
332 ED_area_tag_redraw(area);
333 }
334 break;
335 }
336}
337
338/* DO NOT make this static, this hides the symbol and breaks API generation script. */
339extern "C" const char *sequencer_context_dir[]; /* Quiet warning. */
340const char *sequencer_context_dir[] = {"edit_mask", "tool_settings", nullptr};
341
342static int /*eContextResult*/ sequencer_context(const bContext *C,
343 const char *member,
345{
347
348 if (CTX_data_dir(member)) {
350
351 return CTX_RESULT_OK;
352 }
353 if (CTX_data_equals(member, "tool_settings")) {
354 if (scene) {
355 CTX_data_pointer_set(result, &scene->id, RNA_ToolSettings, scene->toolsettings);
356 return CTX_RESULT_OK;
357 }
358 }
359 if (CTX_data_equals(member, "edit_mask")) {
360 if (scene) {
362 if (mask) {
364 }
365 return CTX_RESULT_OK;
366 }
367 }
368
370}
371
373{
374 ui::VIEW2D_GGT_navigate_impl(gzgt, "SEQUENCER_GGT_navigate");
375}
376
378{
379 gzgt->name = "Sequencer Transform Gizmo";
380 gzgt->idname = "SEQUENCER_GGT_gizmo2d";
381
384
387
389}
390
392{
393 gzgt->name = "Sequencer Translate Gizmo";
394 gzgt->idname = "SEQUENCER_GGT_gizmo2d_translate";
395
398
401
403}
404
406{
407 gzgt->name = "Sequencer Transform Gizmo Resize";
408 gzgt->idname = "SEQUENCER_GGT_gizmo2d_resize";
409
412
415
417}
418
420{
421 gzgt->name = "Sequencer Transform Gizmo Resize";
422 gzgt->idname = "SEQUENCER_GGT_gizmo2d_rotate";
423
426
429
431}
432
445
446/* *********************** sequencer (main) region ************************ */
447
449{
450 const SpaceSeq *sseq = params->area->spacedata.first_as<SpaceSeq>();
452}
453
454/* Add handlers, stuff you only do once or on area/region changes. */
456{
457 wmKeyMap *keymap;
458
459 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
460
461#if 0
462 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
464#endif
465
466 keymap = WM_keymap_ensure(
467 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
469
470 /* Own keymap. */
471 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
474
475 /* Add drop boxes. */
476 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
477
479
481}
482
483/* Strip editing timeline. */
484static void sequencer_main_region_draw(const bContext *C, ARegion *region)
485{
486 draw_timeline_seq(C, region);
487
488 /* If we have any pending scene strip thumbnail requests, tag the area for a refresh
489 * (actual thumbnail rendering needs to happen outside of regular drawing). */
490 if (Scene *scene = CTX_data_sequencer_scene(C)) {
493 }
494 }
495}
496
497/* Strip editing timeline. */
499{
501}
502
504{
505 SpaceSeq *sseq = CTX_wm_space_seq(C);
506 View2D *v2d = &region->v2d;
508
509 rctf strip_boundbox;
510
511 if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
512 BLI_rctf_init_minmax(&strip_boundbox);
513 return strip_boundbox;
514 }
515
516 /* Initialize default view with 7 channels, that are visible even if empty. */
517 seq::timeline_init_boundbox(scene, &strip_boundbox);
518 Editing *ed = seq::editing_get(scene);
519 if (ed != nullptr) {
520 seq::timeline_expand_boundbox(scene, ed->current_strips(), &strip_boundbox);
521 }
522 /* We need to calculate how much the current view is padded and add this padding to our
523 * strip bounding box. Without this, the scrub-bar or other overlays would occlude the
524 * displayed strips in the timeline.
525 */
526 float pad_top, pad_bottom;
527 SEQ_get_timeline_region_padding(C, &pad_top, &pad_bottom);
528 /* Add padding to be able to scroll the view so that the collapsed redo panel doesn't occlude any
529 * strips. */
530 float bottom_channel_padding = UI_MARKER_MARGIN_Y * ui::view2d_pixel_size_get_y(v2d);
531 bottom_channel_padding = std::max(bottom_channel_padding, 1.0f);
532 /* Add the padding and make sure we have a margin of one channel in each direction. */
533 strip_boundbox.ymax += 1.0f + pad_top * ui::view2d_pixel_size_get_y(v2d);
534 strip_boundbox.ymin -= bottom_channel_padding;
535
536 /* If a strip has been deleted, don't move the view automatically, keep current range until it is
537 * changed. */
538 strip_boundbox.ymax = max_ff(sseq->runtime->timeline_clamp_custom_range, strip_boundbox.ymax);
539
540 return strip_boundbox;
541}
542
543static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
544{
545 SpaceSeq *sseq = CTX_wm_space_seq(C);
546
547 if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
548 return;
549 }
550
551 View2D *v2d = &region->v2d;
553 if (!scene) {
554 return;
555 }
556
557 /* Transformation uses edge panning to move view. Also if smooth view is running, don't apply
558 * clamping to prevent overriding this functionality. */
559 if (G.moving || v2d->smooth_timer != nullptr) {
560 return;
561 }
562
563 rctf strip_boundbox = sequencer_clamped_view_bounds_get(C, region);
564 rctf view_clamped = v2d->cur;
565 float range_y = BLI_rctf_size_y(&view_clamped);
566 if (view_clamped.ymax > strip_boundbox.ymax) {
567 view_clamped.ymax = strip_boundbox.ymax;
568 view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
569 }
570 else if (view_clamped.ymin < strip_boundbox.ymin) {
571 view_clamped.ymin = strip_boundbox.ymin;
572 view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
573 }
574
575 v2d->cur = view_clamped;
576}
577
579{
580 SpaceSeq *sseq = CTX_wm_space_seq(C);
581 View2D *v2d = &region->v2d;
582
583 if ((v2d->flag & V2D_IS_NAVIGATING) == 0) {
585 }
586}
587
593
599
601{
602 ARegion *region = params->region;
603 const wmNotifier *wmn = params->notifier;
604
605 /* Context changes. */
606 switch (wmn->category) {
607 case NC_SCENE:
608 switch (wmn->data) {
609 case ND_FRAME:
610 case ND_FRAME_RANGE:
611 case ND_MARKERS:
612 case ND_RENDER_OPTIONS: /* For FPS and FPS Base. */
613 case ND_SEQUENCER:
615 case ND_RENDER_RESULT:
616 ED_region_tag_redraw(region);
618 break;
619 }
620 break;
621 case NC_ANIMATION:
622 switch (wmn->data) {
623 case ND_KEYFRAME:
624 ED_region_tag_redraw(region);
625 break;
626 }
627 break;
628 case NC_SPACE:
629 if (wmn->data == ND_SPACE_SEQUENCER) {
630 ED_region_tag_redraw(region);
632 }
633 break;
634 case NC_ID:
635 if (wmn->action == NA_RENAME) {
636 ED_region_tag_redraw(region);
637 }
638 break;
639 case NC_SCREEN:
640 if (ELEM(wmn->data, ND_ANIMPLAY)) {
641 ED_region_tag_redraw(region);
643 }
644 break;
645 }
646}
647
649{
650 wmMsgBus *mbus = params->message_bus;
651 Scene *scene = params->scene;
652 ARegion *region = params->region;
653
654 wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
655 msg_sub_value_region_tag_redraw.owner = region;
656 msg_sub_value_region_tag_redraw.user_data = region;
657 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
658
659 /* Timeline depends on scene properties. */
660 {
661 bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
662 const PropertyRNA *props[] = {
663 use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
664 use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
665 &rna_Scene_use_preview_range,
666 &rna_Scene_frame_current,
667 };
668
669 PointerRNA idptr = RNA_id_pointer_create(&scene->id);
670
671 for (int i = 0; i < ARRAY_SIZE(props); i++) {
672 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
673 }
674 }
675
676 {
677 StructRNA *type_array[] = {
678 RNA_SequenceEditor,
679
680 RNA_Strip,
681 /* Members of 'Strip'. */
682 RNA_StripCrop,
683 RNA_StripTransform,
684 RNA_StripModifier,
685 RNA_StripColorBalanceData,
686 };
687 wmMsgParams_RNA msg_key_params = {{}};
688 for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
689 msg_key_params.ptr.type = type_array[i];
691 mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
692 }
693 }
694}
695
696static void sequencer_main_cursor(wmWindow *win, ScrArea *area, ARegion *region)
697{
698 const WorkSpace *workspace = WM_window_get_active_workspace(win);
699 const Scene *scene = workspace->sequencer_scene;
700 const Editing *ed = seq::editing_get(scene);
701 const SpaceSeq *sseq = area->spacedata.first_as<SpaceSeq>();
702 const bToolRef *tref = area->runtime.tool;
703
704 int wmcursor = WM_CURSOR_DEFAULT;
705
706 if (tref == nullptr || scene == nullptr || ed == nullptr) {
707 WM_cursor_set(win, wmcursor);
708 return;
709 }
710
711 rcti scrub_rect = region->winrct;
712 scrub_rect.ymin = scrub_rect.ymax - UI_TIME_SCRUB_MARGIN_Y;
713 if (BLI_rcti_isect_pt_v(&scrub_rect, win->runtime->eventstate->xy)) {
714 WM_cursor_set(win, wmcursor);
715 return;
716 }
717
718 const View2D *v2d = &region->v2d;
719 if (ui::view2d_mouse_in_scrollers(region, v2d, win->runtime->eventstate->xy)) {
720 WM_cursor_set(win, wmcursor);
721 return;
722 }
723
724 int mouse_co_region[2] = {win->runtime->eventstate->xy[0] - region->winrct.xmin,
725 win->runtime->eventstate->xy[1] - region->winrct.ymin};
726 float mouse_co_view[2];
728 &region->v2d, mouse_co_region[0], mouse_co_region[1], &mouse_co_view[0], &mouse_co_view[1]);
729
730 if (STREQ(tref->idname, "builtin.blade") || STREQ(tref->idname, "builtin.slip")) {
731 Strip *strip = strip_under_mouse_get(scene, v2d, mouse_co_region);
732 if (strip != nullptr) {
733 const ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
734 const bool locked = seq::transform_is_locked(channels, strip);
735 if (STREQ(tref->idname, "builtin.blade")) {
736 wmcursor = locked ? WM_CURSOR_STOP : WM_CURSOR_BLADE;
737 }
738 else {
739 wmcursor = (locked || seq::transform_single_image_check(strip)) ? WM_CURSOR_STOP :
741 }
742 }
743 else if (STREQ(tref->idname, "builtin.blade")) {
744 /* For blade tool, show blade cursor even when `strip_under_mouse_get` returns `nullptr`.
745 * This is because the drag starting position for box blade can be in empty space. */
746 wmcursor = WM_CURSOR_BLADE;
747 }
748
749 WM_cursor_set(win, wmcursor);
750 return;
751 }
752
753 if (ed == nullptr) {
754 WM_cursor_set(win, wmcursor);
755 return;
756 }
757
758 StripSelection selection = pick_strip_and_handle(scene, &region->v2d, mouse_co_view);
759
760 if (selection.strip1 == nullptr) {
761 WM_cursor_set(win, wmcursor);
762 return;
763 }
764
766 scene, selection.strip1, &region->v2d, sseq, mouse_co_region))
767 {
768 WM_cursor_set(win, wmcursor);
769 return;
770 }
771
772 if (!can_select_handle(scene, selection.strip1)) {
773 WM_cursor_set(win, wmcursor);
774 return;
775 }
776
777 if (selection.strip1 != nullptr && selection.strip2 != nullptr) {
778 wmcursor = WM_CURSOR_BOTH_HANDLES;
779 }
780 else if (selection.handle == STRIP_HANDLE_LEFT) {
781 wmcursor = WM_CURSOR_LEFT_HANDLE;
782 }
783 else if (selection.handle == STRIP_HANDLE_RIGHT) {
784 wmcursor = WM_CURSOR_RIGHT_HANDLE;
785 }
786
787 WM_cursor_set(win, wmcursor);
788}
789
790/* *********************** header region ************************ */
791/* Add handlers, stuff you only do once or on area/region changes. */
793{
794 ED_region_header_init(region);
795}
796
797static void sequencer_header_region_draw(const bContext *C, ARegion *region)
798{
799 ED_region_header(C, region);
800}
801
803{
804 ARegion *region = params->region;
805 const wmNotifier *wmn = params->notifier;
806
807 /* context changes */
808 switch (wmn->category) {
809 case NC_SCREEN:
810 if (wmn->data == ND_ANIMPLAY) {
811 ED_region_tag_redraw(region);
812 }
813 break;
814 case NC_SCENE:
815 switch (wmn->data) {
816 case ND_FRAME:
817 ED_region_tag_redraw(region);
818 break;
819 }
820 break;
821 }
822}
823
825{
826 const Scene *scene = CTX_data_sequencer_scene(params->context);
827 return scene != nullptr;
828}
829
830/* *********************** toolbar region ************************ */
831/* Add handlers, stuff you only do once or on area/region changes. */
833{
834 wmKeyMap *keymap;
835
837 ED_region_panels_init(wm, region);
838
839 keymap = WM_keymap_ensure(
840 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
842}
843
844static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
845{
846 ScrArea *area = CTX_wm_area(C);
848
849 for (ARegion &ar : area->regionbase) {
850 if (ar.regiontype == RGN_TYPE_PREVIEW && region->regiontype == RGN_TYPE_TOOLS) {
852 break;
853 }
854 }
855
856 if (region->regiontype == RGN_TYPE_CHANNELS) {
858 }
859
860 ED_region_panels_ex(C, region, op_context, nullptr);
861}
862/* *********************** preview region ************************ */
863
865{
866 const SpaceSeq *sseq = params->area->spacedata.first_as<SpaceSeq>();
868}
869
871{
872 wmKeyMap *keymap;
873
874 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
875
876#if 0
877 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
879#endif
880
881 /* Own keymap. */
882 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Preview", SPACE_SEQ, RGN_TYPE_WINDOW);
884
885 keymap = WM_keymap_ensure(
886 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
888
889 /* Do this instead of adding V2D and frames `ED_KEYMAP_*` flags to `art->keymapflag`, since text
890 * editing conflicts with several of their keymap items (e.g. arrow keys when editing text or
891 * advancing frames). This seems to be the best way to define the proper order of evaluation. */
892 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "View2D", SPACE_EMPTY, RGN_TYPE_WINDOW);
894
895 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Frames", SPACE_EMPTY, RGN_TYPE_WINDOW);
897
898 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW);
900}
901
903{
904 SpaceSeq *sseq = CTX_wm_space_seq(C);
905
906 if (sseq->flag & SEQ_ZOOM_TO_FIT) {
907 View2D *v2d = &region->v2d;
908 v2d->cur = SEQ_view_frame_fit(sseq, region, v2d->tot);
909 }
910}
911
913{
914 SpaceSeq *sseq = CTX_wm_space_seq(C);
915 sseq->flag &= ~SEQ_ZOOM_TO_FIT;
916}
917
918#ifdef WITH_INPUT_IME
919static std::optional<ARegionIMECursorState> sequencer_preview_region_cursor_ime(
920 wmWindow *win, const ScrArea * /*area*/, const ARegion *region, ARegionIMECursor *r_cursor)
921{
922 const WorkSpace *workspace = WM_window_get_active_workspace(win);
923 const Scene *scene = workspace->sequencer_scene;
924 if (!scene) {
925 return std::nullopt;
926 }
928 if (strip == nullptr) {
929 return std::nullopt;
930 }
931 const std::optional<blender::int2> xy = sequencer_text_editing_cursor_region_xy_get(
932 scene, region, strip);
933 if (!xy) {
934 /* Text editing can be active without a position,
935 * e.g. the current-frame moved outside the strip.
936 * Keep the session pending rather than canceling the composition. */
938 }
939
940 r_cursor->rect = {
941 .xmin = xy->x,
942 .xmax = xy->x,
943 .ymin = xy->y,
944 .ymax = xy->y + int(UI_UNIT_Y),
945 };
946 r_cursor->font_size = UI_UNIT_Y;
948}
949#endif
950
952{
953 ARegion *region = params->region;
954 const wmNotifier *wmn = params->notifier;
955
957
958 /* Context changes. */
959 switch (wmn->category) {
960 case NC_OBJECT: /* To handle changes in 3D viewport. */
961 switch (wmn->data) {
962 case ND_BONE_ACTIVE:
963 case ND_BONE_SELECT:
965 case ND_TRANSFORM:
966 case ND_POSE:
967 case ND_DRAW:
968 case ND_MODIFIER:
969 case ND_SHADERFX:
970 case ND_CONSTRAINT:
971 case ND_KEYS:
972 case ND_PARTICLE:
973 case ND_POINTCACHE:
974 case ND_LOD:
975 case ND_DRAW_ANIMVIZ:
976 ED_region_tag_redraw(region);
977 break;
978 }
979 switch (wmn->action) {
980 case NA_ADDED:
981 ED_region_tag_redraw(region);
982 break;
983 }
984 break;
985 case NC_GEOM: /* To handle changes in 3D viewport. */
986 switch (wmn->data) {
987 case ND_DATA:
988 case ND_VERTEX_GROUP:
989 ED_region_tag_redraw(region);
990 break;
991 }
992 switch (wmn->action) {
993 case NA_EDITED:
994 ED_region_tag_redraw(region);
995 break;
996 }
997 break;
998 case NC_MATERIAL: /* To handle changes in 3D viewport. */
999 switch (wmn->data) {
1000 case ND_SHADING:
1001 case ND_NODES:
1002 case ND_SHADING_DRAW:
1003 case ND_SHADING_LINKS:
1004 ED_region_tag_redraw(region);
1005 break;
1006 }
1007 break;
1008 case NC_NODE: /* To handle changes in 3D viewport. */
1009 ED_region_tag_redraw(region);
1010 break;
1011 case NC_WORLD: /* To handle changes in 3D viewport. */
1012 switch (wmn->data) {
1013 case ND_WORLD_DRAW:
1014 case ND_WORLD:
1015 ED_region_tag_redraw(region);
1016 break;
1017 }
1018 break;
1019 case NC_LAMP: /* To handle changes in 3D viewport. */
1020 switch (wmn->data) {
1021 case ND_LIGHTING:
1022 case ND_LIGHTING_DRAW:
1023 ED_region_tag_redraw(region);
1024 break;
1025 }
1026 break;
1027 case NC_LIGHTPROBE: /* To handle changes in 3D viewport. */
1028 case NC_IMAGE:
1029 case NC_TEXTURE:
1030 ED_region_tag_redraw(region);
1031 break;
1032 case NC_MOVIECLIP: /* To handle changes in 3D viewport. */
1033 if (wmn->data == ND_DISPLAY || wmn->action == NA_EDITED) {
1034 ED_region_tag_redraw(region);
1035 }
1036 break;
1037
1038 case NC_GPENCIL:
1039 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
1040 ED_region_tag_redraw(region);
1041 }
1042 break;
1043 case NC_SCENE:
1044 switch (wmn->data) {
1045 /* To handle changes in 3D viewport. */
1046 case ND_LAYER_CONTENT:
1047 case ND_LAYER:
1048 case ND_TRANSFORM:
1049 case ND_OB_VISIBLE:
1050 /* VSE related. */
1051 case ND_FRAME:
1052 case ND_MARKERS:
1053 case ND_SEQUENCER:
1055 case ND_RENDER_OPTIONS:
1056 case ND_RENDER_RESULT: /* Un-blank the preview after render. */
1058 ED_region_tag_redraw(region);
1059 break;
1060 }
1061 break;
1062 case NC_ANIMATION:
1063 switch (wmn->data) {
1064 /* To handle changes in 3D viewport. */
1065 case ND_NLA_ACTCHANGE:
1066 case ND_NLA:
1067 case ND_ANIMCHAN:
1068 /* VSE related. */
1069 case ND_KEYFRAME:
1070 ED_region_tag_redraw(region);
1071 break;
1072 }
1073 break;
1074 case NC_SPACE:
1075 if (wmn->data == ND_SPACE_SEQUENCER) {
1076 ED_region_tag_redraw(region);
1077 }
1078 break;
1079 case NC_ID:
1080 switch (wmn->data) {
1081 case NA_RENAME:
1082 ED_region_tag_redraw(region);
1083 break;
1084 }
1085 break;
1086 case NC_MASK:
1087 if (wmn->action == NA_EDITED) {
1088 ED_region_tag_redraw(region);
1089 }
1090 break;
1091 }
1092}
1093
1094/* *********************** buttons region ************************ */
1095
1096/* Add handlers, stuff you only do once or on area/region changes. */
1098{
1099 wmKeyMap *keymap;
1100
1101 keymap = WM_keymap_ensure(
1102 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
1104
1105 ED_region_panels_init(wm, region);
1106}
1107
1109{
1110 ED_region_panels(C, region);
1111}
1112
1114{
1115 ARegion *region = params->region;
1116 const wmNotifier *wmn = params->notifier;
1117
1118 /* Context changes. */
1119 switch (wmn->category) {
1120 case NC_GPENCIL:
1121 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
1122 ED_region_tag_redraw(region);
1123 }
1124 break;
1125 case NC_SCENE:
1126 switch (wmn->data) {
1127 case ND_FRAME:
1128 case ND_SEQUENCER:
1130 ED_region_tag_redraw(region);
1131 break;
1132 }
1133 break;
1134 case NC_SPACE:
1135 if (wmn->data == ND_SPACE_SEQUENCER) {
1136 ED_region_tag_redraw(region);
1137 }
1138 break;
1139 case NC_ID:
1140 if (wmn->action == NA_RENAME) {
1141 ED_region_tag_redraw(region);
1142 }
1143 break;
1144 }
1145}
1146
1147static void sequencer_id_remap(ScrArea * /*area*/,
1148 SpaceLink *slink,
1149 const bke::id::IDRemapper &mappings)
1150{
1151 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(slink);
1152 mappings.apply(reinterpret_cast<ID **>(&sseq->gpd), ID_REMAP_APPLY_DEFAULT);
1153}
1154
1156{
1157 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(space_link);
1159}
1160
1161/* ************************************* */
1162
1164{
1165 const SpaceSeq *sseq = params->area->spacedata.first_as<SpaceSeq>();
1166 return ELEM(sseq->view, SEQ_VIEW_SEQUENCE);
1167}
1168
1169/* add handlers, stuff you only do once or on area/region changes */
1171{
1172 wmKeyMap *keymap;
1173
1174 region->alignment = RGN_ALIGN_LEFT;
1175
1176 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_LIST, region->winx, region->winy);
1177
1178 keymap = WM_keymap_ensure(
1179 wm->runtime->defaultconf, "Sequencer Channels", SPACE_SEQ, RGN_TYPE_WINDOW);
1181}
1182
1184{
1185 draw_channels(C, region);
1186}
1187
1189{
1190 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(sl);
1191 sseq->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
1192
1193 /* grease pencil data is not a direct data and can't be linked from direct_link*
1194 * functions, it should be linked from lib_link* functions instead
1195 *
1196 * otherwise it'll lead to lost grease data on open because it'll likely be
1197 * read from file after all other users of grease pencil and newdataadr would
1198 * simple return nullptr here (sergey)
1199 */
1200#if 0
1201 if (sseq->gpd) {
1202 sseq->gpd = newdataadr(fd, sseq->gpd);
1204 }
1205#endif
1206}
1207
1209{
1210 writer->write_struct_cast<SpaceSeq>(sl, [](BlendStructWriter<SpaceSeq> &struct_writer) {
1211 struct_writer.shallow_data.runtime = nullptr;
1212 });
1213}
1214
1216{
1217 const Scene *scene = CTX_data_sequencer_scene(params->context);
1218 if (scene == nullptr) {
1219 return false;
1220 }
1221
1222 const SpaceSeq *sseq = params->area->spacedata.first_as<SpaceSeq>();
1223 return sseq->flag & SEQ_SHOW_SCRUBBING_REGION;
1224}
1225
1227{
1228 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_HEADER, region->winx, region->winy);
1229 region->v2d.keepofs |= V2D_LOCKOFS_X;
1230}
1231
1233{
1234 ARegion *region = params->region;
1235 const wmNotifier *wmn = params->notifier;
1236
1237 switch (wmn->category) {
1238 case NC_SCENE:
1239 switch (wmn->data) {
1240 case ND_FRAME:
1241 case ND_SEQUENCER:
1242 case ND_RENDER_OPTIONS:
1243 case ND_FRAME_RANGE:
1244 ED_region_tag_redraw(region);
1245 break;
1246 }
1247 break;
1248 case NC_SPACE:
1249 if (wmn->data == ND_SPACE_SEQUENCER) {
1250 ED_region_tag_redraw(region);
1251 }
1252 break;
1253 }
1254}
1255
1257{
1258 const Scene *scene = CTX_data_sequencer_scene(C);
1259
1260 const int start_frame = (scene->r.flag & SCER_PRV_RANGE) ? scene->r.psfra : scene->r.sfra;
1261 const int end_frame = (scene->r.flag & SCER_PRV_RANGE) ? scene->r.pefra : scene->r.efra;
1262
1263 region->v2d.cur.xmin = start_frame;
1264 region->v2d.cur.xmax = std::max(end_frame, start_frame + 1);
1265}
1266
1268{
1269 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1270 ARegionType *art;
1271
1272 st->spaceid = SPACE_SEQ;
1273 STRNCPY_UTF8(st->name, "Sequencer");
1274 st->struct_size = sizeof(SpaceSeq);
1275
1276 st->create = sequencer_create;
1277 st->free = sequencer_free;
1278 st->init = sequencer_init;
1279 st->duplicate = sequencer_duplicate;
1280 st->operatortypes = sequencer_operatortypes;
1281 st->keymap = sequencer_keymap;
1282 st->context = sequencer_context;
1283 st->gizmos = sequencer_gizmos;
1284 st->dropboxes = sequencer_dropboxes;
1285 st->refresh = sequencer_refresh;
1286 st->listener = sequencer_listener;
1287 st->deactivate = sequencer_deactivate;
1288 st->id_remap = sequencer_id_remap;
1289 st->foreach_id = sequencer_foreach_id;
1290 st->blend_read_data = sequencer_space_blend_read_data;
1291 st->blend_read_after_liblink = nullptr;
1292 st->blend_write = sequencer_space_blend_write;
1293
1294 /* Create regions: */
1295 /* Main window. */
1296 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1309 art->event_cursor = true;
1310 art->clip_gizmo_events_by_ui = true;
1311 BLI_addhead(&st->regiontypes, art);
1312
1313 /* Preview. */
1314 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1321#ifdef WITH_INPUT_IME
1322 art->cursor_ime = sequencer_preview_region_cursor_ime;
1323#endif
1326 BLI_addhead(&st->regiontypes, art);
1327
1328 /* List-view/buttons. */
1329 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1330 art->regionid = RGN_TYPE_UI;
1332 art->prefsizex = UI_SIDEBAR_PANEL_WIDTH * 1.3f;
1339 BLI_addhead(&st->regiontypes, art);
1340
1342 /* Toolbar. */
1343 art = MEM_new_zeroed<ARegionType>("spacetype sequencer tools region");
1344 art->regionid = RGN_TYPE_TOOLS;
1345 art->prefsizex = int(UI_TOOLBAR_WIDTH);
1346 art->prefsizey = 50; /* XXX */
1353 BLI_addhead(&st->regiontypes, art);
1354
1355 /* Channels. */
1356 art = MEM_new_zeroed<ARegionType>("spacetype sequencer channels");
1359 art->keymapflag = ED_KEYMAP_UI;
1364 BLI_addhead(&st->regiontypes, art);
1365
1366 /* Tool header. */
1367 art = MEM_new_zeroed<ARegionType>("spacetype sequencer tool header region");
1369 art->prefsizey = HEADERY;
1375 BLI_addhead(&st->regiontypes, art);
1376
1377 /* Header. */
1378 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1380 art->prefsizey = HEADERY;
1382
1386 BLI_addhead(&st->regiontypes, art);
1387
1388 /* Footer. */
1389 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1391 art->prefsizey = HEADERY;
1393
1398 BLI_addhead(&st->regiontypes, art);
1399
1400 /* Preview Scrubbing */
1401 art = MEM_new_zeroed<ARegionType>("spacetype sequencer region");
1403 art->prefsizey = 0.9f * HEADERY;
1411 BLI_addhead(&st->regiontypes, art);
1412
1413 /* HUD. */
1414 art = ui::ED_area_type_hud(st->spaceid);
1415 BLI_addhead(&st->regiontypes, art);
1416
1417 WM_menutype_add(MEM_new<MenuType>(__func__, add_catalog_assets_menu_type()));
1418 WM_menutype_add(MEM_new<MenuType>(__func__, add_unassigned_assets_menu_type()));
1419 WM_menutype_add(MEM_new<MenuType>(__func__, add_scene_menu_type()));
1420
1421 BKE_spacetype_register(std::move(st));
1422
1423 /* Set the sequencer callback when not in background mode. */
1424 if (G.background == 0) {
1426 }
1427}
1428
1429} // namespace blender::ed::vse
#define G_MAIN
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define STRNCPY_UTF8(dst, src)
#define MAXFRAMEF
#define HEADERY
#define UI_SCALE_FAC
#define C
Definition RandGen.cpp:29
#define UI_UNIT_Y
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_TOOLBAR_WIDTH
#define UI_COMPACT_PANEL_WIDTH
#define UI_MARKER_MARGIN_Y
Definition UI_view2d.hh:492
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:493
#define ND_SEQUENCER
Definition WM_types.hh:456
#define NC_WORLD
Definition WM_types.hh:400
#define ND_SHADING
Definition WM_types.hh:520
#define ND_WORLD
Definition WM_types.hh:471
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:578
#define NC_WINDOW
Definition WM_types.hh:388
#define NC_ID
Definition WM_types.hh:408
#define NC_NODE
Definition WM_types.hh:407
#define ND_SEQUENCER_PREFETCH
Definition WM_types.hh:517
#define NC_GEOM
Definition WM_types.hh:406
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:541
#define ND_DRAW
Definition WM_types.hh:502
#define ND_RENDER_RESULT
Definition WM_types.hh:465
#define ND_DATA
Definition WM_types.hh:552
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:547
#define ND_LIGHTING_DRAW
Definition WM_types.hh:527
#define ND_RENDER_OPTIONS
Definition WM_types.hh:454
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_VERTEX_GROUP
Definition WM_types.hh:553
#define ND_DISPLAY
Definition WM_types.hh:534
#define ND_LOD
Definition WM_types.hh:509
#define NC_SCREEN
Definition WM_types.hh:390
#define NC_MOVIECLIP
Definition WM_types.hh:410
#define ND_ANIMPLAY
Definition WM_types.hh:441
#define NC_SCENE
Definition WM_types.hh:391
#define NA_ADDED
Definition WM_types.hh:636
#define ND_OB_VISIBLE
Definition WM_types.hh:462
#define ND_LAYER_CONTENT
Definition WM_types.hh:472
#define ND_NODES
Definition WM_types.hh:455
#define ND_MODIFIER
Definition WM_types.hh:503
#define ND_POSE
Definition WM_types.hh:482
#define NA_EDITED
Definition WM_types.hh:634
#define ND_PARTICLE
Definition WM_types.hh:506
#define ND_FRAME_RANGE
Definition WM_types.hh:470
#define NC_MATERIAL
Definition WM_types.hh:393
#define NC_LAMP
Definition WM_types.hh:395
#define NC_IMAGE
Definition WM_types.hh:397
#define ND_CONSTRAINT
Definition WM_types.hh:505
#define ND_MARKERS
Definition WM_types.hh:452
#define ND_FRAME
Definition WM_types.hh:453
#define NC_GPENCIL
Definition WM_types.hh:412
#define ND_NLA
Definition WM_types.hh:540
#define NC_TEXTURE
Definition WM_types.hh:394
#define ND_LIGHTING
Definition WM_types.hh:526
#define ND_BONE_ACTIVE
Definition WM_types.hh:483
#define ND_TRANSFORM
Definition WM_types.hh:475
#define ND_LAYER
Definition WM_types.hh:469
#define ND_BONE_COLLECTION
Definition WM_types.hh:515
#define NC_MASK
Definition WM_types.hh:411
#define ND_KEYS
Definition WM_types.hh:504
#define NA_RENAME
Definition WM_types.hh:638
#define NC_LIGHTPROBE
Definition WM_types.hh:415
#define ND_POINTCACHE
Definition WM_types.hh:507
#define ND_SHADERFX
Definition WM_types.hh:512
#define ND_WORLD_DRAW
Definition WM_types.hh:530
#define ND_DRAW_ANIMVIZ
Definition WM_types.hh:514
#define ND_BONE_SELECT
Definition WM_types.hh:491
#define ND_KEYFRAME
Definition WM_types.hh:537
#define NC_OBJECT
Definition WM_types.hh:392
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define ND_SHADING_LINKS
Definition WM_types.hh:522
#define ND_SHADING_DRAW
Definition WM_types.hh:521
#define NC_SPACE
Definition WM_types.hh:405
#define NA_SELECTED
Definition WM_types.hh:639
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:511
#define ELEM(...)
#define STREQ(a, b)
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
#define roundf(x)
void ED_widgetgroup_gizmo2d_resize_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(wmGizmoGroupType *gzgt)
static void sequencer_main_region_clamp_custom_set(const bContext *C, ARegion *region)
static bool sequencer_main_region_poll(const RegionPollParams *params)
static void sequencer_main_region_layout(const bContext *C, ARegion *region)
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
static int sequencer_context(const bContext *C, const char *member, bContextDataResult *result)
static void sequencer_header_region_draw(const bContext *C, ARegion *region)
static SpaceLink * sequencer_duplicate(SpaceLink *sl)
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
static void sequencer_scrubbing_region_layout(const bContext *C, ARegion *region)
StripSelection pick_strip_and_handle(const struct Scene *scene, const View2D *v2d, float mouse_co[2])
static void sequencer_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_gizmo2d(wmGizmoGroupType *gzgt)
bool is_mouse_over_retiming_keys_box(const Scene *scene, const Strip *strip, const View2D *v2d, const SpaceSeq *sseq, int mouse_co_region[2])
void draw_timeline_seq(const bContext *C, const ARegion *region)
static void sequencer_init(wmWindowManager *, ScrArea *)
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
static bool sequencer_footer_region_poll(const RegionPollParams *params)
static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
static void sequencer_buttons_region_listener(const wmRegionListenerParams *params)
void SEQUENCER_GGT_blade(wmGizmoGroupType *gzgt)
static void sequencer_scopes_tag_refresh(ScrArea *area, const Scene *scene)
static void sequencer_main_region_draw(const bContext *C, ARegion *region)
void SEQ_get_timeline_region_padding(const bContext *C, float *r_pad_top, float *r_pad_bottom)
rctf SEQ_view_frame_fit(const SpaceSeq *sseq, const ARegion *region, rctf v2d_rect)
static void sequencer_space_blend_write(BlendWriter *writer, SpaceLink *sl)
static void sequencer_scrubbing_region_listener(const wmRegionListenerParams *params)
void sequencer_preview_region_draw(const bContext *C, ARegion *region)
static void sequencer_footer_region_listener(const wmRegionListenerParams *params)
static bool sequencer_preview_region_poll(const RegionPollParams *params)
static bool sequencer_scrubbing_region_poll(const RegionPollParams *params)
const char * sequencer_context_dir[]
static bool sequencer_channel_region_poll(const RegionPollParams *params)
static void sequencer_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
rctf sequencer_clamped_view_bounds_get(const bContext *C, ARegion *region)
static SpaceLink * sequencer_create(const ScrArea *, const Scene *scene)
static void sequencer_main_region_listener(const wmRegionListenerParams *params)
void sequencer_blade_handlers_add(ARegion *region)
Strip * strip_under_mouse_get(const Scene *scene, const View2D *v2d, const int mval[2])
static void sequencer_refresh(const bContext *C, ScrArea *area)
static void sequencer_listener(const wmSpaceTypeListenerParams *params)
static void SEQUENCER_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
void sequencer_operatortypes()
static void SEQUENCER_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
static void sequencer_gizmos()
void draw_timeline_seq_display(const bContext *C, ARegion *region)
static void sequencer_scrubbing_region_init(wmWindowManager *, ARegion *region)
void sequencer_scrubbing_region_draw(const bContext *C, ARegion *region)
static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_navigate(wmGizmoGroupType *gzgt)
bool can_select_handle(const Scene *scene, const Strip *strip)
static void sequencer_header_region_init(wmWindowManager *, ARegion *region)
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
static void sequencer_deactivate(ScrArea *area)
static void sequencer_free(SpaceLink *sl)
void draw_channels(const bContext *C, ARegion *region)
static void sequencer_main_cursor(wmWindow *win, ScrArea *area, ARegion *region)
static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *region)
void sequencer_buttons_register(ARegionType *art)
static void sequencer_tools_region_init(wmWindowManager *wm, ARegion *region)
static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
static void sequencer_preview_region_listener(const wmRegionListenerParams *params)
static void sequencer_main_region_draw_overlay(const bContext *C, ARegion *region)
const Strip * sequencer_text_editing_cursor_strip_get(const Scene *scene)
static void sequencer_preview_region_view2d_changed(const bContext *C, ARegion *)
void sequencer_keymap(wmKeyConfig *keyconf)
std::optional< int2 > sequencer_text_editing_cursor_region_xy_get(const Scene *scene, const ARegion *region, const Strip *strip)
static void sequencer_id_remap(ScrArea *, SpaceLink *slink, const bke::id::IDRemapper &mappings)
static void sequencer_main_region_view2d_changed(const bContext *C, ARegion *region)
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:304
bool transform_single_image_check(const Strip *strip)
constexpr int MAX_CHANNELS
DrawViewFn view3d_fn
Definition render.cc:102
void timeline_init_boundbox(const Scene *scene, rctf *r_rect)
void timeline_expand_boundbox(const Scene *scene, const ListBaseT< Strip > *seqbase, rctf *rect)
void preview_cache_invalidate(Scene *scene)
bool transform_is_locked(const ListBaseT< SeqTimelineChannel > *channels, const Strip *strip)
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
Definition channels.cc:26
Mask * active_mask_get(Scene *scene)
bool thumbnail_cache_update_scene_thumbs(const bContext *C, Scene *scene)
bool thumbnail_cache_has_pending_scene_requests(Scene *scene)
float view2d_pixel_size_get_y(const View2D *v2d)
Definition view2d.cc:1924
ARegionType * ED_area_type_hud(int space_type)
char char view2d_mouse_in_scrollers(const ARegion *region, const View2D *v2d, const int xy[2]) ATTR_NONNULL(1
Definition view2d.cc:2044
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1651
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:60
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:56
@ V2D_COMMONVIEW_HEADER
Definition UI_view2d.hh:64
MINLINE float min_ff(float a, float b)
UserDef U
Definition blender.cc:58
ScrArea * CTX_wm_area(const bContext *C)
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_STRIP_END_THUMBNAILS
@ SEQ_TIMELINE_SHOW_STRIP_RETIMING
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_THUMBNAILS
@ SEQ_TIMELINE_WAVEFORMS_HALF
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
Scene * CTX_data_sequencer_scene(const bContext *C)
void ED_region_generic_tools_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition area_utils.cc:30
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
@ V2D_ZOOM_IGNORE_KEEPOFS
@ V2D_VIEWSYNC_AREA_VERTICAL
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:98
PointerRNA RNA_id_pointer_create(ID *id)
void ED_region_panels_ex(const bContext *C, ARegion *region, wm::OpCallContext op_context, const char *contexts[])
Definition area.cc:3988
int ED_area_headersize()
Definition area.cc:4418
wmWindow * CTX_wm_window(const bContext *C)
@ SEQ_VIEW_SEQUENCE_PREVIEW
bool CTX_data_equals(const char *member, const char *str)
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_gizmomap_tag_refresh(wmGizmoMap *gzmap)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
SpaceSeq * CTX_wm_space_seq(const bContext *C)
@ RGN_ALIGN_HIDE_WITH_PREV
Global G
Definition blender.cc:57
void CTX_data_id_pointer_set(bContextDataResult *result, ID *id)
wmWindow * WM_window_find_by_area(wmWindowManager *wm, const ScrArea *area)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBaseT< wmEventHandler > *handlers, ListBaseT< wmDropBox > *dropboxes)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:73
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(wmGizmoGroupType *))
@ SEQ_DRAW_EDIT_POINT_PREVIEW
BMesh const char void * data
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.hh:215
@ SEQ_PREVIEW_SHOW_METADATA
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_COMPOSITION_GUIDES
@ SEQ_PREVIEW_SHOW_GPENCIL
void CTX_data_pointer_set(bContextDataResult *result, ID *id, StructRNA *type, void *data)
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3999
@ SEQ_CACHE_SHOW_FINAL_OUT
void BKE_annotations_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
void BLI_rctf_init_minmax(struct rctf *rect)
Definition rct.cc:494
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:935
bool WM_event_handler_region_v2d_mask_no_marker_poll(const wmWindow *win, const ScrArea *area, const ARegion *region, const wmEvent *event)
void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams *params)
Definition area.cc:442
ARegion * BKE_area_region_new()
Definition screen.cc:522
int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:42
bool CTX_data_dir(const char *member)
@ ED_KEYMAP_UI
Definition ED_screen.hh:852
@ ED_KEYMAP_FOOTER
Definition ED_screen.hh:859
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:858
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:860
@ ED_KEYMAP_TOOL
Definition ED_screen.hh:854
@ ED_KEYMAP_ANIMATION
Definition ED_screen.hh:856
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:855
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:857
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:853
wmEventHandler_Keymap * WM_event_add_keymap_handler_poll(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:1024
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_SCROLL_VERTICAL_HANDLES
@ WM_CURSOR_LEFT_HANDLE
Definition wm_cursors.hh:66
@ WM_CURSOR_BLADE
Definition wm_cursors.hh:34
@ WM_CURSOR_DEFAULT
Definition wm_cursors.hh:17
@ WM_CURSOR_STOP
Definition wm_cursors.hh:20
@ WM_CURSOR_RIGHT_HANDLE
Definition wm_cursors.hh:67
@ WM_CURSOR_SLIP
Definition wm_cursors.hh:69
@ WM_CURSOR_BOTH_HANDLES
Definition wm_cursors.hh:68
void ED_area_init(bContext *C, const wmWindow *win, ScrArea *area)
Definition area.cc:2383
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
void BKE_annotations_free_data(struct bGPdata *gpd, bool free_all)
bool WM_menutype_add(MenuType *mt)
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:379
MINLINE float max_ff(float a, float b)
void ED_region_header_init(ARegion *region)
Definition area.cc:4406
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
void WM_cursor_set(wmWindow *win, int curs)
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
void ED_area_do_mgs_subscribe_for_tool_header(const wmRegionMessageSubscribeParams *params)
Definition area.cc:427
@ RGN_FLAG_HIDDEN_BY_USER
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:813
@ CTX_RESULT_MEMBER_NOT_FOUND
@ ID_REMAP_APPLY_DEFAULT
@ IDWALK_CB_DIRECT_WEAK_LINK
ImBuf * ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, ImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:394
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:4391
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:4006
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(wmGizmoGroupType *))
@ SEQ_SHOW_SCRUBBING_REGION
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void(*) draw_overlay(const bContext *C, ARegion *region)
void(*) cursor(wmWindow *win, ScrArea *area, ARegion *region)
ARegionTypeFlag flag
int(*) snap_size(const ARegion *region, int size, int axis)
void(*) message_subscribe(const wmRegionMessageSubscribeParams *params)
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
void(*) layout(const bContext *C, ARegion *region)
bool(*) poll(const RegionPollParams *params)
std::optional< ARegionIMECursorState >(*) cursor_ime(wmWindow *win, const ScrArea *area, const ARegion *region, ARegionIMECursor *r_cursor)
void(*) on_view2d_changed(const bContext *C, ARegion *region)
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
eRegion_Type regiontype
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
StructRNA * type
Definition RNA_types.hh:63
const bContext * context
struct Editing * ed
struct RenderData r
struct ToolSettings * toolsettings
ListBaseT< ARegion > regionbase
ScrArea_Runtime runtime
ListBaseT< SpaceLink > spacedata
eSpaceSeq_SequencerCacheOverlay_Flag flag
eSpaceSeq_SequencerPreviewOverlay_Flag flag
eSpaceSeq_SequencerTimelineOverlay_Flag flag
eSpaceSeq_Flag flag
struct SequencerPreviewOverlay preview_overlay
ListBaseT< ARegion > regionbase
struct SequencerTimelineOverlay timeline_overlay
ed::vse::SpaceSeq_Runtime * runtime
eSpaceSeq_DrawFlag draw_flag
struct bGPdata * gpd
eSpaceSeq_RegionType mainb
eSpaceSeq_Displays view
struct SequencerCacheOverlay cache_overlay
eView2D_KeepTot keeptot
struct wmTimer * smooth_timer
eView2D_KeepOfs keepofs
eView2D_KeepZoom keepzoom
eView2D_Scroll scroll
eView2D_Align align
struct Scene * sequencer_scene
ListBaseT< wmEventHandler > handlers
wmGizmoMapType_Params gzmap_params
eWM_GizmoFlagGroupTypeFlag flag
unsigned int action
Definition WM_types.hh:371
unsigned int category
Definition WM_types.hh:371
unsigned int data
Definition WM_types.hh:371
bke::WindowRuntime * runtime