Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-03-22 12:12:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-22 12:12:08 +0300
commit14caab7257996e19b1b27186715f1a035053899a (patch)
tree372056f1ceccb64f81d8526bf92199112e6b2c92 /release
parenta05cbc9914a76fa50c8367262dff507506e26c66 (diff)
Cleanup: check the space type instead of the operators poll function
The poll function may fail for reasons other than the space type, as this menu is selected based on space-type, check this instead.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index ade6f4cbb79..84f83559da6 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -642,6 +642,9 @@ class DOPESHEET_MT_channel_context_menu(Menu):
def draw(self, context):
layout = self.layout
+ # This menu is used from the graph editor too.
+ is_graph_editor = context.area.type == 'GRAPH_EDITOR'
+
layout.operator("anim.channels_setting_enable", text="Mute Channels").type = 'MUTE'
layout.operator("anim.channels_setting_disable", text="Unmute Channels").type = 'MUTE'
layout.separator()
@@ -655,7 +658,7 @@ class DOPESHEET_MT_channel_context_menu(Menu):
layout.separator()
layout.operator("anim.channels_editable_toggle")
- if bpy.ops.graph.extrapolation_type.poll(context.copy()):
+ if is_graph_editor:
operator = "graph.extrapolation_type"
else:
operator = "action.extrapolation_type"