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