From eee5a880f186fe9e49bd41a9dc7d6d0bdd371c36 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 14 Apr 2019 16:34:06 +0300 Subject: Dopesheet: enable Show Keyframes and Interpolation by default. Make the option enabled by default, and enable it in old files, unless Show Extremes is enabled. However, suppress it for the Timeline, because its View menu doesn't include the option. Reviewers: billreynish, brecht Differential Revision: https://developer.blender.org/D4678 --- source/blender/blenkernel/BKE_blender_version.h | 2 +- source/blender/blenloader/intern/versioning_280.c | 16 ++++++++++++++++ source/blender/editors/space_action/action_draw.c | 22 ++++++++++++++-------- source/blender/editors/space_action/space_action.c | 1 + 4 files changed, 32 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 7af65e2b874..7d9fa2d428f 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -27,7 +27,7 @@ * \note Use #STRINGIFY() rather than defining with quotes. */ #define BLENDER_VERSION 280 -#define BLENDER_SUBVERSION 56 +#define BLENDER_SUBVERSION 57 /** Several breakages with 280, e.g. collections vs layers. */ #define BLENDER_MINVERSION 280 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 952c3646e2e..ce2345b44db 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -3096,6 +3096,22 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 280, 57)) { + /* Enable Show Interpolation in dopesheet by default. */ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)sl; + if ((saction->flag & SACTION_SHOW_EXTREMES) == 0) { + saction->flag |= SACTION_SHOW_INTERPOLATION; + } + } + } + } + } + } + { /* Versioning code until next subversion bump goes here. */ } diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 8cfb77e58d7..5cda7285b02 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -348,6 +348,12 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) */ y = (float)(-ACHANNEL_HEIGHT(ac)); + int action_flag = saction->flag; + + if (saction->mode == SACTCONT_TIMELINE) { + action_flag &= ~(SACTION_SHOW_INTERPOLATION | SACTION_SHOW_EXTREMES); + } + for (ale = anim_data.first; ale; ale = ale->next) { const float yminc = (float)(y - ACHANNEL_HEIGHT_HALF(ac)); const float ymaxc = (float)(y + ACHANNEL_HEIGHT_HALF(ac)); @@ -363,28 +369,28 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* draw 'keyframes' for each specific datatype */ switch (ale->datatype) { case ALE_ALL: - draw_summary_channel(v2d, ale->data, y, ac->yscale_fac, saction->flag); + draw_summary_channel(v2d, ale->data, y, ac->yscale_fac, action_flag); break; case ALE_SCE: - draw_scene_channel(v2d, ads, ale->key_data, y, ac->yscale_fac, saction->flag); + draw_scene_channel(v2d, ads, ale->key_data, y, ac->yscale_fac, action_flag); break; case ALE_OB: - draw_object_channel(v2d, ads, ale->key_data, y, ac->yscale_fac, saction->flag); + draw_object_channel(v2d, ads, ale->key_data, y, ac->yscale_fac, action_flag); break; case ALE_ACT: - draw_action_channel(v2d, adt, ale->key_data, y, ac->yscale_fac, saction->flag); + draw_action_channel(v2d, adt, ale->key_data, y, ac->yscale_fac, action_flag); break; case ALE_GROUP: - draw_agroup_channel(v2d, adt, ale->data, y, ac->yscale_fac, saction->flag); + draw_agroup_channel(v2d, adt, ale->data, y, ac->yscale_fac, action_flag); break; case ALE_FCURVE: - draw_fcurve_channel(v2d, adt, ale->key_data, y, ac->yscale_fac, saction->flag); + draw_fcurve_channel(v2d, adt, ale->key_data, y, ac->yscale_fac, action_flag); break; case ALE_GPFRAME: - draw_gpl_channel(v2d, ads, ale->data, y, ac->yscale_fac, saction->flag); + draw_gpl_channel(v2d, ads, ale->data, y, ac->yscale_fac, action_flag); break; case ALE_MASKLAY: - draw_masklay_channel(v2d, ads, ale->data, y, ac->yscale_fac, saction->flag); + draw_masklay_channel(v2d, ads, ale->data, y, ac->yscale_fac, action_flag); break; } } diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 3dffa6afb55..f2550550bc1 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -95,6 +95,7 @@ static SpaceLink *action_new(const ScrArea *sa, const Scene *scene) saction->autosnap = SACTSNAP_FRAME; saction->mode = SACTCONT_DOPESHEET; saction->mode_prev = SACTCONT_DOPESHEET; + saction->flag = SACTION_SHOW_INTERPOLATION; saction->ads.filterflag |= ADS_FILTER_SUMMARY; -- cgit v1.2.3