UI: Split Output Properties Dimensions panel

I remember when we originally decided on the Dimensions panel,
one of the reasons we combined time and image size properties in the same panel,
was simply because the 2.49 and previous UIs used fixed-size panels,
so we often put two categories of properties inside a panel, using two columns.

Now that we no longer do this, we could clarify and simplify some panels
by splitting them, such as the Output > Dimensions panel

{F6753690}

Reviewed By: brecht, pablovazquez

Differential Revision: https://developer.blender.org/D4440
This commit is contained in:
Aaron Carlisle
2021-09-05 21:11:40 -04:00
committed by Aaron Carlisle
parent d10ea97053
commit 4ddad5a7ee

View File

@@ -25,8 +25,8 @@ from bl_ui.utils import PresetPanel
from bpy.app.translations import pgettext_tip as tip_ from bpy.app.translations import pgettext_tip as tip_
class RENDER_PT_presets(PresetPanel, Panel): class RENDER_PT_format_presets(PresetPanel, Panel):
bl_label = "Render Presets" bl_label = "Format Presets"
preset_subdir = "render" preset_subdir = "render"
preset_operator = "script.execute_preset" preset_operator = "script.execute_preset"
preset_add_operator = "render.preset_add" preset_add_operator = "render.preset_add"
@@ -56,21 +56,21 @@ class RenderOutputButtonsPanel:
return (context.engine in cls.COMPAT_ENGINES) return (context.engine in cls.COMPAT_ENGINES)
class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel): class RENDER_PT_format(RenderOutputButtonsPanel, Panel):
bl_label = "Dimensions" bl_label = "Format"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
_frame_rate_args_prev = None _frame_rate_args_prev = None
_preset_class = None _preset_class = None
def draw_header_preset(self, _context): def draw_header_preset(self, _context):
RENDER_PT_presets.draw_panel_header(self.layout) RENDER_PT_format_presets.draw_panel_header(self.layout)
@staticmethod @staticmethod
def _draw_framerate_label(*args): def _draw_framerate_label(*args):
# avoids re-creating text string each draw # avoids re-creating text string each draw
if RENDER_PT_dimensions._frame_rate_args_prev == args: if RENDER_PT_format._frame_rate_args_prev == args:
return RENDER_PT_dimensions._frame_rate_ret return RENDER_PT_format._frame_rate_ret
fps, fps_base, preset_label = args fps, fps_base, preset_label = args
@@ -89,17 +89,17 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
fps_label_text = tip_("%.4g fps") % fps_rate fps_label_text = tip_("%.4g fps") % fps_rate
show_framerate = (preset_label == "Custom") show_framerate = (preset_label == "Custom")
RENDER_PT_dimensions._frame_rate_args_prev = args RENDER_PT_format._frame_rate_args_prev = args
RENDER_PT_dimensions._frame_rate_ret = args = (fps_label_text, show_framerate) RENDER_PT_format._frame_rate_ret = args = (fps_label_text, show_framerate)
return args return args
@staticmethod @staticmethod
def draw_framerate(layout, rd): def draw_framerate(layout, rd):
if RENDER_PT_dimensions._preset_class is None: if RENDER_PT_format._preset_class is None:
RENDER_PT_dimensions._preset_class = bpy.types.RENDER_MT_framerate_presets RENDER_PT_format._preset_class = bpy.types.RENDER_MT_framerate_presets
args = rd.fps, rd.fps_base, RENDER_PT_dimensions._preset_class.bl_label args = rd.fps, rd.fps_base, RENDER_PT_format._preset_class.bl_label
fps_label_text, show_framerate = RENDER_PT_dimensions._draw_framerate_label(*args) fps_label_text, show_framerate = RENDER_PT_format._draw_framerate_label(*args)
layout.menu("RENDER_MT_framerate_presets", text=fps_label_text) layout.menu("RENDER_MT_framerate_presets", text=fps_label_text)
@@ -113,8 +113,7 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False # No animation. layout.use_property_decorate = False # No animation.
scene = context.scene rd = context.scene.render
rd = scene.render
col = layout.column(align=True) col = layout.column(align=True)
col.prop(rd, "resolution_x", text="Resolution X") col.prop(rd, "resolution_x", text="Resolution X")
@@ -131,18 +130,30 @@ class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
sub.active = rd.use_border sub.active = rd.use_border
sub.prop(rd, "use_crop_to_border") sub.prop(rd, "use_crop_to_border")
col = layout.column(heading="Frame Rate")
self.draw_framerate(col, rd)
class RENDER_PT_frame_range(RenderOutputButtonsPanel, Panel):
bl_label = "Frame Range"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
scene = context.scene
col = layout.column(align=True) col = layout.column(align=True)
col.prop(scene, "frame_start", text="Frame Start") col.prop(scene, "frame_start", text="Frame Start")
col.prop(scene, "frame_end", text="End") col.prop(scene, "frame_end", text="End")
col.prop(scene, "frame_step", text="Step") col.prop(scene, "frame_step", text="Step")
col = layout.column(heading="Frame Rate")
self.draw_framerate(col, rd)
class RENDER_PT_time_stretching(RenderOutputButtonsPanel, Panel):
class RENDER_PT_frame_remapping(RenderOutputButtonsPanel, Panel): bl_label = "Time Stretching"
bl_label = "Time Remapping" bl_parent_id = "RENDER_PT_frame_range"
bl_parent_id = "RENDER_PT_dimensions"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@@ -481,11 +492,12 @@ class RENDER_PT_stereoscopy(RenderOutputButtonsPanel, Panel):
classes = ( classes = (
RENDER_PT_presets, RENDER_PT_format_presets,
RENDER_PT_ffmpeg_presets, RENDER_PT_ffmpeg_presets,
RENDER_MT_framerate_presets, RENDER_MT_framerate_presets,
RENDER_PT_dimensions, RENDER_PT_format,
RENDER_PT_frame_remapping, RENDER_PT_frame_range,
RENDER_PT_time_stretching,
RENDER_PT_stereoscopy, RENDER_PT_stereoscopy,
RENDER_PT_output, RENDER_PT_output,
RENDER_PT_output_views, RENDER_PT_output_views,