Blender V5.3
space_nla.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 <cstdio>
10#include <cstring>
11
13#include "DNA_scene_types.h"
14
15#include "DNA_screen_types.h"
16#include "MEM_guardedalloc.h"
17
18#include "BLI_listbase.hh"
19#include "BLI_math_base_c.hh"
20#include "BLI_string_utf8.hh"
21#include "BLI_utildefines.hh"
22
23#include "BKE_context.hh"
24#include "BKE_lib_query.hh"
25#include "BKE_lib_remap.hh"
26#include "BKE_screen.hh"
27
28#include "ED_anim_api.hh"
29#include "ED_markers.hh"
30#include "ED_screen.hh"
31#include "ED_space_api.hh"
32#include "ED_time_scrub_ui.hh"
33
34#include "WM_api.hh"
35#include "WM_message.hh"
36#include "WM_types.hh"
37
38#include "RNA_access.hh"
39
40#include "UI_interface.hh"
41#include "UI_resources.hh"
42#include "UI_view2d.hh"
43
44#include "BLO_read_write.hh"
45
46#include "nla_intern.hh" /* own include */
47
48namespace blender {
49
50/* ******************** default callbacks for nla space ***************** */
51
52static SpaceLink *nla_create(const ScrArea *area, const Scene *scene)
53{
54 ARegion *region;
55 SpaceNla *snla;
56
57 snla = MEM_new<SpaceNla>("initnla");
58 snla->spacetype = SPACE_NLA;
59
60 /* allocate DopeSheet data for NLA Editor */
61 snla->ads = MEM_new<bDopeSheet>("NlaEdit DopeSheet");
62 snla->ads->source = id_cast<ID *>(const_cast<Scene *>((scene)));
63
64 /* set auto-snapping settings */
65 snla->flag = SNLA_SHOW_MARKERS;
66
67 /* header */
68 region = BKE_area_region_new();
69
70 BLI_addtail(&snla->regionbase, region);
73
74 /* footer */
75 region = BKE_area_region_new();
76
77 BLI_addtail(&snla->regionbase, region);
80 region->flag = RGN_FLAG_HIDDEN;
81
82 /* track list region */
83 region = BKE_area_region_new();
84 BLI_addtail(&snla->regionbase, region);
86 region->alignment = RGN_ALIGN_LEFT;
87
88 /* only need to set these settings since this will use the 'stack' configuration */
91
92 /* ui buttons */
93 region = BKE_area_region_new();
94
95 BLI_addtail(&snla->regionbase, region);
96 region->regiontype = RGN_TYPE_UI;
97 region->alignment = RGN_ALIGN_RIGHT;
98
99 /* main region */
100 region = BKE_area_region_new();
101
102 BLI_addtail(&snla->regionbase, region);
103 region->regiontype = RGN_TYPE_WINDOW;
104
105 region->v2d.tot.xmin = float(scene->r.sfra - 10);
106 region->v2d.tot.ymin = float(-area->winy) / 3.0f;
107 region->v2d.tot.xmax = float(scene->r.efra + 10);
108 region->v2d.tot.ymax = 0.0f;
109
110 region->v2d.cur = region->v2d.tot;
111
112 region->v2d.min[0] = 0.0f;
113 region->v2d.min[1] = 0.0f;
114
115 region->v2d.max[0] = MAXFRAMEF;
116 region->v2d.max[1] = 10000.0f;
117
118 region->v2d.minzoom = 0.01f;
119 region->v2d.maxzoom = 50;
121 region->v2d.scroll |= V2D_SCROLL_RIGHT;
122 region->v2d.keepzoom = V2D_LOCKZOOM_Y;
123 region->v2d.keepofs = V2D_KEEPOFS_Y;
124 region->v2d.align = V2D_ALIGN_NO_POS_Y;
126
127 return reinterpret_cast<SpaceLink *>(snla);
128}
129
130/* Doesn't free the space-link itself. */
131static void nla_free(SpaceLink *sl)
132{
133 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
134
135 if (snla->ads) {
136 BLI_freelistN(&snla->ads->chanbase);
137 MEM_delete(snla->ads);
138 }
139}
140
141/* spacetype; init callback */
142static void nla_init(wmWindowManager *wm, ScrArea *area)
143{
144 SpaceNla *snla = area->spacedata.first_as<SpaceNla>();
145
146 /* init dope-sheet data if non-existent (i.e. for old files). */
147 if (snla->ads == nullptr) {
148 snla->ads = MEM_new<bDopeSheet>("NlaEdit DopeSheet");
149 wmWindow *win = WM_window_find_by_area(wm, area);
150 snla->ads->source = win ? reinterpret_cast<ID *>(WM_window_get_active_scene(win)) : nullptr;
151 }
152
154}
155
157{
158 SpaceNla *snlan = MEM_dupalloc(reinterpret_cast<SpaceNla *>(sl));
159
160 /* clear or remove stuff from old */
161 snlan->ads = MEM_dupalloc(snlan->ads);
162
163 return reinterpret_cast<SpaceLink *>(snlan);
164}
165
166/* add handlers, stuff you only do once or on area/region changes */
168{
169 wmKeyMap *keymap;
170
171 /* ensure the 2d view sync works - main region has bottom scroller */
172 region->v2d.scroll = V2D_SCROLL_BOTTOM;
173
174 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_LIST, region->winx, region->winy);
175
176 /* own keymap */
177 /* own tracks map first to override some track keymaps */
178 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "NLA Tracks", SPACE_NLA, RGN_TYPE_WINDOW);
181 /* now generic channels map for everything else that can apply */
182 keymap = WM_keymap_ensure(
183 wm->runtime->defaultconf, "Animation Channels", SPACE_EMPTY, RGN_TYPE_WINDOW);
185
186 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
188}
189
190/* draw entirely, view changes should be handled here */
191static void nla_track_region_draw(const bContext *C, ARegion *region)
192{
193 bAnimContext ac;
194 if (!ANIM_animdata_get_context(C, &ac)) {
195 return;
196 }
197
198 /* clear and setup matrix */
200
201 ListBaseT<bAnimListElem> anim_data = {nullptr, nullptr};
202
203 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac.sl);
204 View2D *v2d = &region->v2d;
205
208 const size_t item_count = ANIM_animdata_filter(
209 &ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
210
211 /* Recalculate the height of the track list.
212 * Needs to be done before the call to #view2d_view_ortho. */
213 int height = NLATRACK_TOT_HEIGHT(&ac, item_count);
214 /* Add padding for the collapsed redo panel. */
215 height += HEADERY;
217 height += (UI_MARKER_MARGIN_Y - NLATRACK_STEP(snla));
218 }
219 v2d->tot.ymin = -height;
221
223
224 draw_nla_track_list(C, &ac, region, anim_data);
225
226 /* track filter next to scrubbing area */
228
229 /* reset view matrix */
231
232 /* scrollers */
233 if (region->winy > UI_ANIM_MINY) {
234 ui::view2d_scrollers_draw(v2d, nullptr);
235 }
236
237 ANIM_animdata_freelist(&anim_data);
238}
239
240/* add handlers, stuff you only do once or on area/region changes */
242{
243 wmKeyMap *keymap;
244
245 view2d_region_reinit(&region->v2d, ui::V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
246
247 /* own keymap */
248 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "NLA Editor", SPACE_NLA, RGN_TYPE_WINDOW);
250 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
252}
253
254static void nla_main_region_draw(const bContext *C, ARegion *region)
255{
256 /* draw entirely, view changes should be handled here */
257 SpaceNla *snla = CTX_wm_space_nla(C);
258 Scene *scene = CTX_data_scene(C);
259 bAnimContext ac;
260 View2D *v2d = &region->v2d;
261
262 const int min_height = UI_ANIM_MINY;
263
264 /* clear and setup matrix */
266
268
269 /* time grid */
270 if (region->winy > min_height) {
271 ui::view2d_draw_lines_x_frames(v2d, scene, snla->flag & SNLA_DRAWTIME, false, true);
272 }
273
275
276 /* start and end frame */
277 if (region->winy > min_height) {
278 ANIM_draw_framerange(scene, v2d);
279 }
280
281 /* data */
282 if (ANIM_animdata_get_context(C, &ac)) {
283 /* strips and backdrops */
284 draw_nla_main_data(&ac, snla, region);
285
286 /* Text draw cached, in pixel-space now. */
288 }
289
290 /* markers */
291 ui::view2d_view_orthoSpecial(region, v2d, true);
292 int marker_draw_flag = DRAW_MARKERS_MARGIN;
294 ED_markers_draw(C, marker_draw_flag);
295 }
296
297 /* preview range */
299 ANIM_draw_previewrange(scene, v2d, 0);
300
301 /* callback */
304
305 /* reset view matrix */
307
308 const int fps = round_db_to_int(scene->frames_per_second());
309 ED_time_scrub_draw(region, scene, snla->flag & SNLA_DRAWTIME, true, fps);
310}
311
312static void nla_main_region_draw_overlay(const bContext *C, ARegion *region)
313{
314 /* draw entirely, view changes should be handled here */
315 const SpaceNla *snla = CTX_wm_space_nla(C);
316 const Scene *scene = CTX_data_scene(C);
317 View2D *v2d = &region->v2d;
318
319 /* scrubbing region */
321 region, scene, snla->flag & SNLA_DRAWTIME, region->winy >= UI_ANIM_MINY);
322
323 /* scrollers */
324 if (region->winy >= UI_ANIM_MINY) {
325 ui::view2d_scrollers_draw(v2d, nullptr);
326 }
327}
328
329/* add handlers, stuff you only do once or on area/region changes */
330static void nla_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
331{
332 ED_region_header_init(region);
333}
334
335static void nla_header_region_draw(const bContext *C, ARegion *region)
336{
337 ED_region_header(C, region);
338}
339
341{
342 ARegion *region = params->region;
343 const wmNotifier *wmn = params->notifier;
344
345 /* context changes */
346 switch (wmn->category) {
347 case NC_SCREEN:
348 if (wmn->data == ND_ANIMPLAY) {
349 ED_region_tag_redraw(region);
350 }
351 break;
352 case NC_SCENE:
353 switch (wmn->data) {
354 case ND_FRAME:
355 ED_region_tag_redraw(region);
356 break;
357 }
358 break;
359 }
360}
361
362/* add handlers, stuff you only do once or on area/region changes */
364{
365 wmKeyMap *keymap;
366
367 ED_region_panels_init(wm, region);
368
369 keymap = WM_keymap_ensure(wm->runtime->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
371}
372
373static void nla_buttons_region_draw(const bContext *C, ARegion *region)
374{
375 ED_region_panels(C, region);
376}
377
379{
380 ARegion *region = params->region;
381 const wmNotifier *wmn = params->notifier;
382
383 /* context changes */
384 switch (wmn->category) {
385 case NC_ANIMATION:
386 ED_region_tag_redraw(region);
387 break;
388 case NC_SCENE:
389 switch (wmn->data) {
390 case ND_OB_ACTIVE:
391 case ND_FRAME:
392 case ND_MARKERS:
393 case ND_LAYER_CONTENT:
394 case ND_OB_SELECT:
395 case ND_WORLD:
396 ED_region_tag_redraw(region);
397 break;
398 }
399 break;
400 case NC_OBJECT:
401 switch (wmn->data) {
402 case ND_BONE_ACTIVE:
403 case ND_BONE_SELECT:
404 case ND_KEYS:
405 case ND_DRAW:
406 ED_region_tag_redraw(region);
407 break;
408 }
409 break;
410 default:
411 if (wmn->data == ND_KEYS) {
412 ED_region_tag_redraw(region);
413 }
414 break;
415 }
416}
417
419{
420 ARegion *region = params->region;
421 const wmNotifier *wmn = params->notifier;
422
423 /* context changes */
424 switch (wmn->category) {
425 case NC_ANIMATION:
426 ED_region_tag_redraw(region);
427 break;
428 case NC_SCENE:
429 switch (wmn->data) {
431 case ND_OB_ACTIVE:
432 case ND_FRAME:
433 case ND_FRAME_RANGE:
434 case ND_MARKERS:
435 case ND_LAYER_CONTENT:
436 case ND_OB_SELECT:
437 case ND_WORLD:
438 ED_region_tag_redraw(region);
439 break;
440 }
441 break;
442 case NC_OBJECT:
443 switch (wmn->data) {
444 case ND_BONE_ACTIVE:
445 case ND_BONE_SELECT:
446 case ND_KEYS:
447 case ND_TRANSFORM:
448 ED_region_tag_redraw(region);
449 break;
450 }
451 break;
452 case NC_NODE:
453 switch (wmn->action) {
454 case NA_EDITED:
455 ED_region_tag_redraw(region);
456 break;
457 }
458 break;
459 case NC_ID:
460 if (wmn->action == NA_RENAME) {
461 ED_region_tag_redraw(region);
462 }
463 break;
464 case NC_SCREEN:
465 if (ELEM(wmn->data, ND_LAYER)) {
466 ED_region_tag_redraw(region);
467 }
468 break;
469 default:
470 if (wmn->data == ND_KEYS) {
471 ED_region_tag_redraw(region);
472 }
473 break;
474 }
475}
476
478{
479 wmMsgBus *mbus = params->message_bus;
480 Scene *scene = params->scene;
481 ARegion *region = params->region;
482
483 wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
484 msg_sub_value_region_tag_redraw.owner = region;
485 msg_sub_value_region_tag_redraw.user_data = region;
486 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
487
488 /* Timeline depends on scene properties. */
489 {
490 bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
491 const PropertyRNA *props[] = {
492 use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
493 use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
494 &rna_Scene_use_preview_range,
495 &rna_Scene_frame_current,
496 };
497
498 PointerRNA idptr = RNA_id_pointer_create(&scene->id);
499
500 for (int i = 0; i < ARRAY_SIZE(props); i++) {
501 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
502 }
503 }
504}
505
507{
508 ARegion *region = params->region;
509 const wmNotifier *wmn = params->notifier;
510
511 /* context changes */
512 switch (wmn->category) {
513 case NC_ANIMATION:
514 ED_region_tag_redraw(region);
515 break;
516 case NC_SCENE:
517 switch (wmn->data) {
518 case ND_OB_ACTIVE:
519 case ND_LAYER_CONTENT:
520 case ND_FRAME:
521 case ND_OB_SELECT:
522 case ND_WORLD:
523 ED_region_tag_redraw(region);
524 break;
525 }
526 break;
527 case NC_OBJECT:
528 switch (wmn->data) {
529 case ND_BONE_ACTIVE:
530 case ND_BONE_SELECT:
531 case ND_KEYS:
532 case ND_DRAW:
533 ED_region_tag_redraw(region);
534 break;
535 }
536 break;
537 case NC_ID:
538 if (wmn->action == NA_RENAME) {
539 ED_region_tag_redraw(region);
540 }
541 break;
542 default:
543 if (wmn->data == ND_KEYS) {
544 ED_region_tag_redraw(region);
545 }
546 break;
547 }
548}
549
551{
552 wmMsgBus *mbus = params->message_bus;
553 ARegion *region = params->region;
554
555 wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
556 msg_sub_value_region_tag_redraw.owner = region;
557 msg_sub_value_region_tag_redraw.user_data = region;
558 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
559
560 /* All dope-sheet filter settings, etc. affect the drawing of this editor,
561 * so just whitelist the entire struct for updates. */
562 {
563 wmMsgParams_RNA msg_key_params = {{}};
564 StructRNA *type_array[] = {
565 RNA_DopeSheet,
566 };
567
568 for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
569 msg_key_params.ptr.type = type_array[i];
571 mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
572 }
573 }
574}
575
576/* editor level listener */
577static void nla_listener(const wmSpaceTypeListenerParams *params)
578{
579 ScrArea *area = params->area;
580 const wmNotifier *wmn = params->notifier;
581
582 /* context changes */
583 switch (wmn->category) {
584 case NC_ANIMATION:
585 /* TODO: filter specific types of changes? */
587 break;
588 case NC_SCENE:
589#if 0
590 switch (wmn->data) {
591 case ND_OB_ACTIVE:
592 case ND_OB_SELECT:
594 break;
595 }
596#endif
598 break;
599 case NC_OBJECT:
600 switch (wmn->data) {
601 case ND_TRANSFORM:
602 /* do nothing */
603 break;
604 default:
606 break;
607 }
608 break;
609 case NC_SPACE:
610 if (wmn->data == ND_SPACE_NLA) {
611 ED_area_tag_redraw(area);
612 }
613 break;
614 }
615}
616
617static void nla_id_remap(ScrArea * /*area*/, SpaceLink *slink, const bke::id::IDRemapper &mappings)
618{
619 SpaceNla *snla = reinterpret_cast<SpaceNla *>(slink);
620
621 if (snla->ads == nullptr) {
622 return;
623 }
624
625 mappings.apply(reinterpret_cast<ID **>(&snla->ads->filter_grp), ID_REMAP_APPLY_DEFAULT);
626 mappings.apply((&snla->ads->source), ID_REMAP_APPLY_DEFAULT);
627}
628
630{
631 SpaceNla *snla = reinterpret_cast<SpaceNla *>(space_link);
632
633 /* NOTE: Could be deduplicated with the #bDopeSheet handling of #SpaceAction and #SpaceGraph. */
634 if (snla->ads == nullptr) {
635 return;
636 }
637
640}
641
643{
644 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
645 BLO_read_struct(reader, bDopeSheet, &snla->ads);
646}
647
649{
650 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
651
652 writer->write_struct_cast<SpaceNla>(snla);
653 if (snla->ads) {
654 writer->write_struct(snla->ads);
655 }
656}
657
659{
660 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
661 ARegionType *art;
662
663 st->spaceid = SPACE_NLA;
664 STRNCPY_UTF8(st->name, "NLA");
665 st->struct_size = sizeof(SpaceNla);
666
667 st->create = nla_create;
668 st->free = nla_free;
669 st->init = nla_init;
670 st->duplicate = nla_duplicate;
671 st->operatortypes = nla_operatortypes;
672 st->listener = nla_listener;
673 st->keymap = nla_keymap;
674 st->id_remap = nla_id_remap;
675 st->foreach_id = nla_foreach_id;
676 st->blend_read_data = nla_space_blend_read_data;
677 st->blend_read_after_liblink = nullptr;
678 st->blend_write = nla_space_blend_write;
679
680 /* regions: main window */
681 art = MEM_new_zeroed<ARegionType>("spacetype nla region");
689
690 BLI_addhead(&st->regiontypes, art);
691
692 /* regions: header */
693 art = MEM_new_zeroed<ARegionType>("spacetype nla region");
695 art->prefsizey = HEADERY;
697
700
701 BLI_addhead(&st->regiontypes, art);
702
703 /* regions: footer */
704 art = MEM_new_zeroed<ARegionType>("spacetype nla region");
706 art->prefsizey = HEADERY;
708
712
713 BLI_addhead(&st->regiontypes, art);
714
715 /* regions: tracks */
716 art = MEM_new_zeroed<ARegionType>("spacetype nla region");
718 art->prefsizex = 200;
720
725
726 BLI_addhead(&st->regiontypes, art);
727
728 /* regions: UI buttons */
729 art = MEM_new_zeroed<ARegionType>("spacetype nla region");
730 art->regionid = RGN_TYPE_UI;
737
738 BLI_addhead(&st->regiontypes, art);
739
741
742 art = ui::ED_area_type_hud(st->spaceid);
743 BLI_addhead(&st->regiontypes, art);
744
745 BKE_spacetype_register(std::move(st));
746}
747
748} // namespace blender
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct(reader, struct_name, ptr_p)
Object groups, one object can be in many groups at once.
#define MAXFRAMEF
#define HEADERY
#define NLATRACK_TOT_HEIGHT(ac, item_amount)
#define NLATRACK_STEP(snla)
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define UI_SIDEBAR_PANEL_WIDTH
#define UI_ANIM_MINY
Definition UI_view2d.hh:495
#define UI_MARKER_MARGIN_Y
Definition UI_view2d.hh:492
#define ND_WORLD
Definition WM_types.hh:471
#define NC_ID
Definition WM_types.hh:408
#define NC_NODE
Definition WM_types.hh:407
#define ND_DRAW
Definition WM_types.hh:502
#define ND_OB_ACTIVE
Definition WM_types.hh:459
#define ND_RENDER_OPTIONS
Definition WM_types.hh:454
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_SPACE_NLA
Definition WM_types.hh:577
#define NC_SCREEN
Definition WM_types.hh:390
#define ND_OB_SELECT
Definition WM_types.hh:461
#define ND_ANIMPLAY
Definition WM_types.hh:441
#define NC_SCENE
Definition WM_types.hh:391
#define ND_LAYER_CONTENT
Definition WM_types.hh:472
#define NA_EDITED
Definition WM_types.hh:634
#define ND_FRAME_RANGE
Definition WM_types.hh:470
#define ND_MARKERS
Definition WM_types.hh:452
#define ND_FRAME
Definition WM_types.hh:453
#define ND_BONE_ACTIVE
Definition WM_types.hh:483
#define ND_TRANSFORM
Definition WM_types.hh:475
#define ND_LAYER
Definition WM_types.hh:469
#define ND_KEYS
Definition WM_types.hh:504
#define NA_RENAME
Definition WM_types.hh:638
#define ND_BONE_SELECT
Definition WM_types.hh:491
#define NC_OBJECT
Definition WM_types.hh:392
#define NC_SPACE
Definition WM_types.hh:405
#define ELEM(...)
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
void frame_buffer_clear(int colorid)
void view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1080
void view2d_view_restore(const bContext *C)
Definition view2d.cc:1147
ARegionType * ED_area_type_hud(int space_type)
void view2d_text_cache_draw(ARegion *region)
Definition view2d.cc:2139
void view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1487
void view2d_curRect_clamp_y(View2D *v2d)
Definition view2d.cc:829
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:60
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:56
void view2d_draw_lines_x_frames(const View2D *v2d, const Scene *scene, bool display_seconds, bool show_fractions, bool draw_minor_lines)
void view2d_view_orthoSpecial(ARegion *region, View2D *v2d, bool xaxis)
Definition view2d.cc:1121
BMesh Iterators.
SpaceNla * CTX_wm_space_nla(const bContext *C)
UserDef U
Definition blender.cc:58
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk, bool clamp_playhead)
void ANIM_draw_framerange(Scene *scene, View2D *v2d)
Definition anim_draw.cc:176
ScrArea * CTX_wm_area(const bContext *C)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames, const int base)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region, const ListBaseT< bAnimListElem > &anim_data)
Definition nla_draw.cc:971
@ V2D_VIEWSYNC_AREA_VERTICAL
static void nla_track_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:191
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:98
ListBaseT< TimeMarker > * ED_context_get_markers(const bContext *C)
PointerRNA RNA_id_pointer_create(ID *id)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
void ED_markers_draw(const bContext *C, int flag)
bool ED_markers_region_visible(const ScrArea *area, const ARegion *region)
static void nla_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
Definition space_nla.cc:629
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
static void nla_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition space_nla.cc:477
static void nla_space_blend_read_data(BlendDataReader *reader, SpaceLink *sl)
Definition space_nla.cc:642
static void nla_header_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:335
static void nla_track_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:506
void WM_msg_subscribe_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
static SpaceLink * nla_duplicate(SpaceLink *sl)
Definition space_nla.cc:156
static SpaceLink * nla_create(const ScrArea *area, const Scene *scene)
Definition space_nla.cc:52
void nla_buttons_register(ARegionType *art)
wmWindow * WM_window_find_by_area(wmWindowManager *wm, const ScrArea *area)
static void nla_init(wmWindowManager *wm, ScrArea *area)
Definition space_nla.cc:142
Scene * WM_window_get_active_scene(const wmWindow *win)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBaseT< bAnimListElem > *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:504
static void nla_id_remap(ScrArea *, SpaceLink *slink, const bke::id::IDRemapper &mappings)
Definition space_nla.cc:617
@ ANIMFILTER_FCURVESONLY
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
static void nla_track_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition space_nla.cc:550
static void nla_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:378
static void nla_main_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:418
BMesh const char void * data
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
static void nla_main_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:254
static void nla_header_region_init(wmWindowManager *, ARegion *region)
Definition space_nla.cc:330
void ED_spacetype_nla()
Definition space_nla.cc:658
void ED_region_panels(const bContext *C, ARegion *region)
Definition area.cc:3999
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition wm_keymap.cc:935
bool WM_event_handler_region_v2d_mask_no_marker_poll(const wmWindow *win, const ScrArea *area, const ARegion *region, const wmEvent *event)
void ANIM_draw_previewrange(const Scene *scene, View2D *v2d, int end_frame_width)
Definition anim_draw.cc:88
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
@ DRAW_MARKERS_MARGIN
Definition ED_markers.hh:35
ARegion * BKE_area_region_new()
Definition screen.cc:522
static void nla_buttons_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:363
static void nla_footer_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:340
@ ED_KEYMAP_UI
Definition ED_screen.hh:852
@ ED_KEYMAP_FOOTER
Definition ED_screen.hh:859
@ ED_KEYMAP_HEADER
Definition ED_screen.hh:858
@ ED_KEYMAP_ANIMATION
Definition ED_screen.hh:856
@ ED_KEYMAP_VIEW2D
Definition ED_screen.hh:855
@ ED_KEYMAP_FRAMES
Definition ED_screen.hh:857
wmEventHandler_Keymap * WM_event_add_keymap_handler_poll(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
static void nla_track_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:167
@ V2D_SCROLL_HORIZONTAL_HANDLES
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
Definition screen.cc:379
void ANIM_animdata_freelist(ListBaseT< bAnimListElem > *anim_data)
Definition anim_deps.cc:472
void nla_keymap(wmKeyConfig *keyconf)
Definition nla_ops.cc:179
void ED_region_header_init(ARegion *region)
Definition area.cc:4406
static void nla_listener(const wmSpaceTypeListenerParams *params)
Definition space_nla.cc:577
void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
Definition nla_draw.cc:786
static void nla_main_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:241
Scene * CTX_data_scene(const bContext *C)
static void nla_buttons_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:373
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:813
@ ID_REMAP_APPLY_DEFAULT
@ IDWALK_CB_DIRECT_WEAK_LINK
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
Definition area.cc:394
void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet)
void ED_region_header(const bContext *C, ARegion *region)
Definition area.cc:4391
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
Definition area.cc:4006
static void nla_space_blend_write(BlendWriter *writer, SpaceLink *sl)
Definition space_nla.cc:648
MINLINE int round_db_to_int(double a)
static void nla_free(SpaceLink *sl)
Definition space_nla.cc:131
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:784
void nla_operatortypes()
Definition nla_ops.cc:91
static void nla_main_region_draw_overlay(const bContext *C, ARegion *region)
Definition space_nla.cc:312
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
void(*) draw_overlay(const bContext *C, ARegion *region)
ARegionTypeFlag flag
void(*) message_subscribe(const wmRegionMessageSubscribeParams *params)
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
eRegion_Type regiontype
void write_struct_cast(const void *data, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
StructRNA * type
Definition RNA_types.hh:63
struct RenderData r
ListBaseT< SpaceLink > spacedata
eSpaceNla_Flag flag
struct bDopeSheet * ads
ListBaseT< ARegion > regionbase
eView2D_KeepOfs keepofs
eView2D_KeepZoom keepzoom
eView2D_Scroll scroll
eView2D_Align align
eAnimCont_Types datatype
struct Collection * filter_grp
ListBaseT< wmEventHandler > handlers
unsigned int action
Definition WM_types.hh:371
unsigned int category
Definition WM_types.hh:371
unsigned int data
Definition WM_types.hh:371