Blender V4.5
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.h"
19#include "BLI_string.h"
20#include "BLI_utildefines.h"
21
22#include "BKE_context.hh"
23#include "BKE_lib_query.hh"
24#include "BKE_lib_remap.hh"
25#include "BKE_screen.hh"
26
27#include "ED_anim_api.hh"
28#include "ED_markers.hh"
29#include "ED_screen.hh"
30#include "ED_space_api.hh"
31#include "ED_time_scrub_ui.hh"
32
33#include "WM_api.hh"
34#include "WM_message.hh"
35#include "WM_types.hh"
36
37#include "RNA_access.hh"
38
39#include "UI_interface.hh"
40#include "UI_resources.hh"
41#include "UI_view2d.hh"
42
43#include "BLO_read_write.hh"
44
45#include "nla_intern.hh" /* own include */
46
47/* ******************** default callbacks for nla space ***************** */
48
49static SpaceLink *nla_create(const ScrArea *area, const Scene *scene)
50{
51 ARegion *region;
52 SpaceNla *snla;
53
54 snla = MEM_callocN<SpaceNla>("initnla");
55 snla->spacetype = SPACE_NLA;
56
57 /* allocate DopeSheet data for NLA Editor */
58 snla->ads = MEM_callocN<bDopeSheet>("NlaEdit DopeSheet");
59 snla->ads->source = (ID *)(scene);
60
61 /* set auto-snapping settings */
62 snla->flag = SNLA_SHOW_MARKERS;
63
64 /* header */
65 region = BKE_area_region_new();
66
67 BLI_addtail(&snla->regionbase, region);
70
71 /* track list region */
72 region = BKE_area_region_new();
73 BLI_addtail(&snla->regionbase, region);
75 region->alignment = RGN_ALIGN_LEFT;
76
77 /* only need to set these settings since this will use the 'stack' configuration */
80
81 /* ui buttons */
82 region = BKE_area_region_new();
83
84 BLI_addtail(&snla->regionbase, region);
85 region->regiontype = RGN_TYPE_UI;
86 region->alignment = RGN_ALIGN_RIGHT;
87
88 /* main region */
89 region = BKE_area_region_new();
90
91 BLI_addtail(&snla->regionbase, region);
93
94 region->v2d.tot.xmin = float(scene->r.sfra - 10);
95 region->v2d.tot.ymin = float(-area->winy) / 3.0f;
96 region->v2d.tot.xmax = float(scene->r.efra + 10);
97 region->v2d.tot.ymax = 0.0f;
98
99 region->v2d.cur = region->v2d.tot;
100
101 region->v2d.min[0] = 0.0f;
102 region->v2d.min[1] = 0.0f;
103
104 region->v2d.max[0] = MAXFRAMEF;
105 region->v2d.max[1] = 10000.0f;
106
107 region->v2d.minzoom = 0.01f;
108 region->v2d.maxzoom = 50;
110 region->v2d.scroll |= V2D_SCROLL_RIGHT;
111 region->v2d.keepzoom = V2D_LOCKZOOM_Y;
112 region->v2d.keepofs = V2D_KEEPOFS_Y;
113 region->v2d.align = V2D_ALIGN_NO_POS_Y;
115
116 return reinterpret_cast<SpaceLink *>(snla);
117}
118
119/* Doesn't free the space-link itself. */
120static void nla_free(SpaceLink *sl)
121{
122 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
123
124 if (snla->ads) {
125 BLI_freelistN(&snla->ads->chanbase);
126 MEM_freeN(snla->ads);
127 }
128}
129
130/* spacetype; init callback */
131static void nla_init(wmWindowManager *wm, ScrArea *area)
132{
133 SpaceNla *snla = static_cast<SpaceNla *>(area->spacedata.first);
134
135 /* init dope-sheet data if non-existent (i.e. for old files). */
136 if (snla->ads == nullptr) {
137 snla->ads = MEM_callocN<bDopeSheet>("NlaEdit DopeSheet");
138 wmWindow *win = WM_window_find_by_area(wm, area);
139 snla->ads->source = win ? reinterpret_cast<ID *>(WM_window_get_active_scene(win)) : nullptr;
140 }
141
143}
144
146{
147 SpaceNla *snlan = static_cast<SpaceNla *>(MEM_dupallocN(sl));
148
149 /* clear or remove stuff from old */
150 snlan->ads = static_cast<bDopeSheet *>(MEM_dupallocN(snlan->ads));
151
152 return reinterpret_cast<SpaceLink *>(snlan);
153}
154
155/* add handlers, stuff you only do once or on area/region changes */
157{
158 wmKeyMap *keymap;
159
160 /* ensure the 2d view sync works - main region has bottom scroller */
161 region->v2d.scroll = V2D_SCROLL_BOTTOM;
162
163 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
164
165 /* own keymap */
166 /* own tracks map first to override some track keymaps */
167 keymap = WM_keymap_ensure(wm->defaultconf, "NLA Tracks", SPACE_NLA, RGN_TYPE_WINDOW);
169 &region->runtime->handlers, keymap, WM_event_handler_region_v2d_mask_no_marker_poll);
170 /* now generic channels map for everything else that can apply */
171 keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", SPACE_EMPTY, RGN_TYPE_WINDOW);
172 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
173
174 keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
175 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
176}
177
178/* draw entirely, view changes should be handled here */
179static void nla_track_region_draw(const bContext *C, ARegion *region)
180{
181 bAnimContext ac;
182 if (!ANIM_animdata_get_context(C, &ac)) {
183 return;
184 }
185
186 /* clear and setup matrix */
188
189 ListBase anim_data = {nullptr, nullptr};
190
191 SpaceNla *snla = reinterpret_cast<SpaceNla *>(ac.sl);
192 View2D *v2d = &region->v2d;
193
196 const size_t item_count = ANIM_animdata_filter(
197 &ac, &anim_data, filter, ac.data, eAnimCont_Types(ac.datatype));
198
199 /* Recalculate the height of the track list.
200 * Needs to be done before the call to #UI_view2d_view_ortho. */
201 int height = NLATRACK_TOT_HEIGHT(&ac, item_count);
202 /* Add padding for the collapsed redo panel. */
203 height += HEADERY;
205 height += (UI_MARKER_MARGIN_Y - NLATRACK_STEP(snla));
206 }
207 v2d->tot.ymin = -height;
209
211
212 draw_nla_track_list(C, &ac, region, anim_data);
213
214 /* track filter next to scrubbing area */
216
217 /* reset view matrix */
219
220 /* scrollers */
221 if (region->winy > UI_ANIM_MINY) {
222 UI_view2d_scrollers_draw(v2d, nullptr);
223 }
224
225 ANIM_animdata_freelist(&anim_data);
226}
227
228/* add handlers, stuff you only do once or on area/region changes */
230{
231 wmKeyMap *keymap;
232
233 UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
234
235 /* own keymap */
236 keymap = WM_keymap_ensure(wm->defaultconf, "NLA Editor", SPACE_NLA, RGN_TYPE_WINDOW);
237 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
238 keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
239 WM_event_add_keymap_handler(&region->runtime->handlers, keymap);
240}
241
242static void nla_main_region_draw(const bContext *C, ARegion *region)
243{
244 /* draw entirely, view changes should be handled here */
245 SpaceNla *snla = CTX_wm_space_nla(C);
246 Scene *scene = CTX_data_scene(C);
247 bAnimContext ac;
248 View2D *v2d = &region->v2d;
249
250 const int min_height = UI_ANIM_MINY;
251
252 /* clear and setup matrix */
254
256
257 /* time grid */
258 if (region->winy > min_height) {
260 v2d, scene, snla->flag & SNLA_DRAWTIME, true);
261 }
262
264
265 /* start and end frame */
266 if (region->winy > min_height) {
267 ANIM_draw_framerange(scene, v2d);
268 }
269
270 /* data */
271 if (ANIM_animdata_get_context(C, &ac)) {
272 /* strips and backdrops */
273 draw_nla_main_data(&ac, snla, region);
274
275 /* Text draw cached, in pixel-space now. */
277 }
278
279 /* markers */
280 UI_view2d_view_orthoSpecial(region, v2d, true);
281 int marker_draw_flag = DRAW_MARKERS_MARGIN;
282 if (snla->flag & SNLA_SHOW_MARKERS && region->winy > (UI_ANIM_MINY + UI_MARKER_MARGIN_Y)) {
283 ED_markers_draw(C, marker_draw_flag);
284 }
285
286 /* preview range */
288 ANIM_draw_previewrange(scene, v2d, 0);
289
290 /* callback */
293
294 /* reset view matrix */
296
297 ED_time_scrub_draw(region, scene, snla->flag & SNLA_DRAWTIME, true);
298}
299
300static void nla_main_region_draw_overlay(const bContext *C, ARegion *region)
301{
302 /* draw entirely, view changes should be handled here */
303 const SpaceNla *snla = CTX_wm_space_nla(C);
304 const Scene *scene = CTX_data_scene(C);
305 View2D *v2d = &region->v2d;
306
307 /* scrubbing region */
309 region, scene, snla->flag & SNLA_DRAWTIME, region->winy >= UI_ANIM_MINY);
310
311 /* scrollers */
312 if (region->winy >= UI_ANIM_MINY) {
313 UI_view2d_scrollers_draw(v2d, nullptr);
314 }
315}
316
317/* add handlers, stuff you only do once or on area/region changes */
318static void nla_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
319{
320 ED_region_header_init(region);
321}
322
323static void nla_header_region_draw(const bContext *C, ARegion *region)
324{
325 ED_region_header(C, region);
326}
327
328/* add handlers, stuff you only do once or on area/region changes */
330{
331 wmKeyMap *keymap;
332
333 ED_region_panels_init(wm, region);
334
335 keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, RGN_TYPE_WINDOW);
336 WM_event_add_keymap_handler_v2d_mask(&region->runtime->handlers, keymap);
337}
338
339static void nla_buttons_region_draw(const bContext *C, ARegion *region)
340{
341 ED_region_panels(C, region);
342}
343
345{
346 ARegion *region = params->region;
347 const wmNotifier *wmn = params->notifier;
348
349 /* context changes */
350 switch (wmn->category) {
351 case NC_ANIMATION:
352 ED_region_tag_redraw(region);
353 break;
354 case NC_SCENE:
355 switch (wmn->data) {
356 case ND_OB_ACTIVE:
357 case ND_FRAME:
358 case ND_MARKERS:
359 case ND_LAYER_CONTENT:
360 case ND_OB_SELECT:
361 ED_region_tag_redraw(region);
362 break;
363 }
364 break;
365 case NC_OBJECT:
366 switch (wmn->data) {
367 case ND_BONE_ACTIVE:
368 case ND_BONE_SELECT:
369 case ND_KEYS:
370 case ND_DRAW:
371 ED_region_tag_redraw(region);
372 break;
373 }
374 break;
375 default:
376 if (wmn->data == ND_KEYS) {
377 ED_region_tag_redraw(region);
378 }
379 break;
380 }
381}
382
384{
385 ARegion *region = params->region;
386 const wmNotifier *wmn = params->notifier;
387
388 /* context changes */
389 switch (wmn->category) {
390 case NC_ANIMATION:
391 ED_region_tag_redraw(region);
392 break;
393 case NC_SCENE:
394 switch (wmn->data) {
396 case ND_OB_ACTIVE:
397 case ND_FRAME:
398 case ND_FRAME_RANGE:
399 case ND_MARKERS:
400 case ND_LAYER_CONTENT:
401 case ND_OB_SELECT:
402 ED_region_tag_redraw(region);
403 break;
404 }
405 break;
406 case NC_OBJECT:
407 switch (wmn->data) {
408 case ND_BONE_ACTIVE:
409 case ND_BONE_SELECT:
410 case ND_KEYS:
411 case ND_TRANSFORM:
412 ED_region_tag_redraw(region);
413 break;
414 }
415 break;
416 case NC_NODE:
417 switch (wmn->action) {
418 case NA_EDITED:
419 ED_region_tag_redraw(region);
420 break;
421 }
422 break;
423 case NC_ID:
424 if (wmn->action == NA_RENAME) {
425 ED_region_tag_redraw(region);
426 }
427 break;
428 case NC_SCREEN:
429 if (ELEM(wmn->data, ND_LAYER)) {
430 ED_region_tag_redraw(region);
431 }
432 break;
433 default:
434 if (wmn->data == ND_KEYS) {
435 ED_region_tag_redraw(region);
436 }
437 break;
438 }
439}
440
442{
443 wmMsgBus *mbus = params->message_bus;
444 Scene *scene = params->scene;
445 ARegion *region = params->region;
446
447 wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
448 msg_sub_value_region_tag_redraw.owner = region;
449 msg_sub_value_region_tag_redraw.user_data = region;
450 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
451
452 /* Timeline depends on scene properties. */
453 {
454 bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
455 const PropertyRNA *props[] = {
456 use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
457 use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
458 &rna_Scene_use_preview_range,
459 &rna_Scene_frame_current,
460 };
461
462 PointerRNA idptr = RNA_id_pointer_create(&scene->id);
463
464 for (int i = 0; i < ARRAY_SIZE(props); i++) {
465 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
466 }
467 }
468}
469
471{
472 ARegion *region = params->region;
473 const wmNotifier *wmn = params->notifier;
474
475 /* context changes */
476 switch (wmn->category) {
477 case NC_ANIMATION:
478 ED_region_tag_redraw(region);
479 break;
480 case NC_SCENE:
481 switch (wmn->data) {
482 case ND_OB_ACTIVE:
483 case ND_LAYER_CONTENT:
484 case ND_FRAME:
485 case ND_OB_SELECT:
486 ED_region_tag_redraw(region);
487 break;
488 }
489 break;
490 case NC_OBJECT:
491 switch (wmn->data) {
492 case ND_BONE_ACTIVE:
493 case ND_BONE_SELECT:
494 case ND_KEYS:
495 case ND_DRAW:
496 ED_region_tag_redraw(region);
497 break;
498 }
499 break;
500 case NC_ID:
501 if (wmn->action == NA_RENAME) {
502 ED_region_tag_redraw(region);
503 }
504 break;
505 default:
506 if (wmn->data == ND_KEYS) {
507 ED_region_tag_redraw(region);
508 }
509 break;
510 }
511}
512
514{
515 wmMsgBus *mbus = params->message_bus;
516 ARegion *region = params->region;
517
518 wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {};
519 msg_sub_value_region_tag_redraw.owner = region;
520 msg_sub_value_region_tag_redraw.user_data = region;
521 msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
522
523 /* All dope-sheet filter settings, etc. affect the drawing of this editor,
524 * so just whitelist the entire struct for updates. */
525 {
526 wmMsgParams_RNA msg_key_params = {{}};
527 StructRNA *type_array[] = {
528 &RNA_DopeSheet,
529 };
530
531 for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
532 msg_key_params.ptr.type = type_array[i];
534 mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
535 }
536 }
537}
538
539/* editor level listener */
541{
542 ScrArea *area = params->area;
543 const wmNotifier *wmn = params->notifier;
544
545 /* context changes */
546 switch (wmn->category) {
547 case NC_ANIMATION:
548 /* TODO: filter specific types of changes? */
550 break;
551 case NC_SCENE:
552#if 0
553 switch (wmn->data) {
554 case ND_OB_ACTIVE:
555 case ND_OB_SELECT:
557 break;
558 }
559#endif
561 break;
562 case NC_OBJECT:
563 switch (wmn->data) {
564 case ND_TRANSFORM:
565 /* do nothing */
566 break;
567 default:
569 break;
570 }
571 break;
572 case NC_SPACE:
573 if (wmn->data == ND_SPACE_NLA) {
574 ED_area_tag_redraw(area);
575 }
576 break;
577 }
578}
579
580static void nla_id_remap(ScrArea * /*area*/,
581 SpaceLink *slink,
582 const blender::bke::id::IDRemapper &mappings)
583{
584 SpaceNla *snla = reinterpret_cast<SpaceNla *>(slink);
585
586 if (snla->ads == nullptr) {
587 return;
588 }
589
590 mappings.apply(reinterpret_cast<ID **>(&snla->ads->filter_grp), ID_REMAP_APPLY_DEFAULT);
591 mappings.apply((&snla->ads->source), ID_REMAP_APPLY_DEFAULT);
592}
593
595{
596 SpaceNla *snla = reinterpret_cast<SpaceNla *>(space_link);
597
598 /* NOTE: Could be deduplicated with the #bDopeSheet handling of #SpaceAction and #SpaceGraph. */
599 if (snla->ads == nullptr) {
600 return;
601 }
602
605}
606
608{
609 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
610 BLO_read_struct(reader, bDopeSheet, &snla->ads);
611}
612
614{
615 SpaceNla *snla = reinterpret_cast<SpaceNla *>(sl);
616
617 BLO_write_struct(writer, SpaceNla, snla);
618 if (snla->ads) {
619 BLO_write_struct(writer, bDopeSheet, snla->ads);
620 }
621}
622
624{
625 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
626 ARegionType *art;
627
628 st->spaceid = SPACE_NLA;
629 STRNCPY(st->name, "NLA");
630
631 st->create = nla_create;
632 st->free = nla_free;
633 st->init = nla_init;
634 st->duplicate = nla_duplicate;
635 st->operatortypes = nla_operatortypes;
636 st->listener = nla_listener;
637 st->keymap = nla_keymap;
638 st->id_remap = nla_id_remap;
639 st->foreach_id = nla_foreach_id;
640 st->blend_read_data = nla_space_blend_read_data;
641 st->blend_read_after_liblink = nullptr;
642 st->blend_write = nla_space_blend_write;
643
644 /* regions: main window */
645 art = MEM_callocN<ARegionType>("spacetype nla region");
653
654 BLI_addhead(&st->regiontypes, art);
655
656 /* regions: header */
657 art = MEM_callocN<ARegionType>("spacetype nla region");
659 art->prefsizey = HEADERY;
661
664
665 BLI_addhead(&st->regiontypes, art);
666
667 /* regions: tracks */
668 art = MEM_callocN<ARegionType>("spacetype nla region");
670 art->prefsizex = 200;
672
677
678 BLI_addhead(&st->regiontypes, art);
679
680 /* regions: UI buttons */
681 art = MEM_callocN<ARegionType>("spacetype nla region");
682 art->regionid = RGN_TYPE_UI;
688
689 BLI_addhead(&st->regiontypes, art);
690
692
693 art = ED_area_type_hud(st->spaceid);
694 BLI_addhead(&st->regiontypes, art);
695
696 BKE_spacetype_register(std::move(st));
697}
SpaceNla * CTX_wm_space_nla(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
@ IDWALK_CB_DIRECT_WEAK_LINK
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
@ 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
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
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
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
#define ARRAY_SIZE(arr)
#define ELEM(...)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
Object groups, one object can be in many groups at once.
@ SCER_PRV_RANGE
#define MAXFRAMEF
#define HEADERY
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_HEADER
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ SPACE_NLA
@ SPACE_EMPTY
@ SNLA_DRAWTIME
@ SNLA_SHOW_MARKERS
@ USER_HEADER_BOTTOM
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_KEEPOFS_Y
@ V2D_ALIGN_NO_POS_Y
@ V2D_LOCKZOOM_Y
#define NLATRACK_TOT_HEIGHT(ac, item_amount)
#define NLATRACK_STEP(snla)
eAnimCont_Types
eAnimFilter_Flags
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
@ ANIMFILTER_FCURVESONLY
@ DRAW_MARKERS_MARGIN
Definition ED_markers.hh:27
void ED_area_tag_redraw(ScrArea *area)
Definition area.cc:714
ARegionType * ED_area_type_hud(int space_type)
@ 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_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
void ED_area_tag_refresh(ScrArea *area)
Definition area.cc:743
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_draw_cb_draw(const bContext *C, ARegion *region, int type)
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
#define UI_SIDEBAR_PANEL_WIDTH
@ TH_BACK
void UI_ThemeClearColor(int colorid)
#define UI_ANIM_MINY
Definition UI_view2d.hh:473
#define UI_MARKER_MARGIN_Y
Definition UI_view2d.hh:470
void UI_view2d_view_orthoSpecial(ARegion *region, View2D *v2d, bool xaxis)
Definition view2d.cc:1136
void UI_view2d_curRect_clamp_y(View2D *v2d)
Definition view2d.cc:844
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
Definition view2d.cc:1503
void UI_view2d_view_restore(const bContext *C)
Definition view2d.cc:1162
void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
Definition view2d.cc:221
void UI_view2d_text_cache_draw(ARegion *region)
Definition view2d.cc:2141
void UI_view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1095
void UI_view2d_draw_lines_x__discrete_frames_or_seconds(const View2D *v2d, const Scene *scene, bool display_seconds, bool display_minor_lines)
@ V2D_COMMONVIEW_LIST
Definition UI_view2d.hh:35
@ V2D_COMMONVIEW_CUSTOM
Definition UI_view2d.hh:31
#define NC_ID
Definition WM_types.hh:392
#define NC_NODE
Definition WM_types.hh:391
#define ND_DRAW
Definition WM_types.hh:458
#define ND_OB_ACTIVE
Definition WM_types.hh:437
#define ND_RENDER_OPTIONS
Definition WM_types.hh:432
#define NC_ANIMATION
Definition WM_types.hh:385
#define ND_SPACE_NLA
Definition WM_types.hh:531
#define NC_SCREEN
Definition WM_types.hh:374
#define ND_OB_SELECT
Definition WM_types.hh:439
#define NC_SCENE
Definition WM_types.hh:375
#define ND_LAYER_CONTENT
Definition WM_types.hh:450
#define NA_EDITED
Definition WM_types.hh:581
#define ND_FRAME_RANGE
Definition WM_types.hh:448
#define ND_MARKERS
Definition WM_types.hh:430
#define ND_FRAME
Definition WM_types.hh:431
#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
#define ND_KEYS
Definition WM_types.hh:460
#define NA_RENAME
Definition WM_types.hh:585
#define ND_BONE_SELECT
Definition WM_types.hh:457
#define NC_OBJECT
Definition WM_types.hh:376
#define NC_SPACE
Definition WM_types.hh:389
void ANIM_animdata_freelist(ListBase *anim_data)
Definition anim_deps.cc:463
void ANIM_draw_previewrange(const Scene *scene, View2D *v2d, int end_frame_width)
Definition anim_draw.cc:75
void ANIM_draw_framerange(Scene *scene, View2D *v2d)
Definition anim_draw.cc:109
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, const eAnimFilter_Flags filter_mode, void *data, const eAnimCont_Types datatype)
ListBase * ED_context_get_markers(const bContext *C)
void ED_markers_draw(const bContext *C, int flag)
#define U
BMesh const char void * data
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
#define filter
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
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
void nla_buttons_register(ARegionType *art)
void draw_nla_track_list(const bContext *C, bAnimContext *ac, ARegion *region, const ListBase &anim_data)
Definition nla_draw.cc:971
void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region)
Definition nla_draw.cc:784
void nla_operatortypes()
Definition nla_ops.cc:81
void nla_keymap(wmKeyConfig *keyconf)
Definition nla_ops.cc:169
PointerRNA RNA_id_pointer_create(ID *id)
static void nla_buttons_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:339
static void nla_listener(const wmSpaceTypeListenerParams *params)
Definition space_nla.cc:540
static void nla_id_remap(ScrArea *, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
Definition space_nla.cc:580
static void nla_main_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:229
static void nla_space_blend_read_data(BlendDataReader *reader, SpaceLink *sl)
Definition space_nla.cc:607
static void nla_track_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:179
static SpaceLink * nla_duplicate(SpaceLink *sl)
Definition space_nla.cc:145
static void nla_header_region_init(wmWindowManager *, ARegion *region)
Definition space_nla.cc:318
void ED_spacetype_nla()
Definition space_nla.cc:623
static void nla_space_blend_write(BlendWriter *writer, SpaceLink *sl)
Definition space_nla.cc:613
static void nla_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition space_nla.cc:441
static void nla_free(SpaceLink *sl)
Definition space_nla.cc:120
static void nla_main_region_draw_overlay(const bContext *C, ARegion *region)
Definition space_nla.cc:300
static void nla_main_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:242
static void nla_track_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
Definition space_nla.cc:513
static void nla_header_region_draw(const bContext *C, ARegion *region)
Definition space_nla.cc:323
static void nla_buttons_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:329
static void nla_track_region_init(wmWindowManager *wm, ARegion *region)
Definition space_nla.cc:156
static void nla_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:344
static void nla_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
Definition space_nla.cc:594
static void nla_main_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:383
static void nla_init(wmWindowManager *wm, ScrArea *area)
Definition space_nla.cc:131
static SpaceLink * nla_create(const ScrArea *area, const Scene *scene)
Definition space_nla.cc:49
static void nla_track_region_listener(const wmRegionListenerParams *params)
Definition space_nla.cc:470
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
void(* listener)(const wmRegionListenerParams *params)
void(* draw)(const bContext *C, ARegion *region)
void(* draw_overlay)(const bContext *C, ARegion *region)
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
ListBase spacedata
ListBase regionbase
struct bDopeSheet * ads
float minzoom
float max[2]
short keepzoom
short keepofs
float min[2]
float maxzoom
SpaceLink * sl
eAnimCont_Types datatype
bDopeSheet * ads
ListBase chanbase
struct Collection * filter_grp
float xmax
float xmin
float ymax
float ymin
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 wmKeyConfig * defaultconf
i
Definition text_draw.cc:230
void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet)
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk)
void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames)
wmEventHandler_Keymap * WM_event_add_keymap_handler_poll(ListBase *handlers, wmKeyMap *keymap, EventHandlerPoll poll)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
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)
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)
wmWindow * WM_window_find_by_area(wmWindowManager *wm, const ScrArea *area)
Scene * WM_window_get_active_scene(const wmWindow *win)