Blender V4.3
keyframes_draw.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9/* System includes ----------------------------------------------------- */
10
11#include <cfloat>
12
13#include "MEM_guardedalloc.h"
14
15#include "BKE_grease_pencil.hh"
16
17#include "BLI_listbase.h"
18#include "BLI_rect.h"
19
20#include "DNA_anim_types.h"
23#include "DNA_mask_types.h"
24
25#include "GPU_immediate.hh"
26#include "GPU_shader_shared.hh"
27#include "GPU_state.hh"
28
29#include "UI_interface.hh"
30#include "UI_resources.hh"
31#include "UI_view2d.hh"
32
33#include "ED_anim_api.hh"
34#include "ED_keyframes_draw.hh"
36
37#include "ANIM_action.hh"
38
39using namespace blender;
40
41/* *************************** Keyframe Drawing *************************** */
42
43void draw_keyframe_shape(const float x,
44 const float y,
45 float size,
46 const bool sel,
47 const eBezTriple_KeyframeType key_type,
48 const eKeyframeShapeDrawOpts mode,
49 const float alpha,
50 const KeyframeShaderBindings *sh_bindings,
51 const short handle_type,
52 const short extreme_type)
53{
54 bool draw_fill = ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH);
55 bool draw_outline = ELEM(mode, KEYFRAME_SHAPE_FRAME, KEYFRAME_SHAPE_BOTH);
56
57 BLI_assert(draw_fill || draw_outline);
58
59 /* Adjust size of keyframe shape according to type of keyframe. */
60 switch (key_type) {
62 break;
63
65 size *= 0.85f;
66 break;
67
69 size *= 0.925f;
70 break;
71
73 size *= 1.2f;
74 break;
75
77 size *= 0.8f;
78 break;
79
81 size *= 0.75;
82 break;
83 }
84
85 uchar fill_col[4];
86 uchar outline_col[4];
87 uint flags = 0;
88
89 /* draw! */
90 if (draw_fill) {
91 /* get interior colors from theme (for selected and unselected only) */
92 switch (key_type) {
95 break;
98 break;
101 break;
104 break;
107 break;
110 break;
111 }
112
113 /* For effects like graying out protected/muted channels. The theme RNA/UI doesn't allow users
114 * to set the alpha. */
115 fill_col[3] = 255.0f * alpha;
116
117 if (!draw_outline) {
118 /* force outline color to match */
119 outline_col[0] = fill_col[0];
120 outline_col[1] = fill_col[1];
121 outline_col[2] = fill_col[2];
122 outline_col[3] = fill_col[3];
123 }
124 }
125
126 if (draw_outline) {
127 /* exterior - black frame */
129 outline_col[3] *= alpha;
130
131 if (!draw_fill) {
132 /* fill color needs to be (outline.rgb, 0) */
133 fill_col[0] = outline_col[0];
134 fill_col[1] = outline_col[1];
135 fill_col[2] = outline_col[2];
136 fill_col[3] = 0;
137 }
138
139 /* Handle type to outline shape. */
140 switch (handle_type) {
143 break; /* circle */
146 break; /* circle with dot */
149 break; /* square */
152 break; /* clipped diamond */
153
155 default:
156 flags = GPU_KEYFRAME_SHAPE_DIAMOND; /* diamond */
157 }
158
159 /* Extreme type to arrow-like shading. */
160 if (extreme_type & KEYFRAME_EXTREME_MAX) {
162 }
163 if (extreme_type & KEYFRAME_EXTREME_MIN) {
165 }
166 if (extreme_type & GPU_KEYFRAME_SHAPE_ARROW_END_MIXED) {
167 flags |= 0x400;
168 }
169 }
170
171 immAttr1f(sh_bindings->size_id, size);
172 immAttr4ubv(sh_bindings->color_id, fill_col);
173 immAttr4ubv(sh_bindings->outline_color_id, outline_col);
174 immAttr1u(sh_bindings->flags_id, flags);
175 immVertex2f(sh_bindings->pos_id, x, y);
176}
177
178/* Common attributes shared between the draw calls. */
180 float alpha;
184 float ipo_size;
187 float sel_color[4];
188 float unsel_color[4];
189 float sel_mhcol[4];
190 float unsel_mhcol[4];
191 float ipo_color[4];
193
194 /* Show interpolation and handle type? */
196};
197
199 View2D *v2d,
200 float yscale_fac,
201 bool channel_locked,
202 eSAction_Flag saction_flag)
203{
204 /* locked channels are less strongly shown, as feedback for locked channels in DopeSheet */
205 /* TODO: allow this opacity factor to be themed? */
206 ctx->alpha = channel_locked ? 0.25f : 1.0f;
207
208 ctx->icon_size = U.widget_unit * 0.5f * yscale_fac;
209 ctx->half_icon_size = 0.5f * ctx->icon_size;
210 ctx->smaller_size = 0.35f * ctx->icon_size;
211 ctx->ipo_size = 0.1f * ctx->icon_size;
212 ctx->gpencil_size = ctx->smaller_size * 0.8f;
214
215 ctx->show_ipo = (saction_flag & SACTION_SHOW_INTERPOLATION) != 0;
216
220
221 ctx->sel_color[3] *= ctx->alpha;
222 ctx->unsel_color[3] *= ctx->alpha;
223 ctx->ipo_color[3] *= ctx->alpha;
224
225 copy_v4_v4(ctx->sel_mhcol, ctx->sel_color);
226 ctx->sel_mhcol[3] *= 0.8f;
228 ctx->unsel_mhcol[3] *= 0.8f;
230 ctx->ipo_color_mix[3] *= 0.5f;
231}
232
234 const ActKeyColumn *ab,
235 float ypos)
236{
238 float size = 1.0f;
239 switch (ab->next->key_type) {
244 size *= 0.5f;
245 break;
247 size *= 0.8f;
248 break;
250 break;
251 }
252
253 rctf box;
254 box.xmin = ab->cfra;
255 box.xmax = min_ff(ab->next->cfra - (ctx->screenspace_margin * size), ab->next->cfra);
256 box.ymin = ypos - ctx->gpencil_size;
257 box.ymax = ypos + ctx->gpencil_size;
258
260 &box, true, 0.25f * float(UI_UNIT_X), (ab->block.sel) ? ctx->sel_mhcol : ctx->unsel_mhcol);
261}
262
264 const ActKeyColumn *ab,
265 float ypos)
266{
267 rctf box;
268 box.xmin = ab->cfra;
269 box.xmax = ab->next->cfra;
270 box.ymin = ypos - ctx->smaller_size;
271 box.ymax = ypos + ctx->smaller_size;
272
273 UI_draw_roundbox_4fv(&box, true, 3.0f, (ab->block.sel) ? ctx->sel_mhcol : ctx->unsel_mhcol);
274}
275
277 const ActKeyColumn *ab,
278 float ypos)
279{
280 rctf box;
281 box.xmin = ab->cfra;
282 box.xmax = ab->next->cfra;
283 box.ymin = ypos - ctx->half_icon_size;
284 box.ymax = ypos + ctx->half_icon_size;
285
286 UI_draw_roundbox_4fv(&box, true, 3.0f, (ab->block.sel) ? ctx->sel_color : ctx->unsel_color);
287}
288
290 const ActKeyColumn *ab,
291 float ypos)
292{
293 rctf box;
294 box.xmin = ab->cfra;
295 box.xmax = ab->next->cfra;
296 box.ymin = ypos - ctx->ipo_size;
297 box.ymax = ypos + ctx->ipo_size;
298
300 true,
301 3.0f,
303 ctx->ipo_color);
304}
305
306static void draw_keylist_block(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
307{
308 /* Draw grease pencil bars between keyframes. */
309 if ((ab->next != nullptr) && (ab->block.flag & ACTKEYBLOCK_FLAG_GPENCIL)) {
310 draw_keylist_block_gpencil(ctx, ab, ypos);
311 }
312 else {
313 /* Draw other types. */
315
316 int valid_hold = actkeyblock_get_valid_hold(ab);
317 if (valid_hold != 0) {
318 if ((valid_hold & ACTKEYBLOCK_FLAG_STATIC_HOLD) == 0) {
319 /* draw "moving hold" long-keyframe block - slightly smaller */
320 draw_keylist_block_moving_hold(ctx, ab, ypos);
321 }
322 else {
323 /* draw standard long-keyframe block */
324 draw_keylist_block_standard(ctx, ab, ypos);
325 }
326 }
327 if (ctx->show_ipo && actkeyblock_is_valid(ab) &&
329 {
330 /* draw an interpolation line */
332 }
333 }
334}
335
337 const ActKeyColumn *keys,
338 const int key_len,
339 float ypos)
340{
341 for (int i = 0; i < key_len; i++) {
342 const ActKeyColumn *ab = &keys[i];
343 draw_keylist_block(ctx, ab, ypos);
344 }
345}
346
347static bool draw_keylist_is_visible_key(const View2D *v2d, const ActKeyColumn *ak)
348{
349 return IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax);
350}
351
353 View2D *v2d,
354 const KeyframeShaderBindings *sh_bindings,
355 const ActKeyColumn *keys,
356 const int key_len,
357 float ypos,
358 eSAction_Flag saction_flag)
359{
360 short handle_type = KEYFRAME_HANDLE_NONE, extreme_type = KEYFRAME_EXTREME_NONE;
361
362 for (int i = 0; i < key_len; i++) {
363 const ActKeyColumn *ak = &keys[i];
364 if (draw_keylist_is_visible_key(v2d, ak)) {
365 if (ctx->show_ipo) {
366 handle_type = ak->handle_type;
367 }
368 if (saction_flag & SACTION_SHOW_EXTREMES) {
369 extreme_type = ak->extreme_type;
370 }
371
373 ypos,
374 ctx->icon_size,
375 (ak->sel & SELECT),
378 ctx->alpha,
379 sh_bindings,
380 handle_type,
381 extreme_type);
382 }
383 }
384}
385
386/* *************************** Drawing Stack *************************** */
402
429
431{
432 switch (elem->type) {
434 summary_to_keylist(elem->ac, elem->keylist, elem->saction_flag, range);
435 break;
436 }
437 case ChannelType::SCENE: {
438 scene_to_keylist(elem->ads, elem->sce, elem->keylist, elem->saction_flag, range);
439 break;
440 }
441 case ChannelType::OBJECT: {
442 ob_to_keylist(elem->ads, elem->ob, elem->keylist, elem->saction_flag, range);
443 break;
444 }
445 case ChannelType::FCURVE: {
446 fcurve_to_keylist(elem->adt, elem->fcu, elem->keylist, elem->saction_flag, range);
447 break;
448 }
450 action_to_keylist(elem->adt, elem->act, elem->keylist, elem->saction_flag, range);
451 break;
452 }
454 BLI_assert(elem->act);
455 BLI_assert(elem->action_slot);
457 elem->act->wrap(),
458 elem->action_slot->handle,
459 elem->keylist,
460 elem->saction_flag,
461 range);
462 break;
463 }
465 action_to_keylist(elem->adt, elem->act, elem->keylist, elem->saction_flag, range);
466 break;
467 }
469 action_group_to_keylist(elem->adt, elem->agrp, elem->keylist, elem->saction_flag, range);
470 break;
471 }
474 elem->adt, elem->grease_pencil_layer, elem->keylist, elem->saction_flag);
475 break;
476 }
479 elem->adt, elem->grease_pencil_layer_group, elem->keylist, elem->saction_flag);
480 break;
481 }
483 if (elem->ac->datatype != ANIMCONT_GPENCIL && elem->adt) {
484 action_to_keylist(elem->adt, elem->adt->action, elem->keylist, elem->saction_flag, range);
485 }
487 elem->adt, elem->grease_pencil, elem->keylist, elem->saction_flag, false);
488 break;
489 }
491 gpl_to_keylist(elem->ads, elem->gpl, elem->keylist);
492 break;
493 }
495 mask_to_keylist(elem->ads, elem->masklay, elem->keylist);
496 break;
497 }
498 }
499}
500
502{
504 channel_ui_data_init(&ctx, v2d, elem->yscale_fac, elem->channel_locked, elem->saction_flag);
505
506 const int key_len = ED_keylist_array_len(elem->keylist);
507 const ActKeyColumn *keys = ED_keylist_array(elem->keylist);
508 draw_keylist_blocks(&ctx, keys, key_len, elem->ypos);
509}
510
512 View2D *v2d,
513 const KeyframeShaderBindings *sh_bindings)
514{
516 channel_ui_data_init(&ctx, v2d, elem->yscale_fac, elem->channel_locked, elem->saction_flag);
517
518 const int key_len = ED_keylist_array_len(elem->keylist);
519 const ActKeyColumn *keys = ED_keylist_array(elem->keylist);
520 draw_keylist_keys(&ctx, v2d, sh_bindings, keys, key_len, elem->ypos, elem->saction_flag);
521}
522
527
530 ListBase /*ChannelListElement*/ channels;
531};
532
534{
535 return static_cast<ChannelDrawList *>(MEM_callocN(sizeof(ChannelDrawList), __func__));
536}
537
539{
540 LISTBASE_FOREACH (ChannelListElement *, elem, &channel_list->channels) {
541 build_channel_keylist(elem, range);
543 }
544}
545
546static void channel_list_draw_blocks(ChannelDrawList *channel_list, View2D *v2d)
547{
548 LISTBASE_FOREACH (ChannelListElement *, elem, &channel_list->channels) {
549 draw_channel_blocks(elem, v2d);
550 }
551}
552
553static int channel_visible_key_len(const View2D *v2d, const ListBase * /*ActKeyColumn*/ keys)
554{
555 /* count keys */
556 uint len = 0;
557
558 LISTBASE_FOREACH (ActKeyColumn *, ak, keys) {
559 /* Optimization: if keyframe doesn't appear within 5 units (screenspace)
560 * in visible area, don't draw.
561 * This might give some improvements,
562 * since we current have to flip between view/region matrices.
563 */
564 if (draw_keylist_is_visible_key(v2d, ak)) {
565 len++;
566 }
567 }
568 return len;
569}
570
571static int channel_list_visible_key_len(const ChannelDrawList *channel_list, const View2D *v2d)
572{
573 uint len = 0;
574 LISTBASE_FOREACH (ChannelListElement *, elem, &channel_list->channels) {
575 const ListBase *keys = ED_keylist_listbase(elem->keylist);
576 len += channel_visible_key_len(v2d, keys);
577 }
578 return len;
579}
580
581static void channel_list_draw_keys(ChannelDrawList *channel_list, View2D *v2d)
582{
583 const int visible_key_len = channel_list_visible_key_len(channel_list, v2d);
584 if (visible_key_len == 0) {
585 return;
586 }
587
589
591 KeyframeShaderBindings sh_bindings;
592
595 sh_bindings.color_id = GPU_vertformat_attr_add(
598 format, "outlineColor", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
600
603 immUniform1f("outline_scale", 1.0f);
604 immUniform2f("ViewportSize", BLI_rcti_size_x(&v2d->mask) + 1, BLI_rcti_size_y(&v2d->mask) + 1);
605 immBegin(GPU_PRIM_POINTS, visible_key_len);
606
607 LISTBASE_FOREACH (ChannelListElement *, elem, &channel_list->channels) {
608 draw_channel_keys(elem, v2d, &sh_bindings);
609 }
610
611 immEnd();
614
616}
617
618static void channel_list_draw(ChannelDrawList *channel_list, View2D *v2d)
619{
620 channel_list_draw_blocks(channel_list, v2d);
621 channel_list_draw_keys(channel_list, v2d);
622}
623
625{
626 channel_list_build_keylists(channel_list, {v2d->cur.xmin, v2d->cur.xmax});
627 channel_list_draw(channel_list, v2d);
628}
629
631{
632 LISTBASE_FOREACH (ChannelListElement *, elem, &channel_list->channels) {
633 ED_keylist_free(elem->keylist);
634 }
635 BLI_freelistN(&channel_list->channels);
636 MEM_freeN(channel_list);
637}
638
640 ChannelType elem_type,
641 float ypos,
642 float yscale_fac,
643 eSAction_Flag saction_flag)
644{
645 ChannelListElement *draw_elem = static_cast<ChannelListElement *>(
646 MEM_callocN(sizeof(ChannelListElement), __func__));
647 BLI_addtail(&channel_list->channels, draw_elem);
648 draw_elem->type = elem_type;
649 draw_elem->keylist = ED_keylist_create();
650 draw_elem->ypos = ypos;
651 draw_elem->yscale_fac = yscale_fac;
652 draw_elem->saction_flag = saction_flag;
653 return draw_elem;
654}
655
656/* *************************** Channel Drawing Functions *************************** */
657
659 bAnimContext *ac,
660 float ypos,
661 float yscale_fac,
662 int saction_flag)
663{
664 saction_flag &= ~SACTION_SHOW_EXTREMES;
666 channel_list, ChannelType::SUMMARY, ypos, yscale_fac, eSAction_Flag(saction_flag));
667 draw_elem->ac = ac;
668}
669
671 bDopeSheet *ads,
672 Scene *sce,
673 float ypos,
674 float yscale_fac,
675 int saction_flag)
676{
677 saction_flag &= ~SACTION_SHOW_EXTREMES;
679 channel_list, ChannelType::SCENE, ypos, yscale_fac, eSAction_Flag(saction_flag));
680 draw_elem->ads = ads;
681 draw_elem->sce = sce;
682}
683
685 bDopeSheet *ads,
686 Object *ob,
687 float ypos,
688 float yscale_fac,
689 int saction_flag)
690{
691 saction_flag &= ~SACTION_SHOW_EXTREMES;
693 channel_list, ChannelType::OBJECT, ypos, yscale_fac, eSAction_Flag(saction_flag));
694 draw_elem->ads = ads;
695 draw_elem->ob = ob;
696}
697
699 AnimData *adt,
700 FCurve *fcu,
701 float ypos,
702 float yscale_fac,
703 int saction_flag)
704{
705 const bool locked = (fcu->flag & FCURVE_PROTECTED) ||
706 ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ||
707 ((adt && adt->action) &&
709
711 channel_list, ChannelType::FCURVE, ypos, yscale_fac, eSAction_Flag(saction_flag));
712 draw_elem->adt = adt;
713 draw_elem->fcu = fcu;
714 draw_elem->channel_locked = locked;
715}
716
718 AnimData *adt,
719 bActionGroup *agrp,
720 float ypos,
721 float yscale_fac,
722 int saction_flag)
723{
724 bool locked = (agrp->flag & AGRP_PROTECTED) ||
725 ((adt && adt->action) &&
727
729 channel_list, ChannelType::ACTION_GROUP, ypos, yscale_fac, eSAction_Flag(saction_flag));
730 draw_elem->adt = adt;
731 draw_elem->agrp = agrp;
732 draw_elem->channel_locked = locked;
733}
734
736 AnimData *adt,
737 bAction *action,
738 const float ypos,
739 const float yscale_fac,
740 int saction_flag)
741{
742 BLI_assert(action);
743 BLI_assert(action->wrap().is_action_layered());
744
745 const bool locked = (!ID_IS_EDITABLE(action) || ID_IS_OVERRIDE_LIBRARY(action));
746 saction_flag &= ~SACTION_SHOW_EXTREMES;
747
749 channel_list, ChannelType::ACTION_LAYERED, ypos, yscale_fac, eSAction_Flag(saction_flag));
750 draw_elem->adt = adt;
751 draw_elem->act = action;
752 draw_elem->channel_locked = locked;
753}
754
756 AnimData *adt,
757 animrig::Action &action,
758 animrig::Slot &slot,
759 const float ypos,
760 const float yscale_fac,
761 int saction_flag)
762{
763 const bool locked = (ID_IS_LINKED(&action) || ID_IS_OVERRIDE_LIBRARY(&action));
764 saction_flag &= ~SACTION_SHOW_EXTREMES;
765
767 channel_list, ChannelType::ACTION_SLOT, ypos, yscale_fac, eSAction_Flag(saction_flag));
768 draw_elem->adt = adt;
769 draw_elem->act = &action;
770 draw_elem->action_slot = &slot;
771 draw_elem->channel_locked = locked;
772}
773
775 AnimData *adt,
776 bAction *act,
777 float ypos,
778 float yscale_fac,
779 int saction_flag)
780{
781#ifdef WITH_ANIM_BAKLAVA
782 BLI_assert(!act || act->wrap().is_action_legacy());
783#endif
784
785 const bool locked = (act && (!ID_IS_EDITABLE(act) || ID_IS_OVERRIDE_LIBRARY(act)));
786 saction_flag &= ~SACTION_SHOW_EXTREMES;
787
789 channel_list, ChannelType::ACTION_LEGACY, ypos, yscale_fac, eSAction_Flag(saction_flag));
790 draw_elem->adt = adt;
791 draw_elem->act = act;
792 draw_elem->channel_locked = locked;
793}
794
796 bAnimContext *ac,
797 AnimData *adt,
798 const GreasePencil *grease_pencil,
799 const float ypos,
800 const float yscale_fac,
801 int saction_flag)
802{
803 ChannelListElement *draw_elem = channel_list_add_element(channel_list,
805 ypos,
806 yscale_fac,
807 eSAction_Flag(saction_flag));
808 /* GreasePencil properties can be animated via an Action, so the GP-related
809 * animation data is not limited to GP drawings. */
810 draw_elem->adt = adt;
811 draw_elem->act = adt ? adt->action : nullptr;
812 draw_elem->grease_pencil = grease_pencil;
813 draw_elem->ac = ac;
814}
815
817 bDopeSheet *ads,
818 const GreasePencilLayer *layer,
819 const float ypos,
820 const float yscale_fac,
821 int saction_flag)
822{
823 ChannelListElement *draw_elem = channel_list_add_element(channel_list,
825 ypos,
826 yscale_fac,
827 eSAction_Flag(saction_flag));
828 draw_elem->ads = ads;
829 draw_elem->grease_pencil_layer = layer;
830 draw_elem->channel_locked = layer->wrap().is_locked();
831}
832
834 bDopeSheet *ads,
835 const GreasePencilLayerTreeGroup *layer_group,
836 const float ypos,
837 const float yscale_fac,
838 int saction_flag)
839{
840 ChannelListElement *draw_elem = channel_list_add_element(channel_list,
842 ypos,
843 yscale_fac,
844 eSAction_Flag(saction_flag));
845 draw_elem->ads = ads;
846 draw_elem->grease_pencil_layer_group = layer_group;
847 draw_elem->channel_locked = layer_group->wrap().is_locked();
848}
849
851 bDopeSheet *ads,
852 bGPDlayer *gpl,
853 float ypos,
854 float yscale_fac,
855 int saction_flag)
856{
857 bool locked = (gpl->flag & GP_LAYER_LOCKED) != 0;
858 ChannelListElement *draw_elem = channel_list_add_element(channel_list,
860 ypos,
861 yscale_fac,
862 eSAction_Flag(saction_flag));
863 draw_elem->ads = ads;
864 draw_elem->gpl = gpl;
865 draw_elem->channel_locked = locked;
866}
867
869 bDopeSheet *ads,
870 MaskLayer *masklay,
871 float ypos,
872 float yscale_fac,
873 int saction_flag)
874{
875 bool locked = (masklay->flag & MASK_LAYERFLAG_LOCKED) != 0;
877 channel_list, ChannelType::MASK_LAYER, ypos, yscale_fac, eSAction_Flag(saction_flag));
878 draw_elem->ads = ads;
879 draw_elem->masklay = masklay;
880 draw_elem->channel_locked = locked;
881}
Functions and classes to work with Actions.
Low-level operations for grease pencil.
#define BLI_assert(a)
Definition BLI_assert.h:50
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:496
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
MINLINE float min_ff(float a, float b)
MINLINE void copy_v4_v4(float r[4], const float a[4])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:193
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
unsigned char uchar
unsigned int uint
#define ELEM(...)
#define IN_RANGE_INCL(a, b, c)
#define ID_IS_LINKED(_id)
Definition DNA_ID.h:654
#define ID_IS_EDITABLE(_id)
Definition DNA_ID.h:658
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition DNA_ID.h:683
@ AGRP_PROTECTED
eSAction_Flag
@ SACTION_SHOW_INTERPOLATION
@ SACTION_SHOW_EXTREMES
@ FCURVE_PROTECTED
eBezTriple_KeyframeType
@ BEZT_KEYTYPE_EXTREME
@ BEZT_KEYTYPE_JITTER
@ BEZT_KEYTYPE_BREAKDOWN
@ BEZT_KEYTYPE_MOVEHOLD
@ BEZT_KEYTYPE_GENERATED
@ BEZT_KEYTYPE_KEYFRAME
@ MASK_LAYERFLAG_LOCKED
@ ANIMCONT_GPENCIL
@ ACTKEYBLOCK_FLAG_GPENCIL
@ ACTKEYBLOCK_FLAG_NON_BEZIER
@ ACTKEYBLOCK_FLAG_STATIC_HOLD
eKeyframeShapeDrawOpts
@ KEYFRAME_SHAPE_INSIDE
@ KEYFRAME_SHAPE_BOTH
@ KEYFRAME_SHAPE_FRAME
@ KEYFRAME_HANDLE_VECTOR
@ KEYFRAME_HANDLE_FREE
@ KEYFRAME_HANDLE_AUTO_CLAMP
@ KEYFRAME_HANDLE_NONE
@ KEYFRAME_HANDLE_AUTO
@ KEYFRAME_HANDLE_ALIGNED
@ KEYFRAME_EXTREME_MAX
@ KEYFRAME_EXTREME_NONE
@ KEYFRAME_EXTREME_MIN
void immEnd()
void immUnbindProgram()
void immUniform2f(const char *name, float x, float y)
void immAttr4ubv(uint attr_id, const unsigned char data[4])
void immVertex2f(uint attr_id, float x, float y)
void immAttr1f(uint attr_id, float x)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immAttr1u(uint attr_id, uint x)
void immUniform1f(const char *name, float x)
GPUVertFormat * immVertexFormat()
void immBegin(GPUPrimType, uint vertex_len)
@ GPU_PRIM_POINTS
@ GPU_SHADER_KEYFRAME_SHAPE
@ GPU_KEYFRAME_SHAPE_INNER_DOT
@ GPU_KEYFRAME_SHAPE_CIRCLE
@ GPU_KEYFRAME_SHAPE_SQUARE
@ GPU_KEYFRAME_SHAPE_ARROW_END_MIXED
@ GPU_KEYFRAME_SHAPE_DIAMOND
@ GPU_KEYFRAME_SHAPE_ARROW_END_MAX
@ GPU_KEYFRAME_SHAPE_ARROW_END_MIN
@ GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL
void GPU_program_point_size(bool enable)
Definition gpu_state.cc:175
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(eGPUBlend blend)
Definition gpu_state.cc:42
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT_UNIT
@ GPU_FETCH_INT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_U32
@ GPU_COMP_U8
Read Guarded memory(de)allocation.
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void UI_draw_roundbox_corner_set(int type)
@ UI_CNR_BOTTOM_RIGHT
@ UI_CNR_TOP_RIGHT
@ UI_CNR_NONE
#define UI_UNIT_X
@ TH_KEYTYPE_GENERATED
@ TH_KEYBORDER_SELECT
@ TH_KEYTYPE_BREAKDOWN
@ TH_KEYTYPE_KEYFRAME
@ TH_DOPESHEET_IPOLINE
@ TH_KEYBORDER
@ TH_KEYTYPE_JITTER
@ TH_KEYTYPE_EXTREME
@ TH_KEYTYPE_KEYFRAME_SELECT
@ TH_KEYTYPE_MOVEHOLD
@ TH_KEYTYPE_BREAKDOWN_SELECT
@ TH_KEYTYPE_EXTREME_SELECT
@ TH_STRIP
@ TH_KEYTYPE_MOVEHOLD_SELECT
@ TH_KEYTYPE_JITTER_SELECT
@ TH_KEYTYPE_GENERATED_SELECT
@ TH_STRIP_SELECT
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
float UI_view2d_scale_get_x(const View2D *v2d)
Definition view2d.cc:1916
unsigned int U
Definition btGjkEpa3.h:78
#define SELECT
int len
draw_view in_light_buf[] float
void ED_add_action_slot_channel(ChannelDrawList *channel_list, AnimData *adt, animrig::Action &action, animrig::Slot &slot, const float ypos, const float yscale_fac, int saction_flag)
static void draw_keylist_block_standard(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
static void channel_ui_data_init(DrawKeylistUIData *ctx, View2D *v2d, float yscale_fac, bool channel_locked, eSAction_Flag saction_flag)
static void prepare_channel_for_drawing(ChannelListElement *elem)
void ED_add_grease_pencil_layer_legacy_channel(ChannelDrawList *channel_list, bDopeSheet *ads, bGPDlayer *gpl, float ypos, float yscale_fac, int saction_flag)
static void draw_keylist_block_gpencil(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
ChannelType
ChannelDrawList * ED_channel_draw_list_create()
void ED_add_grease_pencil_cels_channel(ChannelDrawList *channel_list, bDopeSheet *ads, const GreasePencilLayer *layer, const float ypos, const float yscale_fac, int saction_flag)
static void channel_list_draw_blocks(ChannelDrawList *channel_list, View2D *v2d)
void ED_add_scene_channel(ChannelDrawList *channel_list, bDopeSheet *ads, Scene *sce, float ypos, float yscale_fac, int saction_flag)
void ED_channel_list_flush(ChannelDrawList *channel_list, View2D *v2d)
static int channel_list_visible_key_len(const ChannelDrawList *channel_list, const View2D *v2d)
void ED_add_grease_pencil_layer_group_channel(ChannelDrawList *channel_list, bDopeSheet *ads, const GreasePencilLayerTreeGroup *layer_group, const float ypos, const float yscale_fac, int saction_flag)
static void draw_channel_keys(ChannelListElement *elem, View2D *v2d, const KeyframeShaderBindings *sh_bindings)
void ED_add_action_channel(ChannelDrawList *channel_list, AnimData *adt, bAction *act, float ypos, float yscale_fac, int saction_flag)
static void channel_list_build_keylists(ChannelDrawList *channel_list, blender::float2 range)
static void draw_keylist_block_interpolation_line(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
static void draw_channel_blocks(ChannelListElement *elem, View2D *v2d)
void ED_add_action_layered_channel(ChannelDrawList *channel_list, AnimData *adt, bAction *action, const float ypos, const float yscale_fac, int saction_flag)
static void draw_keylist_block(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
static void channel_list_draw_keys(ChannelDrawList *channel_list, View2D *v2d)
static void channel_list_draw(ChannelDrawList *channel_list, View2D *v2d)
void draw_keyframe_shape(const float x, const float y, float size, const bool sel, const eBezTriple_KeyframeType key_type, const eKeyframeShapeDrawOpts mode, const float alpha, const KeyframeShaderBindings *sh_bindings, const short handle_type, const short extreme_type)
void ED_channel_list_free(ChannelDrawList *channel_list)
static void draw_keylist_block_moving_hold(const DrawKeylistUIData *ctx, const ActKeyColumn *ab, float ypos)
void ED_add_fcurve_channel(ChannelDrawList *channel_list, AnimData *adt, FCurve *fcu, float ypos, float yscale_fac, int saction_flag)
void ED_add_action_group_channel(ChannelDrawList *channel_list, AnimData *adt, bActionGroup *agrp, float ypos, float yscale_fac, int saction_flag)
static bool draw_keylist_is_visible_key(const View2D *v2d, const ActKeyColumn *ak)
void ED_add_mask_layer_channel(ChannelDrawList *channel_list, bDopeSheet *ads, MaskLayer *masklay, float ypos, float yscale_fac, int saction_flag)
void ED_add_summary_channel(ChannelDrawList *channel_list, bAnimContext *ac, float ypos, float yscale_fac, int saction_flag)
static ChannelListElement * channel_list_add_element(ChannelDrawList *channel_list, ChannelType elem_type, float ypos, float yscale_fac, eSAction_Flag saction_flag)
void ED_add_object_channel(ChannelDrawList *channel_list, bDopeSheet *ads, Object *ob, float ypos, float yscale_fac, int saction_flag)
static int channel_visible_key_len(const View2D *v2d, const ListBase *keys)
static void build_channel_keylist(ChannelListElement *elem, blender::float2 range)
static void draw_keylist_keys(const DrawKeylistUIData *ctx, View2D *v2d, const KeyframeShaderBindings *sh_bindings, const ActKeyColumn *keys, const int key_len, float ypos, eSAction_Flag saction_flag)
static void draw_keylist_blocks(const DrawKeylistUIData *ctx, const ActKeyColumn *keys, const int key_len, float ypos)
void ED_add_grease_pencil_datablock_channel(ChannelDrawList *channel_list, bAnimContext *ac, AnimData *adt, const GreasePencil *grease_pencil, const float ypos, const float yscale_fac, int saction_flag)
void mask_to_keylist(bDopeSheet *, MaskLayer *masklay, AnimKeylist *keylist)
bool actkeyblock_is_valid(const ActKeyColumn *ac)
void scene_to_keylist(bDopeSheet *ads, Scene *sce, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void ob_to_keylist(bDopeSheet *ads, Object *ob, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void grease_pencil_data_block_to_keylist(AnimData *adt, const GreasePencil *grease_pencil, AnimKeylist *keylist, const int saction_flag, const bool active_layer_only)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
void summary_to_keylist(bAnimContext *ac, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
AnimKeylist * ED_keylist_create()
int actkeyblock_get_valid_hold(const ActKeyColumn *ac)
void ED_keylist_free(AnimKeylist *keylist)
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void action_slot_to_keylist(AnimData *adt, animrig::Action &action, const animrig::slot_handle_t slot_handle, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
int64_t ED_keylist_array_len(const AnimKeylist *keylist)
const ListBase * ED_keylist_listbase(const AnimKeylist *keylist)
void grease_pencil_layer_group_to_keylist(AnimData *adt, const GreasePencilLayerTreeGroup *layer_group, AnimKeylist *keylist, const int saction_flag)
void action_to_keylist(AnimData *adt, bAction *dna_action, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void grease_pencil_cels_to_keylist(AnimData *, const GreasePencilLayer *gpl, AnimKeylist *keylist, int)
void gpl_to_keylist(bDopeSheet *, bGPDlayer *gpl, AnimKeylist *keylist)
void action_group_to_keylist(AnimData *adt, bActionGroup *agrp, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
const ActKeyColumn * ED_keylist_array(const AnimKeylist *keylist)
format
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
eBezTriple_KeyframeType key_type
ActKeyColumn * next
ActKeyBlockInfo block
bAction * action
AnimKeylist * keylist
const GreasePencilLayer * grease_pencil_layer
bActionGroup * agrp
ChannelListElement * prev
const GreasePencilLayerTreeGroup * grease_pencil_layer_group
animrig::Slot * action_slot
ChannelListElement * next
const GreasePencil * grease_pencil
eSAction_Flag saction_flag
bActionGroup * grp
eAnimCont_Types datatype
float xmax
float xmin