Anim: Reorganize items in 'View' menus in animation and video editors

View menu in animation and video editors are too
different from each other and unorganized.
Same operators appear in different places in different editors.
That makes navigating them harder, because for example
you expect framing operators at the bottom because they're
at the bottom in graph editor, but they're at the top in Sequencer
and 3D Viewport. It's important that ordering of operators
match as well as possible, so that users can expect certain
operators in certain places and dont spend time searching
for buttons in messy menus.

I tried to match ordering to 3D viewport menu
as much as possible, and also to use separators right,
so that grouping of items is logical and can be shareable between editors.

This grouping also looks better and makes navigation easier,
because it splits huge pile of toggles at the top of the menus
in smaller chunks and puts operators between them,
so they're esier to separate them in one glance.

Split off from #116492

Pull Request: https://projects.blender.org/blender/blender/pulls/117162
This commit is contained in:
Nika Kutsniashvili
2024-01-23 12:11:22 +01:00
committed by Christoph Lendenfeld
parent cd756143cf
commit 5a0b50e0a6
6 changed files with 72 additions and 100 deletions

View File

@@ -1327,41 +1327,38 @@ class CLIP_MT_view(Menu):
sc = context.space_data
if sc.view == 'CLIP':
layout.prop(sc, "show_region_ui")
layout.prop(sc, "show_region_toolbar")
layout.prop(sc, "show_region_ui")
layout.prop(sc, "show_region_hud")
layout.separator()
layout.operator("clip.view_selected")
layout.operator("clip.view_all")
layout.operator("clip.view_all", text="View Fit").fit_view = True
layout.operator("clip.view_center_cursor")
layout.menu("CLIP_MT_view_zoom")
layout.separator()
layout.operator("clip.view_zoom_in")
layout.operator("clip.view_zoom_out")
layout.separator()
layout.prop(sc, "show_metadata")
layout.separator()
else:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("clip.graph_view_all")
if sc.view == 'GRAPH':
layout.operator("clip.graph_center_current_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.menu("CLIP_MT_view_zoom")
else:
if sc.view == 'GRAPH':
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("clip.graph_center_current_frame")
layout.operator("clip.graph_view_all")
layout.operator_context = 'INVOKE_DEFAULT'
layout.prop(sc, "show_seconds")
layout.prop(sc, "show_locked_time")
layout.separator()
layout.menu("INFO_MT_area")

View File

@@ -363,11 +363,14 @@ class DOPESHEET_MT_view(Menu):
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_hud")
layout.separator()
layout.operator("action.view_selected")
layout.operator("action.view_all")
layout.operator("action.view_frame")
layout.separator()
layout.prop(st.dopesheet, "use_multi_word_filter", text="Multi-Word Match Search")
layout.separator()
layout.prop(st, "use_realtime_update")
@@ -380,31 +383,24 @@ class DOPESHEET_MT_view(Menu):
layout.prop(st, "show_interpolation")
layout.prop(st, "show_extremes")
layout.prop(st, "use_auto_merge_keyframes")
layout.separator()
layout.prop(st, "show_markers")
layout.separator()
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
layout.operator("action.previewrange_set")
layout.separator()
layout.operator("action.view_all")
layout.operator("action.view_selected")
layout.operator("action.view_frame")
# Add this to show key-binding (reverse action in dope-sheet).
layout.separator()
props = layout.operator("wm.context_set_enum", text="Toggle Graph Editor", icon='GRAPH')
props.data_path = "area.type"
props.value = 'GRAPH_EDITOR'
layout.separator()
layout.menu("INFO_MT_area")

View File

@@ -150,40 +150,39 @@ class GRAPH_MT_view(Menu):
layout.prop(st, "show_region_hud")
layout.separator()
layout.operator("graph.view_selected")
layout.operator("graph.view_all")
layout.operator("graph.view_frame")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_cursor")
layout.prop(st, "show_sliders")
layout.prop(st, "use_auto_merge_keyframes")
layout.separator()
if st.mode != 'DRIVERS':
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_extrapolation")
layout.prop(st, "show_handles")
layout.prop(st, "use_only_selected_keyframe_handles")
layout.prop(st, "show_cursor")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.prop(st, "show_extrapolation")
layout.prop(st, "show_handles")
layout.prop(st, "use_only_selected_keyframe_handles")
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
layout.operator("graph.previewrange_set")
layout.separator()
layout.operator("graph.view_all")
layout.operator("graph.view_selected")
layout.operator("graph.view_frame")
# Add this to show key-binding (reverse action in dope-sheet).
layout.separator()
props = layout.operator("wm.context_set_enum", text="Toggle Dope Sheet")
props.data_path = "area.type"
props.value = 'DOPESHEET_EDITOR'
layout.separator()
layout.menu("INFO_MT_area")

View File

@@ -116,28 +116,26 @@ class NLA_MT_view(Menu):
layout.prop(st, "show_region_hud")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.prop(st, "show_strip_curves")
layout.operator("nla.view_selected")
layout.operator("nla.view_all")
layout.operator("nla.view_frame")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_strip_curves")
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_local_markers")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
layout.operator("nla.previewrange_set")
layout.separator()
layout.operator("nla.view_all")
layout.operator("nla.view_selected")
layout.operator("nla.view_frame")
layout.separator()
layout.menu("INFO_MT_area")

View File

@@ -415,22 +415,24 @@ class SEQUENCER_MT_view(Menu):
# mode, else the lookup for the shortcut will fail in
# wm_keymap_item_find_props() (see #32595).
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.prop(st, "show_region_toolbar")
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_tool_header")
layout.prop(st, "show_region_toolbar")
layout.operator_context = 'INVOKE_DEFAULT'
if is_sequencer_view:
layout.prop(st, "show_region_hud")
layout.prop(st, "show_region_channels")
layout.separator()
if st.view_type == 'SEQUENCER':
layout.prop(st, "show_backdrop", text="Preview as Backdrop")
if is_preview or st.show_backdrop:
layout.prop(st, "show_transform_preview", text="Preview During Transform")
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="Refresh All")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
@@ -438,26 +440,23 @@ class SEQUENCER_MT_view(Menu):
# See above (#32595)
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_selected", text="Frame Selected")
if is_sequencer_view:
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.view_all")
layout.operator("sequencer.view_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.operator("view2d.zoom_border", text="Zoom to Border")
layout.prop(st, "use_clamp_view")
if is_preview:
if is_sequencer_view:
layout.separator()
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.separator()
layout.operator("sequencer.view_all_preview", text="Fit Preview in Window")
if is_sequencer_view:
layout.menu("SEQUENCER_MT_preview_zoom", text="Fractional Preview Zoom")
else:
layout.operator("view2d.zoom_border", text="Zoom")
layout.operator("view2d.zoom_border", text="Zoom to Border")
layout.menu("SEQUENCER_MT_preview_zoom")
layout.prop(st, "use_zoom_to_fit")
if st.display_mode == 'WAVEFORM':
@@ -465,42 +464,34 @@ class SEQUENCER_MT_view(Menu):
layout.prop(st, "show_separate_color", text="Show Separate Color Channels")
layout.separator()
layout.menu("SEQUENCER_MT_proxy")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="Refresh All")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
if is_sequencer_view:
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.operator_context = 'INVOKE_DEFAULT'
layout.menu("SEQUENCER_MT_navigation")
layout.menu("SEQUENCER_MT_range")
layout.separator()
layout.prop(st, "show_locked_time")
layout.separator()
layout.prop(st, "show_seconds")
layout.prop(st, "show_markers")
if context.preferences.view.show_developer_ui:
layout.menu("SEQUENCER_MT_view_cache", text="Show Cache")
layout.separator()
layout.menu("SEQUENCER_MT_view_cache", text="Cache")
layout.separator()
layout.operator("render.opengl", text="Sequence Render Image", icon='RENDER_STILL').sequencer = True
props = layout.operator("render.opengl", text="Sequence Render Animation", icon='RENDER_ANIMATION')
props.animation = True
props.sequencer = True
layout.separator()
layout.operator("sequencer.export_subtitles", text="Export Subtitles", icon='EXPORT')
layout.operator("sequencer.export_subtitles", text="Export Subtitles", icon='EXPORT')
layout.separator()
# Note that the context is needed for the shortcut to display properly.
@@ -514,7 +505,6 @@ class SEQUENCER_MT_view(Menu):
props.value_1 = 'SEQUENCER'
props.value_2 = 'PREVIEW'
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.menu("INFO_MT_area")

View File

@@ -123,35 +123,27 @@ class TIME_MT_view(Menu):
scene = context.scene
st = context.space_data
layout.menu("INFO_MT_area")
layout.prop(st, "show_region_hud")
layout.separator()
# NOTE: "action" now, since timeline is in the dopesheet editor, instead of as own editor
layout.operator("action.view_frame")
layout.operator("action.view_all")
layout.separator()
layout.menu("TIME_MT_cache")
layout.separator()
layout.prop(st.dopesheet, "show_only_errors")
layout.prop(scene, "show_keys_from_selected_only")
layout.operator("action.view_frame")
layout.separator()
layout.prop(st, "show_markers")
layout.separator()
layout.prop(st, "show_locked_time")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.prop(st, "show_region_hud")
layout.prop(scene, "show_keys_from_selected_only")
layout.prop(st.dopesheet, "show_only_errors")
layout.separator()
layout.menu("TIME_MT_cache")
layout.separator()
layout.menu("INFO_MT_area")
class TIME_MT_cache(Menu):