Fix T91743: Unify behavior of 'Auto Set Preview Range'

This is available in the DopeSheet, GraphEditor, and NLA Editor.

Currently:
- Dopesheet advertises to take selection into account...
-- ...but doesnt - which might be a mistake in rBe3842d1ca4dd
- Graph Editor does not mention selection...
-- ...and also does not take it into account
- NLA does not mention selection...
-- ...but takes it into account

Now:
- make them **all** take selection into account (you can still do a
quick 'Select All' prior to get the full range -- better than not being
able to set this based on selection)
- mention this for all in the tooltip
- also reword to 'Set Preview Range to Selected' since using the term
'Auto' impilies this would change on selection change.

Maniphest Tasks: T91743

Differential Revision: https://developer.blender.org/D12651
This commit is contained in:
Philipp Oeser 2021-09-27 17:52:59 +02:00
parent 2341ca990c
commit 47caeb8c26
Notes: blender-bot 2023-02-14 00:57:33 +01:00
Referenced by issue #91743, "Auto-set Preview Range" don't work
3 changed files with 7 additions and 7 deletions

View File

@ -276,7 +276,7 @@ static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
scene = ac.scene;
/* set the range directly */
get_keyframe_extents(&ac, &min, &max, false);
get_keyframe_extents(&ac, &min, &max, true);
scene->r.flag |= SCER_PRV_RANGE;
scene->r.psfra = floorf(min);
scene->r.pefra = ceilf(max);
@ -295,7 +295,7 @@ static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_previewrange_set(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Auto-Set Preview Range";
ot->name = "Set Preview Range to Selected";
ot->idname = "ACTION_OT_previewrange_set";
ot->description = "Set Preview Range based on extents of selected Keyframes";

View File

@ -213,7 +213,7 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
scene = ac.scene;
/* Set the range directly. */
get_graph_keyframe_extents(&ac, &min, &max, NULL, NULL, false, false);
get_graph_keyframe_extents(&ac, &min, &max, NULL, NULL, true, false);
scene->r.flag |= SCER_PRV_RANGE;
scene->r.psfra = round_fl_to_int(min);
scene->r.pefra = round_fl_to_int(max);
@ -228,9 +228,9 @@ static int graphkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void GRAPH_OT_previewrange_set(wmOperatorType *ot)
{
/* Identifiers */
ot->name = "Auto-Set Preview Range";
ot->name = "Set Preview Range to Selected";
ot->idname = "GRAPH_OT_previewrange_set";
ot->description = "Automatically set Preview Range based on range of keyframes";
ot->description = "Set Preview Range based on range of selected keyframes";
/* API callbacks */
ot->exec = graphkeys_previewrange_exec;

View File

@ -402,9 +402,9 @@ static int nlaedit_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
void NLA_OT_previewrange_set(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Auto-Set Preview Range";
ot->name = "Set Preview Range to Selected";
ot->idname = "NLA_OT_previewrange_set";
ot->description = "Automatically set Preview Range based on range of keyframes";
ot->description = "Set Preview Range based on extends of selected strips";
/* api callbacks */
ot->exec = nlaedit_previewrange_exec;