Blender V5.0
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 "GPU_immediate.hh"
18#include "GPU_matrix.hh"
19#include "MEM_guardedalloc.h"
20
21#include "BLI_listbase.h"
22#include "BLI_math_base.h"
23#include "BLI_rect.h"
24#include "BLI_string_utf8.h"
25
26#include "BLF_api.hh"
27
28#include "BKE_global.hh"
29#include "BKE_layer.hh"
30#include "BKE_lib_query.hh"
31#include "BKE_lib_remap.hh"
32#include "BKE_screen.hh"
33
35#include "IMB_imbuf.hh"
36
37#include "GPU_state.hh"
38
39#include "ED_markers.hh"
40#include "ED_screen.hh"
41#include "ED_sequencer.hh"
42#include "ED_space_api.hh"
43#include "ED_time_scrub_ui.hh"
44#include "ED_transform.hh"
45#include "ED_util.hh"
46#include "ED_view3d_offscreen.hh" /* Only for sequencer view3d drawing callback. */
47
48#include "WM_api.hh"
49#include "WM_message.hh"
50
51#include "SEQ_channels.hh"
52#include "SEQ_modifier.hh"
53#include "SEQ_offscreen.hh"
54#include "SEQ_preview_cache.hh"
55#include "SEQ_retiming.hh"
56#include "SEQ_sequencer.hh"
57#include "SEQ_time.hh"
58#include "SEQ_transform.hh"
59#include "SEQ_utils.hh"
60
61#include "UI_interface.hh"
62#include "UI_view2d.hh"
63
64#include "BLO_read_write.hh"
65
66/* Own include. */
67#include "sequencer_intern.hh"
68
69namespace blender::ed::vse {
70
71/**************************** common state *****************************/
72
73static void sequencer_scopes_tag_refresh(ScrArea *area, const Scene *scene)
74{
75 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
76 sseq->runtime->scopes.cleanup();
77 seq::preview_cache_invalidate(const_cast<Scene *>(scene));
78}
79
80SpaceSeq_Runtime::~SpaceSeq_Runtime() = default;
81
82/* ******************** default callbacks for sequencer space ***************** */
83
84static SpaceLink *sequencer_create(const ScrArea * /*area*/, const Scene *scene)
85{
86 ARegion *region;
87 SpaceSeq *sseq;
88
89 sseq = MEM_callocN<SpaceSeq>("initsequencer");
90 sseq->spacetype = SPACE_SEQ;
91 sseq->chanshown = 0;
92 sseq->view = SEQ_VIEW_SEQUENCE;
103
104 /* Header. */
105 region = BKE_area_region_new();
106
107 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
108 region->regiontype = RGN_TYPE_HEADER;
110
111 /* Tool header. */
112 region = BKE_area_region_new();
113
114 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
118
119 /* Footer. */
120 region = BKE_area_region_new();
121
122 BLI_addtail(&sseq->regionbase, region);
123 region->regiontype = RGN_TYPE_FOOTER;
125
126 /* Buttons/list view. */
127 region = BKE_area_region_new();
128
129 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
130 region->regiontype = RGN_TYPE_UI;
131 region->alignment = RGN_ALIGN_RIGHT;
132 region->flag = RGN_FLAG_HIDDEN;
133
134 /* Toolbar. */
135 region = BKE_area_region_new();
136
137 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
138 region->regiontype = RGN_TYPE_TOOLS;
139 region->alignment = RGN_ALIGN_LEFT;
140
141 /* Channels. */
142 region = BKE_area_region_new();
143
144 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
146 region->alignment = RGN_ALIGN_LEFT;
148
149 /* Preview region. */
150 /* NOTE: if you change values here, also change them in sequencer_init_preview_region. */
151 region = BKE_area_region_new();
152 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
154 region->alignment = RGN_ALIGN_TOP;
155 /* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
157 region->v2d.minzoom = 0.001f;
158 region->v2d.maxzoom = 1000.0f;
159 region->v2d.tot.xmin = -960.0f; /* 1920 width centered. */
160 region->v2d.tot.ymin = -540.0f; /* 1080 height centered. */
161 region->v2d.tot.xmax = 960.0f;
162 region->v2d.tot.ymax = 540.0f;
163 region->v2d.min[0] = 0.0f;
164 region->v2d.min[1] = 0.0f;
165 region->v2d.max[0] = 12000.0f;
166 region->v2d.max[1] = 12000.0f;
167 region->v2d.cur = region->v2d.tot;
168 region->v2d.align = V2D_ALIGN_FREE;
169 region->v2d.keeptot = V2D_KEEPTOT_FREE;
170
171 /* Main region. */
172 region = BKE_area_region_new();
173
174 BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
175 region->regiontype = RGN_TYPE_WINDOW;
176
177 /* Seq space goes from (0,8) to (0, efra). */
178 region->v2d.tot.xmin = 0.0f;
179 region->v2d.tot.ymin = 0.0f;
180 region->v2d.tot.xmax = scene->r.efra;
181 region->v2d.tot.ymax = 8.5f;
182
183 region->v2d.cur = region->v2d.tot;
184
185 region->v2d.min[0] = 10.0f;
186 region->v2d.min[1] = 1.0f;
187
188 region->v2d.max[0] = MAXFRAMEF;
189 region->v2d.max[1] = seq::MAX_CHANNELS;
190
191 region->v2d.minzoom = 0.01f;
192 region->v2d.maxzoom = 100.0f;
193
196 region->v2d.keepzoom = V2D_KEEPZOOM;
198 region->v2d.keeptot = V2D_KEEPTOT_FREE;
200 region->v2d.align = V2D_ALIGN_NO_NEG_Y;
201
202 return (SpaceLink *)sseq;
203}
204
205/* Not spacelink itself. */
206static void sequencer_free(SpaceLink *sl)
207{
208 SpaceSeq *sseq = (SpaceSeq *)sl;
209 MEM_delete(sseq->runtime);
210
211#if 0
212 if (sseq->gpd) {
214 }
215#endif
216}
217
218/* Space-type init callback. */
219static void sequencer_init(wmWindowManager * /*wm*/, ScrArea *area)
220{
221 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
222 if (sseq->runtime == nullptr) {
223 sseq->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
224 }
225}
226
227static void sequencer_refresh(const bContext *C, ScrArea *area)
228{
229 const wmWindow *window = CTX_wm_window(C);
230 SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
232 ARegion *region_preview = BKE_area_find_region_type(area, RGN_TYPE_PREVIEW);
233 bool view_changed = false;
234
235 switch (sseq->view) {
236 case SEQ_VIEW_PREVIEW:
237 /* Reset scrolling when preview region just appears. */
238 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
239 region_preview->v2d.cur = region_preview->v2d.tot;
240 /* Only redraw, don't re-init. */
241 ED_area_tag_redraw(area);
242 }
243 if (region_preview->alignment != RGN_ALIGN_NONE) {
244 region_preview->alignment = RGN_ALIGN_NONE;
245 view_changed = true;
246 }
247 break;
249 /* Get available height (without DPI correction). */
250 const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
251
252 /* We reuse hidden region's size, allows to find same layout as before if we just switch
253 * between one 'full window' view and the combined one. This gets lost if we switch to both
254 * 'full window' views before, though... Better than nothing. */
255 if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
256 region_preview->v2d.cur = region_preview->v2d.tot;
257 region_main->sizey = int(height - region_preview->sizey);
258 region_preview->sizey = int(height - region_main->sizey);
259 view_changed = true;
260 }
261 if (region_preview->alignment != RGN_ALIGN_TOP) {
262 region_preview->alignment = RGN_ALIGN_TOP;
263 view_changed = true;
264 }
265 /* Final check that both preview and main height are reasonable. */
266 if (region_preview->sizey < 10 || region_main->sizey < 10 ||
267 region_preview->sizey + region_main->sizey > height)
268 {
269 region_preview->sizey = roundf(height * 0.4f);
270 region_main->sizey = int(height - region_preview->sizey);
271 view_changed = true;
272 }
273 break;
274 }
276 break;
277 }
278
279 if (view_changed) {
280 ED_area_init(const_cast<bContext *>(C), window, area);
281 ED_area_tag_redraw(area);
282 }
283}
284
286{
287 SpaceSeq *sseqn = static_cast<SpaceSeq *>(MEM_dupallocN(sl));
288 sseqn->runtime = MEM_new<SpaceSeq_Runtime>(__func__);
289
290 /* Clear or remove stuff from old. */
291 // sseq->gpd = gpencil_data_duplicate(sseq->gpd, false);
292
293 return (SpaceLink *)sseqn;
294}
295
297{
298 ScrArea *area = params->area;
299 const wmNotifier *wmn = params->notifier;
300
301 /* Context changes. */
302 switch (wmn->category) {
303 case NC_SCENE:
304 switch (wmn->data) {
305 case ND_FRAME:
306 case ND_SEQUENCER:
308 break;
309 }
310 break;
311 case NC_WINDOW:
312 case NC_SPACE:
313 if (wmn->data == ND_SPACE_SEQUENCER) {
315 }
316 break;
317 case NC_GPENCIL:
318 if (wmn->data & ND_GPENCIL_EDITMODE) {
319 ED_area_tag_redraw(area);
320 }
321 break;
322 }
323}
324
325/* DO NOT make this static, this hides the symbol and breaks API generation script. */
326extern "C" const char *sequencer_context_dir[]; /* Quiet warning. */
327const char *sequencer_context_dir[] = {"edit_mask", "tool_settings", nullptr};
328
329static int /*eContextResult*/ sequencer_context(const bContext *C,
330 const char *member,
332{
334
335 if (CTX_data_dir(member)) {
337
338 return CTX_RESULT_OK;
339 }
340 if (CTX_data_equals(member, "tool_settings")) {
341 if (scene) {
342 CTX_data_pointer_set(result, &scene->id, &RNA_ToolSettings, scene->toolsettings);
343 return CTX_RESULT_OK;
344 }
345 }
346 if (CTX_data_equals(member, "edit_mask")) {
347 if (scene) {
349 if (mask) {
351 }
352 return CTX_RESULT_OK;
353 }
354 }
355
357}
358
360{
361 VIEW2D_GGT_navigate_impl(gzgt, "SEQUENCER_GGT_navigate");
362}
363
365{
366 gzgt->name = "Sequencer Transform Gizmo";
367 gzgt->idname = "SEQUENCER_GGT_gizmo2d";
368
371
374
376}
377
379{
380 gzgt->name = "Sequencer Translate Gizmo";
381 gzgt->idname = "SEQUENCER_GGT_gizmo2d_translate";
382
385
388
390}
391
393{
394 gzgt->name = "Sequencer Transform Gizmo Resize";
395 gzgt->idname = "SEQUENCER_GGT_gizmo2d_resize";
396
399
402
404}
405
407{
408 gzgt->name = "Sequencer Transform Gizmo Resize";
409 gzgt->idname = "SEQUENCER_GGT_gizmo2d_rotate";
410
413
416
418}
419
431
432/* *********************** sequencer (main) region ************************ */
433
435{
436 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
438}
439
440/* Add handlers, stuff you only do once or on area/region changes. */
442{
443 wmKeyMap *keymap;
444 ListBase *lb;
445
446 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
447
448#if 0
449 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
450 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
451#endif
452
453 keymap = WM_keymap_ensure(
454 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
455 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
456
457 /* Own keymap. */
458 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
460 &region->runtime->handlers, keymap, WM_event_handler_region_v2d_mask_no_marker_poll);
461
462 /* Add drop boxes. */
463 lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
464
465 WM_event_add_dropbox_handler(&region->runtime->handlers, lb);
466}
467
468/* Strip editing timeline. */
469static void sequencer_main_region_draw(const bContext *C, ARegion *region)
470{
471 draw_timeline_seq(C, region);
472}
473
474/* Strip editing timeline. */
476{
478}
479
480static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
481{
482 SpaceSeq *sseq = CTX_wm_space_seq(C);
483
484 if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
485 return;
486 }
487
488 View2D *v2d = &region->v2d;
490 if (!scene) {
491 return;
492 }
493
494 /* Transformation uses edge panning to move view. Also if smooth view is running, don't apply
495 * clamping to prevent overriding this functionality. */
496 if (G.moving || v2d->smooth_timer != nullptr) {
497 return;
498 }
499
500 rctf strip_boundbox;
501 /* Initialize default view with 7 channels, that are visible even if empty. */
502 seq::timeline_init_boundbox(scene, &strip_boundbox);
503 Editing *ed = seq::editing_get(scene);
504 if (ed != nullptr) {
505 seq::timeline_expand_boundbox(scene, ed->current_strips(), &strip_boundbox);
506 }
507 /* We need to calculate how much the current view is padded and add this padding to our
508 * strip bounding box. Without this, the scrub-bar or other overlays would occlude the
509 * displayed strips in the timeline.
510 */
511 float pad_top, pad_bottom;
512 SEQ_get_timeline_region_padding(C, &pad_top, &pad_bottom);
513 const float pixel_view_size_y = BLI_rctf_size_y(&v2d->cur) / (BLI_rcti_size_y(&v2d->mask) + 1);
514 /* Add padding to be able to scroll the view so that the collapsed redo panel doesn't occlude any
515 * strips. */
516 float bottom_channel_padding = UI_MARKER_MARGIN_Y * pixel_view_size_y;
517 bottom_channel_padding = std::max(bottom_channel_padding, 1.0f);
518 /* Add the padding and make sure we have a margin of one channel in each direction. */
519 strip_boundbox.ymax += 1.0f + pad_top * pixel_view_size_y;
520 strip_boundbox.ymin -= bottom_channel_padding;
521
522 /* If a strip has been deleted, don't move the view automatically, keep current range until it is
523 * changed. */
524 strip_boundbox.ymax = max_ff(sseq->runtime->timeline_clamp_custom_range, strip_boundbox.ymax);
525
526 rctf view_clamped = v2d->cur;
527 float range_y = BLI_rctf_size_y(&view_clamped);
528 if (view_clamped.ymax > strip_boundbox.ymax) {
529 view_clamped.ymax = strip_boundbox.ymax;
530 view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
531 }
532 else if (view_clamped.ymin < strip_boundbox.ymin) {
533 view_clamped.ymin = strip_boundbox.ymin;
534 view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
535 }
536
537 v2d->cur = view_clamped;
538}
539
541{
542 SpaceSeq *sseq = CTX_wm_space_seq(C);
543 View2D *v2d = &region->v2d;
544
545 if ((v2d->flag & V2D_IS_NAVIGATING) == 0) {
547 }
548}
549
555
561
563{
564 ARegion *region = params->region;
565 const wmNotifier *wmn = params->notifier;
566
567 /* Context changes. */
568 switch (wmn->category) {
569 case NC_SCENE:
570 switch (wmn->data) {
571 case ND_FRAME:
572 case ND_FRAME_RANGE:
573 case ND_MARKERS:
574 case ND_RENDER_OPTIONS: /* For FPS and FPS Base. */
575 case ND_SEQUENCER:
576 case ND_RENDER_RESULT:
577 ED_region_tag_redraw(region);
578 WM_gizmomap_tag_refresh(region->runtime->gizmo_map);
579 break;
580 }
581 break;
582 case NC_ANIMATION:
583 switch (wmn->data) {
584 case ND_KEYFRAME:
585 ED_region_tag_redraw(region);
586 break;
587 }
588 break;
589 case NC_SPACE:
590 if (wmn->data == ND_SPACE_SEQUENCER) {
591 ED_region_tag_redraw(region);
592 WM_gizmomap_tag_refresh(region->runtime->gizmo_map);
593 }
594 break;
595 case NC_ID:
596 if (wmn->action == NA_RENAME) {
597 ED_region_tag_redraw(region);
598 }
599 break;
600 case NC_SCREEN:
601 if (ELEM(wmn->data, ND_ANIMPLAY)) {
602 ED_region_tag_redraw(region);
603 WM_gizmomap_tag_refresh(region->runtime->gizmo_map);
604 }
605 break;
606 }
607}
608
610{
611 wmMsgBus *mbus = params->message_bus;
612 Scene *scene = params->scene;
613 ARegion *region = params->region;
614
615 wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
616 msg_sub_value_region_tag_redraw.owner = region;
617 msg_sub_value_region_tag_redraw.user_data = region;
618 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
619
620 /* Timeline depends on scene properties. */
621 {
622 bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
623 const PropertyRNA *props[] = {
624 use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
625 use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
626 &rna_Scene_use_preview_range,
627 &rna_Scene_frame_current,
628 };
629
630 PointerRNA idptr = RNA_id_pointer_create(&scene->id);
631
632 for (int i = 0; i < ARRAY_SIZE(props); i++) {
633 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
634 }
635 }
636
637 {
638 StructRNA *type_array[] = {
639 &RNA_SequenceEditor,
640
641 &RNA_Strip,
642 /* Members of 'Strip'. */
643 &RNA_StripCrop,
644 &RNA_StripTransform,
645 &RNA_StripModifier,
646 &RNA_StripColorBalanceData,
647 };
648 wmMsgParams_RNA msg_key_params = {{}};
649 for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
650 msg_key_params.ptr.type = type_array[i];
652 mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
653 }
654 }
655}
656
657static bool is_mouse_over_retiming_key(const Scene *scene,
658 const Strip *strip,
659 const View2D *v2d,
660 const ScrArea *area,
661 float mouse_co_region[2])
662{
663 const SpaceSeq *sseq = static_cast<SpaceSeq *>(area->spacedata.first);
664
666 return false;
667 }
668
669 rctf retiming_keys_box = strip_retiming_keys_box_get(scene, v2d, strip);
670 return BLI_rctf_isect_pt_v(&retiming_keys_box, mouse_co_region);
671}
672
673static void sequencer_main_cursor(wmWindow *win, ScrArea *area, ARegion *region)
674{
675 const WorkSpace *workspace = WM_window_get_active_workspace(win);
676 const Scene *scene = workspace->sequencer_scene;
677 const Editing *ed = seq::editing_get(scene);
678 const bToolRef *tref = area->runtime.tool;
679
680 int wmcursor = WM_CURSOR_DEFAULT;
681
682 if (tref == nullptr || scene == nullptr || ed == nullptr) {
683 WM_cursor_set(win, wmcursor);
684 return;
685 }
686
687 rcti scrub_rect = region->winrct;
688 scrub_rect.ymin = scrub_rect.ymax - UI_TIME_SCRUB_MARGIN_Y;
689 if (BLI_rcti_isect_pt_v(&scrub_rect, win->eventstate->xy)) {
690 WM_cursor_set(win, wmcursor);
691 return;
692 }
693
694 const View2D *v2d = &region->v2d;
695 if (UI_view2d_mouse_in_scrollers(region, v2d, win->eventstate->xy)) {
696 WM_cursor_set(win, wmcursor);
697 return;
698 }
699
700 float mouse_co_region[2] = {float(win->eventstate->xy[0] - region->winrct.xmin),
701 float(win->eventstate->xy[1] - region->winrct.ymin)};
702 float mouse_co_view[2];
704 &region->v2d, mouse_co_region[0], mouse_co_region[1], &mouse_co_view[0], &mouse_co_view[1]);
705
706 if (STREQ(tref->idname, "builtin.blade") || STREQ(tref->idname, "builtin.slip")) {
707 int mval[2] = {int(mouse_co_region[0]), int(mouse_co_region[1])};
708 Strip *strip = strip_under_mouse_get(scene, v2d, mval);
709 if (strip != nullptr) {
711 const bool locked = seq::transform_is_locked(channels, strip);
712 const int frame = round_fl_to_int(mouse_co_view[0]);
713 /* We cannot split the first and last frame, so blade cursor should not appear then. */
714 if (STREQ(tref->idname, "builtin.blade") &&
715 frame != seq::time_left_handle_frame_get(scene, strip) &&
716 frame != seq::time_right_handle_frame_get(scene, strip))
717 {
718 wmcursor = locked ? WM_CURSOR_STOP : WM_CURSOR_BLADE;
719 }
720 else if (STREQ(tref->idname, "builtin.slip")) {
721 wmcursor = (locked || seq::transform_single_image_check(strip)) ? WM_CURSOR_STOP :
723 }
724 }
725 WM_cursor_set(win, wmcursor);
726 return;
727 }
728
729 if (ed == nullptr) {
730 WM_cursor_set(win, wmcursor);
731 return;
732 }
733
734 StripSelection selection = pick_strip_and_handle(scene, &region->v2d, mouse_co_view);
735
736 if (selection.strip1 == nullptr) {
737 WM_cursor_set(win, wmcursor);
738 return;
739 }
740
741 if (is_mouse_over_retiming_key(scene, selection.strip1, &region->v2d, area, mouse_co_region)) {
742 WM_cursor_set(win, wmcursor);
743 return;
744 }
745
746 if (!can_select_handle(scene, selection.strip1, v2d)) {
747 WM_cursor_set(win, wmcursor);
748 return;
749 }
750
751 if (selection.strip1 != nullptr && selection.strip2 != nullptr) {
752 wmcursor = WM_CURSOR_BOTH_HANDLES;
753 }
754 else if (selection.handle == STRIP_HANDLE_LEFT) {
755 wmcursor = WM_CURSOR_LEFT_HANDLE;
756 }
757 else if (selection.handle == STRIP_HANDLE_RIGHT) {
758 wmcursor = WM_CURSOR_RIGHT_HANDLE;
759 }
760
761 WM_cursor_set(win, wmcursor);
762}
763
764/* *********************** header region ************************ */
765/* Add handlers, stuff you only do once or on area/region changes. */
767{
768 ED_region_header_init(region);
769}
770
771static void sequencer_header_region_draw(const bContext *C, ARegion *region)
772{
773 ED_region_header(C, region);
774}
775
777{
778 ARegion *region = params->region;
779 const wmNotifier *wmn = params->notifier;
780
781 /* context changes */
782 switch (wmn->category) {
783 case NC_SCREEN:
784 if (wmn->data == ND_ANIMPLAY) {
785 ED_region_tag_redraw(region);
786 }
787 break;
788 case NC_SCENE:
789 switch (wmn->data) {
790 case ND_FRAME:
791 ED_region_tag_redraw(region);
792 break;
793 }
794 break;
795 }
796}
797
798/* *********************** toolbar region ************************ */
799/* Add handlers, stuff you only do once or on area/region changes. */
801{
802 wmKeyMap *keymap;
803
805 ED_region_panels_init(wm, region);
806
807 keymap = WM_keymap_ensure(
808 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
809 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
810}
811
812static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
813{
814 ScrArea *area = CTX_wm_area(C);
816
817 LISTBASE_FOREACH (ARegion *, ar, &area->regionbase) {
818 if (ar->regiontype == RGN_TYPE_PREVIEW && region->regiontype == RGN_TYPE_TOOLS) {
820 break;
821 }
822 }
823
824 if (region->regiontype == RGN_TYPE_CHANNELS) {
826 }
827
828 ED_region_panels_ex(C, region, op_context, nullptr);
829}
830/* *********************** preview region ************************ */
831
833{
834 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
836}
837
839{
840 wmKeyMap *keymap;
841
842 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
843
844#if 0
845 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Mask Editing", SPACE_EMPTY, RGN_TYPE_WINDOW);
846 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
847#endif
848
849 /* Own keymap. */
850 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Preview", SPACE_SEQ, RGN_TYPE_WINDOW);
851 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
852
853 keymap = WM_keymap_ensure(
854 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
855 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
856
857 /* Do this instead of adding V2D and frames `ED_KEYMAP_*` flags to `art->keymapflag`, since text
858 * editing conflicts with several of their keymap items (e.g. arrow keys when editing text or
859 * advancing frames). This seems to be the best way to define the proper order of evaluation. */
860 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "View2D", SPACE_EMPTY, RGN_TYPE_WINDOW);
861 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
862
863 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "Frames", SPACE_EMPTY, RGN_TYPE_WINDOW);
864 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
865
867 WM_event_add_dropbox_handler(&region->runtime->handlers, lb);
868}
869
871{
872 SpaceSeq *sseq = CTX_wm_space_seq(C);
873
874 if (sseq->flag & SEQ_ZOOM_TO_FIT) {
875 View2D *v2d = &region->v2d;
876 v2d->cur = v2d->tot;
877 }
878}
879
881{
882 SpaceSeq *sseq = CTX_wm_space_seq(C);
883 sseq->flag &= ~SEQ_ZOOM_TO_FIT;
884}
885
887{
888 ARegion *region = params->region;
889 const wmNotifier *wmn = params->notifier;
890
891 WM_gizmomap_tag_refresh(region->runtime->gizmo_map);
892
893 /* Context changes. */
894 switch (wmn->category) {
895 case NC_OBJECT: /* To handle changes in 3D viewport. */
896 switch (wmn->data) {
897 case ND_BONE_ACTIVE:
898 case ND_BONE_SELECT:
900 case ND_TRANSFORM:
901 case ND_POSE:
902 case ND_DRAW:
903 case ND_MODIFIER:
904 case ND_SHADERFX:
905 case ND_CONSTRAINT:
906 case ND_KEYS:
907 case ND_PARTICLE:
908 case ND_POINTCACHE:
909 case ND_LOD:
910 case ND_DRAW_ANIMVIZ:
911 ED_region_tag_redraw(region);
912 break;
913 }
914 switch (wmn->action) {
915 case NA_ADDED:
916 ED_region_tag_redraw(region);
917 break;
918 }
919 break;
920 case NC_GEOM: /* To handle changes in 3D viewport. */
921 switch (wmn->data) {
922 case ND_DATA:
923 case ND_VERTEX_GROUP:
924 ED_region_tag_redraw(region);
925 break;
926 }
927 switch (wmn->action) {
928 case NA_EDITED:
929 ED_region_tag_redraw(region);
930 break;
931 }
932 break;
933 case NC_MATERIAL: /* To handle changes in 3D viewport. */
934 switch (wmn->data) {
935 case ND_SHADING:
936 case ND_NODES:
937 case ND_SHADING_DRAW:
938 case ND_SHADING_LINKS:
939 ED_region_tag_redraw(region);
940 break;
941 }
942 break;
943 case NC_NODE: /* To handle changes in 3D viewport. */
944 ED_region_tag_redraw(region);
945 break;
946 case NC_WORLD: /* To handle changes in 3D viewport. */
947 switch (wmn->data) {
948 case ND_WORLD_DRAW:
949 case ND_WORLD:
950 ED_region_tag_redraw(region);
951 break;
952 }
953 break;
954 case NC_LAMP: /* To handle changes in 3D viewport. */
955 switch (wmn->data) {
956 case ND_LIGHTING:
957 case ND_LIGHTING_DRAW:
958 ED_region_tag_redraw(region);
959 break;
960 }
961 break;
962 case NC_LIGHTPROBE: /* To handle changes in 3D viewport. */
963 case NC_IMAGE:
964 case NC_TEXTURE:
965 ED_region_tag_redraw(region);
966 break;
967 case NC_MOVIECLIP: /* To handle changes in 3D viewport. */
968 if (wmn->data == ND_DISPLAY || wmn->action == NA_EDITED) {
969 ED_region_tag_redraw(region);
970 }
971 break;
972
973 case NC_GPENCIL:
974 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
975 ED_region_tag_redraw(region);
976 }
977 break;
978 case NC_SCENE:
979 switch (wmn->data) {
980 /* To handle changes in 3D viewport. */
981 case ND_LAYER_CONTENT:
982 case ND_LAYER:
983 case ND_TRANSFORM:
984 case ND_OB_VISIBLE:
985 /* VSE related. */
986 case ND_FRAME:
987 case ND_MARKERS:
988 case ND_SEQUENCER:
991 ED_region_tag_redraw(region);
992 break;
993 }
994 break;
995 case NC_ANIMATION:
996 switch (wmn->data) {
997 /* To handle changes in 3D viewport. */
998 case ND_NLA_ACTCHANGE:
999 case ND_NLA:
1000 case ND_ANIMCHAN:
1001 /* VSE related. */
1002 case ND_KEYFRAME:
1003 ED_region_tag_redraw(region);
1004 break;
1005 }
1006 break;
1007 case NC_SPACE:
1008 if (wmn->data == ND_SPACE_SEQUENCER) {
1009 ED_region_tag_redraw(region);
1010 }
1011 break;
1012 case NC_ID:
1013 switch (wmn->data) {
1014 case NA_RENAME:
1015 ED_region_tag_redraw(region);
1016 break;
1017 }
1018 break;
1019 case NC_MASK:
1020 if (wmn->action == NA_EDITED) {
1021 ED_region_tag_redraw(region);
1022 }
1023 break;
1024 }
1025}
1026
1027/* *********************** buttons region ************************ */
1028
1029/* Add handlers, stuff you only do once or on area/region changes. */
1031{
1032 wmKeyMap *keymap;
1033
1034 keymap = WM_keymap_ensure(
1035 wm->runtime->defaultconf, "Video Sequence Editor", SPACE_SEQ, RGN_TYPE_WINDOW);
1036 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
1037
1038 ED_region_panels_init(wm, region);
1039}
1040
1042{
1043 ED_region_panels(C, region);
1044}
1045
1047{
1048 ARegion *region = params->region;
1049 const wmNotifier *wmn = params->notifier;
1050
1051 /* Context changes. */
1052 switch (wmn->category) {
1053 case NC_GPENCIL:
1054 if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
1055 ED_region_tag_redraw(region);
1056 }
1057 break;
1058 case NC_SCENE:
1059 switch (wmn->data) {
1060 case ND_FRAME:
1061 case ND_SEQUENCER:
1062 ED_region_tag_redraw(region);
1063 break;
1064 }
1065 break;
1066 case NC_SPACE:
1067 if (wmn->data == ND_SPACE_SEQUENCER) {
1068 ED_region_tag_redraw(region);
1069 }
1070 break;
1071 case NC_ID:
1072 if (wmn->action == NA_RENAME) {
1073 ED_region_tag_redraw(region);
1074 }
1075 break;
1076 }
1077}
1078
1079static void sequencer_id_remap(ScrArea * /*area*/,
1080 SpaceLink *slink,
1081 const blender::bke::id::IDRemapper &mappings)
1082{
1083 SpaceSeq *sseq = (SpaceSeq *)slink;
1084 mappings.apply(reinterpret_cast<ID **>(&sseq->gpd), ID_REMAP_APPLY_DEFAULT);
1085}
1086
1088{
1089 SpaceSeq *sseq = reinterpret_cast<SpaceSeq *>(space_link);
1091}
1092
1093/* ************************************* */
1094
1096{
1097 const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
1098 return ELEM(sseq->view, SEQ_VIEW_SEQUENCE);
1099}
1100
1101/* add handlers, stuff you only do once or on area/region changes */
1103{
1104 wmKeyMap *keymap;
1105
1106 region->alignment = RGN_ALIGN_LEFT;
1107
1108 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
1109
1110 keymap = WM_keymap_ensure(
1111 wm->runtime->defaultconf, "Sequencer Channels", SPACE_SEQ, RGN_TYPE_WINDOW);
1112 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
1113}
1114
1116{
1117 draw_channels(C, region);
1118}
1119
1121{
1122 SpaceSeq *sseq = (SpaceSeq *)sl;
1123
1124 sseq->runtime = nullptr;
1125
1126 /* grease pencil data is not a direct data and can't be linked from direct_link*
1127 * functions, it should be linked from lib_link* functions instead
1128 *
1129 * otherwise it'll lead to lost grease data on open because it'll likely be
1130 * read from file after all other users of grease pencil and newdataadr would
1131 * simple return nullptr here (sergey)
1132 */
1133#if 0
1134 if (sseq->gpd) {
1135 sseq->gpd = newdataadr(fd, sseq->gpd);
1137 }
1138#endif
1139}
1140
1142{
1143 BLO_write_struct(writer, SpaceSeq, sl);
1144}
1145
1147{
1148 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1149 ARegionType *art;
1150
1151 st->spaceid = SPACE_SEQ;
1152 STRNCPY_UTF8(st->name, "Sequencer");
1153
1154 st->create = sequencer_create;
1155 st->free = sequencer_free;
1156 st->init = sequencer_init;
1157 st->duplicate = sequencer_duplicate;
1158 st->operatortypes = sequencer_operatortypes;
1159 st->keymap = sequencer_keymap;
1160 st->context = sequencer_context;
1161 st->gizmos = sequencer_gizmos;
1162 st->dropboxes = sequencer_dropboxes;
1163 st->refresh = sequencer_refresh;
1164 st->listener = sequencer_listener;
1165 st->id_remap = sequencer_id_remap;
1166 st->foreach_id = sequencer_foreach_id;
1167 st->blend_read_data = sequencer_space_blend_read_data;
1168 st->blend_read_after_liblink = nullptr;
1169 st->blend_write = sequencer_space_blend_write;
1170
1171 /* Create regions: */
1172 /* Main window. */
1173 art = MEM_callocN<ARegionType>("spacetype sequencer region");
1186 art->event_cursor = true;
1187 art->clip_gizmo_events_by_ui = true;
1188 BLI_addhead(&st->regiontypes, art);
1189
1190 /* Preview. */
1191 art = MEM_callocN<ARegionType>("spacetype sequencer region");
1200 BLI_addhead(&st->regiontypes, art);
1201
1202 /* List-view/buttons. */
1203 art = MEM_callocN<ARegionType>("spacetype sequencer region");
1204 art->regionid = RGN_TYPE_UI;
1205 art->prefsizex = UI_SIDEBAR_PANEL_WIDTH * 1.3f;
1212 BLI_addhead(&st->regiontypes, art);
1213
1215 /* Toolbar. */
1216 art = MEM_callocN<ARegionType>("spacetype sequencer tools region");
1217 art->regionid = RGN_TYPE_TOOLS;
1218 art->prefsizex = int(UI_TOOLBAR_WIDTH);
1219 art->prefsizey = 50; /* XXX */
1226 BLI_addhead(&st->regiontypes, art);
1227
1228 /* Channels. */
1229 art = MEM_callocN<ARegionType>("spacetype sequencer channels");
1232 art->keymapflag = ED_KEYMAP_UI;
1237 BLI_addhead(&st->regiontypes, art);
1238
1239 /* Tool header. */
1240 art = MEM_callocN<ARegionType>("spacetype sequencer tool header region");
1242 art->prefsizey = HEADERY;
1248 BLI_addhead(&st->regiontypes, art);
1249
1250 /* Header. */
1251 art = MEM_callocN<ARegionType>("spacetype sequencer region");
1253 art->prefsizey = HEADERY;
1255
1259 BLI_addhead(&st->regiontypes, art);
1260
1261 /* Footer. */
1262 art = MEM_callocN<ARegionType>("spacetype sequencer region");
1264 art->prefsizey = HEADERY;
1266
1270 BLI_addhead(&st->regiontypes, art);
1271
1272 /* HUD. */
1273 art = ED_area_type_hud(st->spaceid);
1274 BLI_addhead(&st->regiontypes, art);
1275
1279
1280 BKE_spacetype_register(std::move(st));
1281
1282 /* Set the sequencer callback when not in background mode. */
1283 if (G.background == 0) {
1285 }
1286}
1287
1288} // namespace blender::ed::vse
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
bool CTX_data_equals(const char *member, const char *str)
void CTX_data_pointer_set(bContextDataResult *result, ID *id, StructRNA *type, void *data)
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
SpaceSeq * CTX_wm_space_seq(const bContext *C)
Scene * CTX_data_sequencer_scene(const bContext *C)
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:282
ARegion * BKE_area_region_new()
Definition screen.cc:387
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
Definition screen.cc:846
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:91
MINLINE int round_fl_to_int(float a)
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:198
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:206
#define STRNCPY_UTF8(dst, src)
#define ARRAY_SIZE(arr)
#define ELEM(...)
#define STREQ(a, b)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define MAXFRAMEF
@ SCER_PRV_RANGE
#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_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ 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_DRAW_TRANSFORM_PREVIEW
@ 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
#define UI_SCALE_FAC
@ USER_HEADER_BOTTOM
@ V2D_KEEPOFS_Y
@ V2D_KEEPOFS_X
@ V2D_IS_NAVIGATING
@ V2D_IS_INIT
@ V2D_ZOOM_IGNORE_KEEPOFS
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_KEEPTOT_FREE
@ V2D_LIMITZOOM
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_FREE
void ED_area_do_mgs_subscribe_for_tool_header(const wmRegionMessageSubscribeParams *params)
Definition area.cc:394
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:693
ARegionType * ED_area_type_hud(int space_type)
void ED_area_init(bContext *C, const wmWindow *win, ScrArea *area)
Definition area.cc:2140
void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams *params)
Definition area.cc:409
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3609
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:3935
void ED_region_header_init(ARegion *region)
Definition area.cc:3950
int ED_area_headersize()
Definition area.cc:3956
void ED_region_panels_ex(const bContext *C, ARegion *region, blender::wm::OpCallContext op_context, const char *contexts[])
Definition area.cc:3598
int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:40
void ED_region_generic_tools_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition area_utils.cc:28
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
Definition area_utils.cc:71
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:3616
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:618
@ ED_KEYMAP_UI
Definition ED_screen.hh:758
@ ED_KEYMAP_ANIMATION
Definition ED_screen.hh:762
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:764
@ ED_KEYMAP_TOOL
Definition ED_screen.hh:760
@ ED_KEYMAP_GPENCIL
Definition ED_screen.hh:766
@ ED_KEYMAP_GIZMO
Definition ED_screen.hh:759
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:761
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:763
@ ED_KEYMAP_FOOTER
Definition ED_screen.hh:765
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:361
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])
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_TOOLBAR_WIDTH
#define UI_COMPACT_PANEL_WIDTH
#define UI_MARKER_MARGIN_Y
Definition UI_view2d.hh:478
char char UI_view2d_mouse_in_scrollers(const ARegion *region, const View2D *v2d, const int xy[2]) ATTR_NONNULL(1
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:221
void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname)
#define UI_TIME_SCRUB_MARGIN_Y
Definition UI_view2d.hh:479
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:1668
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:35
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:31
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
#define ND_SEQUENCER
Definition WM_types.hh:437
#define NC_WORLD
Definition WM_types.hh:387
#define ND_SHADING
Definition WM_types.hh:477
#define ND_WORLD
Definition WM_types.hh:452
#define ND_SPACE_SEQUENCER
Definition WM_types.hh:535
#define NC_WINDOW
Definition WM_types.hh:375
#define NC_ID
Definition WM_types.hh:395
#define NC_NODE
Definition WM_types.hh:394
#define NC_GEOM
Definition WM_types.hh:393
#define ND_NLA_ACTCHANGE
Definition WM_types.hh:498
#define ND_DRAW
Definition WM_types.hh:461
#define ND_RENDER_RESULT
Definition WM_types.hh:446
#define ND_DATA
Definition WM_types.hh:509
#define ND_GPENCIL_EDITMODE
Definition WM_types.hh:504
#define ND_LIGHTING_DRAW
Definition WM_types.hh:484
#define ND_RENDER_OPTIONS
Definition WM_types.hh:435
#define NC_ANIMATION
Definition WM_types.hh:388
#define ND_VERTEX_GROUP
Definition WM_types.hh:510
#define ND_DISPLAY
Definition WM_types.hh:491
#define ND_LOD
Definition WM_types.hh:468
#define NC_SCREEN
Definition WM_types.hh:377
#define NC_MOVIECLIP
Definition WM_types.hh:397
#define ND_ANIMPLAY
Definition WM_types.hh:424
#define NC_SCENE
Definition WM_types.hh:378
#define NA_ADDED
Definition WM_types.hh:586
#define ND_OB_VISIBLE
Definition WM_types.hh:443
#define ND_LAYER_CONTENT
Definition WM_types.hh:453
#define ND_NODES
Definition WM_types.hh:436
#define ND_MODIFIER
Definition WM_types.hh:462
#define ND_POSE
Definition WM_types.hh:458
#define NA_EDITED
Definition WM_types.hh:584
#define ND_PARTICLE
Definition WM_types.hh:465
#define ND_FRAME_RANGE
Definition WM_types.hh:451
#define NC_MATERIAL
Definition WM_types.hh:380
#define NC_LAMP
Definition WM_types.hh:382
#define NC_IMAGE
Definition WM_types.hh:384
#define ND_CONSTRAINT
Definition WM_types.hh:464
#define ND_MARKERS
Definition WM_types.hh:433
#define ND_FRAME
Definition WM_types.hh:434
#define NC_GPENCIL
Definition WM_types.hh:399
#define ND_NLA
Definition WM_types.hh:497
#define NC_TEXTURE
Definition WM_types.hh:381
#define ND_LIGHTING
Definition WM_types.hh:483
#define ND_BONE_ACTIVE
Definition WM_types.hh:459
#define ND_TRANSFORM
Definition WM_types.hh:456
#define ND_LAYER
Definition WM_types.hh:450
#define ND_BONE_COLLECTION
Definition WM_types.hh:474
#define NC_MASK
Definition WM_types.hh:398
#define ND_KEYS
Definition WM_types.hh:463
#define NA_RENAME
Definition WM_types.hh:588
#define NC_LIGHTPROBE
Definition WM_types.hh:402
#define ND_POINTCACHE
Definition WM_types.hh:466
#define ND_SHADERFX
Definition WM_types.hh:471
#define ND_WORLD_DRAW
Definition WM_types.hh:487
#define ND_DRAW_ANIMVIZ
Definition WM_types.hh:473
#define ND_BONE_SELECT
Definition WM_types.hh:460
#define ND_KEYFRAME
Definition WM_types.hh:494
#define NC_OBJECT
Definition WM_types.hh:379
#define ND_ANIMCHAN
Definition WM_types.hh:496
#define ND_SHADING_LINKS
Definition WM_types.hh:479
#define ND_SHADING_DRAW
Definition WM_types.hh:478
#define NC_SPACE
Definition WM_types.hh:392
#define NA_SELECTED
Definition WM_types.hh:589
#define ND_DRAW_RENDER_VIEWPORT
Definition WM_types.hh:470
#define U
BMesh const char void * data
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
nullptr float
#define roundf(x)
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void * MEM_dupallocN(const void *vmemh)
Definition mallocn.cc:143
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
#define G(x, y, z)
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 bool is_mouse_over_retiming_key(const Scene *scene, const Strip *strip, const View2D *v2d, const ScrArea *area, float mouse_co_region[2])
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_init(wmWindowManager *, ScrArea *area)
static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_gizmo2d(wmGizmoGroupType *gzgt)
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
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)
static void sequencer_scopes_tag_refresh(ScrArea *area, const Scene *scene)
static void sequencer_main_region_draw(const bContext *C, ARegion *region)
void draw_timeline_seq(const bContext *C, ARegion *region)
void SEQ_get_timeline_region_padding(const bContext *C, float *r_pad_top, float *r_pad_bottom)
static void sequencer_space_blend_write(BlendWriter *writer, SpaceLink *sl)
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)
const char * sequencer_context_dir[]
static bool sequencer_channel_region_poll(const RegionPollParams *params)
static void sequencer_space_blend_read_data(BlendDataReader *, SpaceLink *sl)
static SpaceLink * sequencer_create(const ScrArea *, const Scene *scene)
static void sequencer_main_region_listener(const wmRegionListenerParams *params)
Strip * strip_under_mouse_get(const Scene *scene, const View2D *v2d, const int mval[2])
static void sequencer_refresh(const bContext *C, ScrArea *area)
bool can_select_handle(const Scene *scene, const Strip *strip, const View2D *v2d)
rctf strip_retiming_keys_box_get(const Scene *scene, const View2D *v2d, const Strip *strip)
bool retiming_keys_can_be_displayed(const SpaceSeq *sseq)
static void sequencer_listener(const wmSpaceTypeListenerParams *params)
static void SEQUENCER_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
static void sequencer_id_remap(ScrArea *, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
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_channel_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_navigate(wmGizmoGroupType *gzgt)
static void sequencer_header_region_init(wmWindowManager *, ARegion *region)
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
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)
static void sequencer_preview_region_view2d_changed(const bContext *C, ARegion *)
void sequencer_keymap(wmKeyConfig *keyconf)
static void sequencer_main_region_view2d_changed(const bContext *C, ARegion *region)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
struct ImBuf *(*)(struct Depsgraph *, struct Scene *, struct View3DShading *, eDrawType, struct Object *, int, int, enum eImBufFlags, eV3DOffscreenDrawFlag, int, const char *, struct GPUOffScreen *, struct GPUViewport *, char *) DrawViewFn
ListBase * channels_displayed_get(const Editing *ed)
Definition channels.cc:28
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:286
int time_left_handle_frame_get(const Scene *, const Strip *strip)
bool transform_single_image_check(const Strip *strip)
constexpr int MAX_CHANNELS
void timeline_expand_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
bool retiming_data_is_editable(const Strip *strip)
DrawViewFn view3d_fn
Definition render.cc:96
void timeline_init_boundbox(const Scene *scene, rctf *r_rect)
bool transform_is_locked(ListBase *channels, const Strip *strip)
void preview_cache_invalidate(Scene *scene)
Mask * active_mask_get(Scene *scene)
static void * newdataadr(FileData *fd, const void *adr)
Definition readfile.cc:1501
PointerRNA RNA_id_pointer_create(ID *id)
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)
ARegionRuntimeHandle * runtime
Definition DNA_ID.h:414
void * first
StructRNA * type
Definition RNA_types.hh:52
struct ToolSettings * toolsettings
struct RenderData r
struct bToolRef * tool
ListBase spacedata
ScrArea_Runtime runtime
ListBase regionbase
struct bGPdata * gpd
struct SequencerCacheOverlay cache_overlay
struct SequencerTimelineOverlay timeline_overlay
ListBase regionbase
SpaceSeq_Runtime * runtime
struct SequencerPreviewOverlay preview_overlay
float minzoom
short keeptot
float max[2]
short keepzoom
struct wmTimer * smooth_timer
short keepofs
float min[2]
float maxzoom
struct Scene * sequencer_scene
float xmax
float xmin
float ymax
float ymin
int ymin
int ymax
int xmin
int xy[2]
Definition WM_types.hh:761
const char * idname
wmGizmoMapType_Params gzmap_params
eWM_GizmoFlagGroupTypeFlag flag
unsigned int data
Definition WM_types.hh:358
unsigned int action
Definition WM_types.hh:358
unsigned int category
Definition WM_types.hh:358
struct wmEvent * eventstate
i
Definition text_draw.cc:230
void WM_cursor_set(wmWindow *win, int curs)
@ WM_CURSOR_DEFAULT
Definition wm_cursors.hh:15
@ WM_CURSOR_RIGHT_HANDLE
Definition wm_cursors.hh:65
@ WM_CURSOR_BOTH_HANDLES
Definition wm_cursors.hh:66
@ WM_CURSOR_LEFT_HANDLE
Definition wm_cursors.hh:64
@ WM_CURSOR_BLADE
Definition wm_cursors.hh:32
@ WM_CURSOR_STOP
Definition wm_cursors.hh:18
@ WM_CURSOR_SLIP
Definition wm_cursors.hh:67
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_poll(ListBase *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
bool WM_event_handler_region_v2d_mask_no_marker_poll(const wmWindow *win, const ScrArea *area, const ARegion *region, const wmEvent *event)
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)
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:895
bool WM_menutype_add(MenuType *mt)
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)
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)