diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-07-10 12:28:44 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-07-18 17:44:46 +0300 |
commit | cd21022b78fe48c16ab11d04682bb92271873a9c (patch) | |
tree | 2aff59e315f5b61768892a1105726d9f0ff22c23 /release/scripts/startup/bl_ui/space_dopesheet.py | |
parent | 935b7a6f65d2c90e54b59a50fd1c488f02da0e8e (diff) |
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
Diffstat (limited to 'release/scripts/startup/bl_ui/space_dopesheet.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |