Fix T42662 hide unselected does not reveal selected.
Not sure if this is a bugfix exactly but should help the gooseberry team with their workflow.
This commit is contained in:
parent
4bf40bb646
commit
0facc48308
Notes:
blender-bot
2023-02-14 09:48:22 +01:00
Referenced by issue #42662, SHIFT+H in Graph Editor doesn't reveal what is selected
|
@ -245,13 +245,38 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
|
|||
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_SELECT, ACHANNEL_SETFLAG_CLEAR);
|
||||
|
||||
/* now, also flush selection status up/down as appropriate */
|
||||
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, false);
|
||||
ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_CLEAR);
|
||||
}
|
||||
|
||||
|
||||
/* cleanup */
|
||||
ANIM_animdata_freelist(&anim_data);
|
||||
BLI_freelistN(&all_data);
|
||||
|
||||
/* unhide selected */
|
||||
if (unselected) {
|
||||
/* turn off requirement for visible */
|
||||
filter = ANIMFILTER_SEL | ANIMFILTER_NODUPLIS | ANIMFILTER_LIST_CHANNELS;
|
||||
|
||||
/* flushing has been done */
|
||||
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
|
||||
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
/* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
|
||||
/* TODO: find out why this is the case, and fix that */
|
||||
if (ale->type == ANIMTYPE_OBJECT)
|
||||
continue;
|
||||
|
||||
/* change the hide setting, and unselect it... */
|
||||
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
|
||||
ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_SELECT, ACHANNEL_SETFLAG_ADD);
|
||||
|
||||
/* now, also flush selection status up/down as appropriate */
|
||||
ANIM_flush_setting_anim_channels(&ac, &anim_data, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
|
||||
}
|
||||
ANIM_animdata_freelist(&anim_data);
|
||||
}
|
||||
|
||||
|
||||
/* send notifier that things have changed */
|
||||
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue