Fix T55525: "Only Keyframes from Selected Channels" option in Timeline was being ignored

I was originally going to just expose the filtering options fo the timeline
too (via popover), to provide full access to the filtering options here too.
However, investigating further, that would've caused problems when trying to
use the Next/Prev Keyframe operators in other editors (see comment in code).
For now, the simpler solution is to just sync the scene-level flag (used for
this option) back to the dopesheet settings (used for generating the summary
channel used for displaying keyframes), to buy some time to investigate more
carefully.
This commit is contained in:
Joshua Leung 2018-06-22 01:25:48 +12:00
parent 526392ab16
commit 4904eadc0f
Notes: blender-bot 2023-02-14 10:18:56 +01:00
Referenced by issue #76778, Dopesheet "Show Only Errors" filter affects the timeline but cannot be changed there
Referenced by issue #55525, don't be able to filter selected in the timeline
1 changed files with 12 additions and 0 deletions

View File

@ -245,6 +245,18 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction)
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
saction->ads.source = (ID *)ac->scene;
/* sync scene's "selected keys only" flag with our "only selected" flag
* XXX: This is a workaround for T55525. We shouldn't really be syncing the flags like this,
* but it's a simpler fix for now than also figuring out how the next/prev keyframe tools
* should work in the 3D View if we allowed full access to the timeline's dopesheet filters
* (i.e. we'd have to figure out where to host those settings, to be on a scene level like
* this flag currently is, along with several other unknowns)
*/
if (ac->scene->flag & SCE_KEYS_NO_SELONLY)
saction->ads.filterflag &= ~ADS_FILTER_ONLYSEL;
else
saction->ads.filterflag |= ADS_FILTER_ONLYSEL;
ac->datatype = ANIMCONT_TIMELINE;
ac->data = &saction->ads;