diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 03:52:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-13 05:32:10 +0300 |
commit | 16b6b03969f4e8199597fae68eb1dd278f13c336 (patch) | |
tree | c6bbaff0bb8790ba52daba1c58a1b8340c8f465e /release/scripts/startup/bl_ui | |
parent | e24de17b8dfc8c8e06782c2d68c9781a979e4768 (diff) |
Cleanup: pass context to draw method instead of accessing from bpy
Allows for context overrides/mocking.
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_graph.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_nla.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_time.py | 5 |
5 files changed, 6 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 69a835b757a..7c3a9efa68a 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -411,7 +411,7 @@ class DOPESHEET_MT_marker(Menu): layout = self.layout from .space_time import marker_menu_generic - marker_menu_generic(layout) + marker_menu_generic(layout, context) st = context.space_data diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index b12cde67599..3c9e23d8612 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -210,7 +210,7 @@ class GRAPH_MT_marker(Menu): layout = self.layout from .space_time import marker_menu_generic - marker_menu_generic(layout) + marker_menu_generic(layout, context) # TODO: pose markers for action edit mode only? diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index b51a42a04cb..13f07c0a69c 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -146,7 +146,7 @@ class NLA_MT_marker(Menu): layout = self.layout from .space_time import marker_menu_generic - marker_menu_generic(layout) + marker_menu_generic(layout, context) class NLA_MT_edit(Menu): diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 7fcc5a07980..678050aa58a 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -277,7 +277,7 @@ class SEQUENCER_MT_marker(Menu): is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'} from .space_time import marker_menu_generic - marker_menu_generic(layout) + marker_menu_generic(layout, context) if is_sequencer_view: layout.prop(st, "use_marker_sync") diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 726081b2bf5..ffb285557a0 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -117,7 +117,7 @@ class TIME_MT_marker(Menu): def draw(self, context): layout = self.layout - marker_menu_generic(layout) + marker_menu_generic(layout, context) class TIME_MT_view(Menu): @@ -175,8 +175,7 @@ class TIME_MT_cache(Menu): col.prop(st, "cache_rigidbody") -def marker_menu_generic(layout): - from bpy import context +def marker_menu_generic(layout, context): # layout.operator_context = 'EXEC_REGION_WIN' |