From 47caeb8c26686e24ea7e694f94fabee44f3d2dca Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 27 Sep 2021 17:52:59 +0200 Subject: 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 --- source/blender/editors/space_action/action_edit.c | 4 ++-- source/blender/editors/space_graph/graph_view.c | 6 +++--- source/blender/editors/space_nla/nla_edit.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 3e38be243c9..f68446b1cae 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -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"; diff --git a/source/blender/editors/space_graph/graph_view.c b/source/blender/editors/space_graph/graph_view.c index c38c5f09a2a..56649c50cfd 100644 --- a/source/blender/editors/space_graph/graph_view.c +++ b/source/blender/editors/space_graph/graph_view.c @@ -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; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index c75b874833a..62f8906d136 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -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; -- cgit v1.2.3