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
This commit is contained in:
2019-04-14 16:34:06 +03:00
parent 00b966b83a
commit eee5a880f1
4 changed files with 32 additions and 9 deletions

View File

@@ -27,7 +27,7 @@
* \note Use #STRINGIFY() rather than defining with quotes. * \note Use #STRINGIFY() rather than defining with quotes.
*/ */
#define BLENDER_VERSION 280 #define BLENDER_VERSION 280
#define BLENDER_SUBVERSION 56 #define BLENDER_SUBVERSION 57
/** Several breakages with 280, e.g. collections vs layers. */ /** Several breakages with 280, e.g. collections vs layers. */
#define BLENDER_MINVERSION 280 #define BLENDER_MINVERSION 280
#define BLENDER_MINSUBVERSION 0 #define BLENDER_MINSUBVERSION 0

View File

@@ -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. */ /* Versioning code until next subversion bump goes here. */
} }

View File

@@ -348,6 +348,12 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
*/ */
y = (float)(-ACHANNEL_HEIGHT(ac)); 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) { for (ale = anim_data.first; ale; ale = ale->next) {
const float yminc = (float)(y - ACHANNEL_HEIGHT_HALF(ac)); const float yminc = (float)(y - ACHANNEL_HEIGHT_HALF(ac));
const float ymaxc = (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 */ /* draw 'keyframes' for each specific datatype */
switch (ale->datatype) { switch (ale->datatype) {
case ALE_ALL: 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; break;
case ALE_SCE: 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; break;
case ALE_OB: 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; break;
case ALE_ACT: 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; break;
case ALE_GROUP: 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; break;
case ALE_FCURVE: 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; break;
case ALE_GPFRAME: 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; break;
case ALE_MASKLAY: 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; break;
} }
} }

View File

@@ -95,6 +95,7 @@ static SpaceLink *action_new(const ScrArea *sa, const Scene *scene)
saction->autosnap = SACTSNAP_FRAME; saction->autosnap = SACTSNAP_FRAME;
saction->mode = SACTCONT_DOPESHEET; saction->mode = SACTCONT_DOPESHEET;
saction->mode_prev = SACTCONT_DOPESHEET; saction->mode_prev = SACTCONT_DOPESHEET;
saction->flag = SACTION_SHOW_INTERPOLATION;
saction->ads.filterflag |= ADS_FILTER_SUMMARY; saction->ads.filterflag |= ADS_FILTER_SUMMARY;