From cd21022b78fe48c16ab11d04682bb92271873a9c Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 10 Jul 2022 12:28:44 +0300 Subject: Context: implement an active_action property that returns a single action. Although e.g. in the dopesheet there is no specific concept of active action, displaying panels requires singling out one action reference. It is more efficient and clearer to implement this natively in the context rather than using selected_visible_actions[0]. - In the Action Editor the action is taken from the header. - In the Dope Sheet the first selected action is chosen, because there is no concept of an active channel or keyframe. - In the Graph Editor the action associated with the active curve is used, which should also be associated with the active vertex. This case may be different from selected_visible_actions[0]. Differential Revision: https://developer.blender.org/D15412 --- release/scripts/startup/bl_ui/space_dopesheet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index a1c086db745..4d1514c2777 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -567,10 +567,10 @@ class DOPESHEET_PT_action(DopesheetActionPanelBase, Panel): @classmethod def poll(cls, context): - return bool(context.selected_visible_actions) + return bool(context.active_action) def draw(self, context): - action = context.selected_visible_actions[0] + action = context.active_action self.draw_generic_panel(context, self.layout, action) -- cgit v1.2.3