78 const float *cframe =
data;
130 float cur_y = chain->
cur->
vec[1][1];
131 float prev_y = cur_y, next_y = cur_y;
134 prev_y = chain->
prev->
vec[1][1];
137 next_y = chain->
next->
vec[1][1];
141 if (prev_y == cur_y && next_y == cur_y) {
146 if ((prev_y < cur_y && next_y > cur_y) || (prev_y > cur_y && next_y < cur_y)) {
153 float handle_l = l_bezier ? chain->
cur->
vec[0][1] : cur_y;
154 float handle_r = r_bezier ? chain->
cur->
vec[2][1] : cur_y;
157 if (prev_y < cur_y || next_y < cur_y) {
158 bool is_overshoot = (handle_l > cur_y || handle_r > cur_y);
163 if (prev_y > cur_y || next_y > cur_y) {
164 bool is_overshoot = (handle_l < cur_y || handle_r < cur_y);
298 float frame = masklay_shape->
frame;
358 if (
ELEM(
NULL, keys, masklay_shape)) {
421 if (
col->totcurve <= 1 &&
col->totblock == 0) {
426 col->block.conflict |= (
col->block.flag ^ block->
flag);
427 col->block.flag |= block->
flag;
428 col->block.sel |= block->
sel;
440 if (bezt && bezt_len >= 2) {
451 for (
int v = 1;
col !=
NULL &&
v < bezt_len;
v++, bezt++) {
453 if (
is_cfra_lt(bezt[1].vec[1][0], bezt[0].vec[1][0])) {
459 if (newcol !=
NULL) {
508 max_curve =
MAX2(max_curve,
col->totcurve);
516 if (
col->totcurve > 0) {
520 else if (prev_ready !=
NULL) {
525 col->totcurve = max_curve + 1;
563 uint outline_color_id,
594 size -= 0.8f * key_type;
598 uchar outline_col[4];
625 fill_col[3] *=
alpha;
629 outline_col[0] = fill_col[0];
630 outline_col[1] = fill_col[1];
631 outline_col[2] = fill_col[2];
632 outline_col[3] = fill_col[3];
639 outline_col[3] *=
alpha;
643 fill_col[0] = outline_col[0];
644 fill_col[1] = outline_col[1];
645 fill_col[2] = outline_col[2];
650 switch (handle_type) {
699 const float icon_sz =
U.widget_unit * 0.5f * yscale_fac;
700 const float half_icon_sz = 0.5f * icon_sz;
701 const float smaller_sz = 0.35f * icon_sz;
702 const float ipo_sz = 0.1f * icon_sz;
703 const float gpencil_sz = smaller_sz * 0.8f;
708 float alpha = channelLocked ? 0.25f : 1.0f;
713 float sel_color[4], unsel_color[4];
714 float sel_mhcol[4], unsel_mhcol[4];
715 float ipo_color[4], ipo_color_mix[4];
722 sel_color[3] *=
alpha;
723 unsel_color[3] *=
alpha;
724 ipo_color[3] *=
alpha;
727 sel_mhcol[3] *= 0.8f;
729 unsel_mhcol[3] *= 0.8f;
731 ipo_color_mix[3] *= 0.5f;
738 switch (ab->next->key_type) {
753 .xmax =
min_ff(ab->next->cfra - (screenspace_margin *
size), ab->next->cfra),
754 .ymin = ypos - gpencil_sz,
755 .ymax = ypos + gpencil_sz,
759 (ab->block.sel) ? sel_mhcol : unsel_mhcol);
766 if (valid_hold != 0) {
772 .xmax = ab->next->cfra,
773 .ymin = ypos - smaller_sz,
774 .ymax = ypos + smaller_sz,
778 (ab->block.sel) ? sel_mhcol : unsel_mhcol);
785 .xmax = ab->next->cfra,
786 .ymin = ypos - half_icon_sz,
787 .ymax = ypos + half_icon_sz,
791 (ab->block.sel) ? sel_color : unsel_color);
799 .xmax = ab->next->cfra,
800 .ymin = ypos - ipo_sz,
801 .ymax = ypos + ipo_sz,
847 handle_type = ak->handle_type;
850 extreme_type = ak->extreme_type;
891 draw_keylist(v2d, &keys, ypos, yscale_fac,
false, saction_flag);
907 draw_keylist(v2d, &keys, ypos, yscale_fac,
false, saction_flag);
923 draw_keylist(v2d, &keys, ypos, yscale_fac,
false, saction_flag);
941 draw_keylist(v2d, &keys, ypos, yscale_fac, locked, saction_flag);
958 draw_keylist(v2d, &keys, ypos, yscale_fac, locked, saction_flag);
976 draw_keylist(v2d, &keys, ypos, yscale_fac, locked, saction_flag);
992 draw_keylist(v2d, &keys, ypos, yscale_fac,
false, saction_flag);
1008 draw_keylist(v2d, &keys, ypos, yscale_fac, locked, saction_flag);
1028 draw_keylist(v2d, &keys, ypos, yscale_fac, locked, saction_flag);
1047 for (ale = anim_data.
first; ale; ale = ale->
next) {
1089 dummychan.
data = sce;
1090 dummychan.
id = &sce->
id;
1091 dummychan.
adt = sce->
adt;
1094 ac.
data = &dummychan;
1102 for (ale = anim_data.
first; ale; ale = ale->
next) {
1127 dummychan.
data = &dummybase;
1128 dummychan.
id = &ob->
id;
1132 ac.
data = &dummychan;
1140 for (ale = anim_data.
first; ale; ale = ale->
next) {
1152 if (cache_file ==
NULL) {
1159 dummychan.
data = cache_file;
1160 dummychan.
id = &cache_file->
id;
1161 dummychan.
adt = cache_file->
adt;
1165 ac.
data = &dummychan;
1277 if (masklay && keys) {
1279 masklay_shape = masklay_shape->
next) {
typedef float(TangentPoint)[2]
#define BEZT_BINARYSEARCH_THRESH
bool BKE_fcurve_is_cyclic(struct FCurve *fcu)
void BLI_dlrbTree_init(DLRBT_Tree *tree)
DLRBT_Node * BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data)
void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree)
DLRBT_Node * BLI_dlrbTree_search_exact(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data)
void BLI_dlrbTree_free(DLRBT_Tree *tree)
#define LISTBASE_FOREACH(type, var, list)
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)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
#define IN_RANGE_INCL(a, b, c)
#define ID_IS_LINKED(_id)
@ SACTION_SHOW_INTERPOLATION
#define BEZT_ISSEL_ANY(bezt)
Object is a sort of wrapper for general info.
@ ANIMFILTER_DATA_VISIBLE
@ ACTKEYBLOCK_FLAG_ANY_HOLD
@ ACTKEYBLOCK_FLAG_MOVING_HOLD
@ ACTKEYBLOCK_FLAG_GPENCIL
@ ACTKEYBLOCK_FLAG_NON_BEZIER
@ ACTKEYBLOCK_FLAG_STATIC_HOLD
@ KEYFRAME_HANDLE_AUTO_CLAMP
@ KEYFRAME_HANDLE_ALIGNED
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
@ GPU_SHADER_KEYFRAME_DIAMOND
void GPU_program_point_size(bool enable)
void GPU_blend(eGPUBlend blend)
Read Guarded memory(de)allocation.
void UI_draw_roundbox_4fv(const struct rctf *rect, bool filled, float rad, const float col[4])
void UI_draw_roundbox_corner_set(int type)
@ TH_KEYTYPE_KEYFRAME_SELECT
@ TH_KEYTYPE_BREAKDOWN_SELECT
@ TH_KEYTYPE_EXTREME_SELECT
@ TH_KEYTYPE_MOVEHOLD_SELECT
@ TH_KEYTYPE_JITTER_SELECT
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
float UI_view2d_scale_get_x(const struct View2D *v2d)
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static CCL_NAMESPACE_BEGIN const double alpha
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
void scene_to_keylist(bDopeSheet *ads, Scene *sce, DLRBT_Tree *keys, int saction_flag)
void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos, float yscale_fac, int saction_flag)
static DLRBT_Node * nalloc_ak_masklayshape(void *data)
static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, float ypos, float yscale_fac, bool channelLocked, int saction_flag)
static void add_gpframe_to_keycolumns_list(DLRBT_Tree *keys, bGPDframe *gpf)
static void add_masklay_to_keycolumns_list(DLRBT_Tree *keys, MaskLayerShape *masklay_shape)
void agroup_to_keylist(AnimData *adt, bActionGroup *agrp, DLRBT_Tree *keys, int saction_flag)
void draw_scene_channel(View2D *v2d, bDopeSheet *ads, Scene *sce, float ypos, float yscale_fac, int saction_flag)
static DLRBT_Node * nalloc_ak_gpframe(void *data)
BLI_INLINE bool is_cfra_lt(float a, float b)
bool actkeyblock_is_valid(ActKeyColumn *ac)
static void update_keyblocks(DLRBT_Tree *keys, BezTriple *bezt, int bezt_len)
void draw_masklay_channel(View2D *v2d, bDopeSheet *ads, MaskLayer *masklay, float ypos, float yscale_fac, int saction_flag)
static short compare_ak_gpframe(void *node, void *data)
void draw_fcurve_channel(View2D *v2d, AnimData *adt, FCurve *fcu, float ypos, float yscale_fac, int saction_flag)
static void nupdate_ak_gpframe(void *node, void *data)
void cachefile_to_keylist(bDopeSheet *ads, CacheFile *cache_file, DLRBT_Tree *keys, int saction_flag)
BLI_INLINE bool is_cfra_eq(float a, float b)
void mask_to_keylist(bDopeSheet *UNUSED(ads), MaskLayer *masklay, DLRBT_Tree *keys)
short compare_ak_cfraPtr(void *node, void *data)
static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTripleChain *bezt)
static void compute_keyblock_data(ActKeyBlockInfo *info, BezTriple *prev, BezTriple *beztn)
static eKeyframeHandleDrawOpts bezt_handle_type(BezTriple *bezt)
static void add_keyblock_info(ActKeyColumn *col, const ActKeyBlockInfo *block)
static void nupdate_ak_bezt(void *node, void *data)
static const ActKeyBlockInfo dummy_keyblock
static short compare_ak_masklayshape(void *node, void *data)
void action_to_keylist(AnimData *adt, bAction *act, DLRBT_Tree *keys, int saction_flag)
static DLRBT_Node * nalloc_ak_bezt(void *data)
void summary_to_keylist(bAnimContext *ac, DLRBT_Tree *keys, int saction_flag)
static void nupdate_ak_masklayshape(void *node, void *data)
static short compare_ak_bezt(void *node, void *data)
void draw_gpl_channel(View2D *v2d, bDopeSheet *ads, bGPDlayer *gpl, float ypos, float yscale_fac, int saction_flag)
int actkeyblock_get_valid_hold(ActKeyColumn *ac)
static void add_bezt_to_keyblocks_list(DLRBT_Tree *keys, BezTriple *bezt, int bezt_len)
void draw_object_channel(View2D *v2d, bDopeSheet *ads, Object *ob, float ypos, float yscale_fac, int saction_flag)
void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, DLRBT_Tree *keys, const bool active)
struct BezTripleChain BezTripleChain
void ob_to_keylist(bDopeSheet *ads, Object *ob, DLRBT_Tree *keys, int saction_flag)
void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type, short mode, float alpha, uint pos_id, uint size_id, uint color_id, uint outline_color_id, uint flags_id, short handle_type, short extreme_type)
void draw_summary_channel(View2D *v2d, bAnimContext *ac, float ypos, float yscale_fac, int saction_flag)
void draw_agroup_channel(View2D *v2d, AnimData *adt, bActionGroup *agrp, float ypos, float yscale_fac, int saction_flag)
void draw_gpencil_channel(View2D *v2d, bDopeSheet *ads, bGPdata *gpd, float ypos, float yscale_fac, int saction_flag)
static eKeyframeExtremeDrawOpts bezt_extreme_type(BezTripleChain *chain)
void gpl_to_keylist(bDopeSheet *UNUSED(ads), bGPDlayer *gpl, DLRBT_Tree *keys)
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, DLRBT_Tree *keys, int saction_flag)
void *(* MEM_callocN)(size_t len, const char *str)
bool active
all scheduled work for the GPU.
struct ActKeyColumn * next
struct MaskLayerShape * next
struct bAnimListElem * next