From fa6be590d99f9e3cd208cb501086ed790331d228 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 16 Sep 2025 10:44:29 +0200 Subject: [PATCH] UI: Move OpenGL render operators to sub-menu Move 3D Viewport and Sequencer OpenGL render operators into a "Render Preview" sub-menu. The goal is to make the operation more clear, and being able to add new entries to render the active scene or Sequencer scene (handy when using the new "Sync Scene"). This also reduces the length of the `View` menu which in some cases can get quite long. See PR for details and screenshots. Resolves #146302 Pull Request: https://projects.blender.org/blender/blender/pulls/146316 --- scripts/startup/bl_ui/space_sequencer.py | 17 ++++++--- scripts/startup/bl_ui/space_view3d.py | 44 +++++++++++++++--------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/scripts/startup/bl_ui/space_sequencer.py b/scripts/startup/bl_ui/space_sequencer.py index db9bfbb84c9..fb16ce031c0 100644 --- a/scripts/startup/bl_ui/space_sequencer.py +++ b/scripts/startup/bl_ui/space_sequencer.py @@ -457,6 +457,17 @@ class SEQUENCER_MT_proxy(Menu): layout.prop(st, "proxy_render_size", text="") +class SEQUENCER_MT_view_render(Menu): + bl_label = "Render Preview" + + def draw(self, _context): + layout = self.layout + layout.operator("render.opengl", text="Render Sequencer Image", icon='RENDER_STILL').sequencer = True + props = layout.operator("render.opengl", text="Render Sequencer Animation", icon='RENDER_ANIMATION') + props.animation = True + props.sequencer = True + + class SEQUENCER_MT_view(Menu): bl_label = "View" @@ -536,10 +547,7 @@ class SEQUENCER_MT_view(Menu): layout.menu("SEQUENCER_MT_range") 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.menu("SEQUENCER_MT_view_render") layout.separator() layout.operator("sequencer.export_subtitles", text="Export Subtitles", icon='EXPORT') @@ -3191,6 +3199,7 @@ classes = ( SEQUENCER_HT_playback_controls, SEQUENCER_MT_editor_menus, SEQUENCER_MT_range, + SEQUENCER_MT_view_render, SEQUENCER_MT_view, SEQUENCER_MT_preview_zoom, SEQUENCER_MT_proxy, diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index 8840d0f0d5b..36124f1f356 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -1481,23 +1481,7 @@ class VIEW3D_MT_view(Menu): layout.separator() - layout.operator( - "render.opengl", - text="Viewport Render Image", - icon='RENDER_STILL', - ) - layout.operator( - "render.opengl", - text="Viewport Render Animation", - icon='RENDER_ANIMATION', - ).animation = True - props = layout.operator( - "render.opengl", - text="Viewport Render Keyframes", - ) - props.animation = True - props.render_keyed_only = True - + layout.menu("VIEW3D_MT_view_render") layout.separator() layout.menu("INFO_MT_area") @@ -1655,6 +1639,31 @@ class VIEW3D_MT_view_regions(Menu): layout.operator("view3d.clear_render_border") +class VIEW3D_MT_view_render(Menu): + bl_label = "Render Preview" + + def draw(self, _context): + layout = self.layout + layout.operator( + "render.opengl", + text="Render Viewport Image", + icon='RENDER_STILL', + ) + layout.operator( + "render.opengl", + text="Render Viewport Animation", + icon='RENDER_ANIMATION', + ).animation = True + + layout.separator() + props = layout.operator( + "render.opengl", + text="Render Viewport Keyframes", + ) + props.animation = True + props.render_keyed_only = True + + # ********** Select menus, suffix from context.mode ********** class VIEW3D_MT_select_object_more_less(Menu): @@ -9119,6 +9128,7 @@ classes = ( VIEW3D_MT_view_align_selected, VIEW3D_MT_view_viewpoint, VIEW3D_MT_view_regions, + VIEW3D_MT_view_render, VIEW3D_MT_select_object, VIEW3D_MT_select_object_more_less, VIEW3D_MT_select_pose,