[Bf-blender-cvs] [86b2f8ef38c] blender2.8: UI: add render output tab to properties editor

Brecht Van Lommel noreply at git.blender.org
Fri Nov 2 01:59:31 CET 2018


Commit: 86b2f8ef38c0cbcc355f19b49b3f7a085bfda69a
Author: Brecht Van Lommel
Date:   Fri Nov 2 11:56:41 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB86b2f8ef38c0cbcc355f19b49b3f7a085bfda69a

UI: add render output tab to properties editor

===================================================================

M	intern/cycles/blender/addon/ui.py
M	release/scripts/startup/bl_ui/__init__.py
A	release/scripts/startup/bl_ui/properties_output.py
M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_buttons/space_buttons.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index d1778c7ecd3..9f7230e0a53 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -990,6 +990,7 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
 class CYCLES_PT_post_processing(CyclesButtonsPanel, Panel):
     bl_label = "Post Processing"
     bl_options = {'DEFAULT_CLOSED'}
+    bl_context = "output"
 
     def draw(self, context):
         layout = self.layout
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 093739c5b08..138b5393777 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -60,6 +60,7 @@ _modules = [
     "properties_physics_smoke",
     "properties_physics_softbody",
     "properties_render",
+    "properties_output",
     "properties_view_layer",
     "properties_scene",
     "properties_texture",
diff --git a/release/scripts/startup/bl_ui/properties_output.py b/release/scripts/startup/bl_ui/properties_output.py
new file mode 100644
index 00000000000..b85cd9de04a
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_output.py
@@ -0,0 +1,524 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import Menu, Panel, UIList
+from bl_operators.presets import PresetMenu
+
+
+class RENDER_PT_presets(PresetMenu):
+    bl_label = "Render Presets"
+    preset_subdir = "render"
+    preset_operator = "script.execute_preset"
+    preset_add_operator = "render.preset_add"
+
+
+class RENDER_PT_ffmpeg_presets(PresetMenu):
+    bl_label = "FFMPEG Presets"
+    preset_subdir = "ffmpeg"
+    preset_operator = "script.python_file_run"
+
+
+class RENDER_MT_framerate_presets(Menu):
+    bl_label = "Frame Rate Presets"
+    preset_subdir = "framerate"
+    preset_operator = "script.execute_preset"
+    draw = Menu.draw_preset
+
+
+class RenderOutputButtonsPanel:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "output"
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+    @classmethod
+    def poll(cls, context):
+        return (context.engine in cls.COMPAT_ENGINES)
+
+
+class RENDER_PT_dimensions(RenderOutputButtonsPanel, Panel):
+    bl_label = "Dimensions"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    _frame_rate_args_prev = None
+    _preset_class = None
+
+    def draw_header_preset(self, context):
+        RENDER_PT_presets.draw_panel_header(self.layout)
+
+    @staticmethod
+    def _draw_framerate_label(*args):
+        # avoids re-creating text string each draw
+        if RENDER_PT_dimensions._frame_rate_args_prev == args:
+            return RENDER_PT_dimensions._frame_rate_ret
+
+        fps, fps_base, preset_label = args
+
+        if fps_base == 1.0:
+            fps_rate = round(fps)
+        else:
+            fps_rate = round(fps / fps_base, 2)
+
+        # TODO: Change the following to iterate over existing presets
+        custom_framerate = (fps_rate not in {23.98, 24, 25, 29.97, 30, 50, 59.94, 60})
+
+        if custom_framerate is True:
+            fps_label_text = f"Custom ({fps_rate!r} fps)"
+            show_framerate = True
+        else:
+            fps_label_text = f"{fps_rate!r} fps"
+            show_framerate = (preset_label == "Custom")
+
+        RENDER_PT_dimensions._frame_rate_args_prev = args
+        RENDER_PT_dimensions._frame_rate_ret = args = (fps_label_text, show_framerate)
+        return args
+
+    @staticmethod
+    def draw_framerate(layout, sub, rd):
+        if RENDER_PT_dimensions._preset_class is None:
+            RENDER_PT_dimensions._preset_class = bpy.types.RENDER_MT_framerate_presets
+
+        args = rd.fps, rd.fps_base, RENDER_PT_dimensions._preset_class.bl_label
+        fps_label_text, show_framerate = RENDER_PT_dimensions._draw_framerate_label(*args)
+
+        sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
+
+        if show_framerate:
+            col = layout.column(align=True)
+            col.prop(rd, "fps")
+            col.prop(rd, "fps_base", text="Base")
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False  # No animation.
+
+        scene = context.scene
+        rd = scene.render
+
+        col = layout.column(align=True)
+        col.prop(rd, "resolution_x", text="Resolution X")
+        col.prop(rd, "resolution_y", text="Y")
+        col.prop(rd, "resolution_percentage", text="%")
+
+        col = layout.column(align=True)
+        col.prop(rd, "pixel_aspect_x", text="Aspect X")
+        col.prop(rd, "pixel_aspect_y", text="Y")
+
+        col = layout.column(align=True)
+        col.prop(rd, "use_border", text="Border")
+        sub = col.column(align=True)
+        sub.active = rd.use_border
+        sub.prop(rd, "use_crop_to_border", text="Crop")
+
+        col = layout.column(align=True)
+        col.prop(scene, "frame_start", text="Frame Start")
+        col.prop(scene, "frame_end", text="End")
+        col.prop(scene, "frame_step", text="Step")
+
+        col = layout.split()
+        col.alignment = 'RIGHT'
+        col.label(text="Frame Rate")
+        self.draw_framerate(layout, col, rd)
+
+
+class RENDER_PT_frame_remapping(RenderOutputButtonsPanel, Panel):
+    bl_label = "Time Remapping"
+    bl_parent_id = "RENDER_PT_dimensions"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False  # No animation.
+
+        rd = context.scene.render
+
+        col = layout.column(align=True)
+        col.prop(rd, "frame_map_old", text="Old")
+        col.prop(rd, "frame_map_new", text="New")
+
+
+class RENDER_PT_post_processing(RenderOutputButtonsPanel, Panel):
+    bl_label = "Post Processing"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        rd = context.scene.render
+
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+        col = flow.column()
+        col.prop(rd, "use_compositing")
+        col = flow.column()
+        col.prop(rd, "use_sequencer")
+
+        layout.prop(rd, "dither_intensity", text="Dither", slider=True)
+
+
+class RENDER_PT_stamp(RenderOutputButtonsPanel, Panel):
+    bl_label = "Metadata"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False  # No animation.
+
+        rd = context.scene.render
+
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_date", text="Date")
+        col = flow.column()
+        col.prop(rd, "use_stamp_time", text="Time")
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_render_time", text="Render Time")
+        col = flow.column()
+        col.prop(rd, "use_stamp_frame", text="Frame")
+        col = flow.column()
+        col.prop(rd, "use_stamp_frame_range", text="Frame Range")
+        col = flow.column()
+        col.prop(rd, "use_stamp_memory", text="Memory")
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_camera", text="Camera")
+        col = flow.column()
+        col.prop(rd, "use_stamp_lens", text="Lens")
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_scene", text="Scene")
+        col = flow.column()
+        col.prop(rd, "use_stamp_marker", text="Marker")
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_filename", text="Filename")
+
+        col = flow.column()
+        col.prop(rd, "use_stamp_sequencer_strip", text="Strip Name")
+
+        if rd.use_sequencer:
+            col = flow.column()
+            col.prop(rd, "use_stamp_strip_meta", text="Use Strip Metadata")
+
+
+class RENDER_PT_stamp_note(RenderOutputButtonsPanel, Panel):
+    bl_label = "Note"
+    bl_parent_id = "RENDER_PT_stamp"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw_header(self, context):
+        rd = context.scene.render
+
+        self.layout.prop(rd, "use_stamp_note", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        rd = context.scene.render
+
+        layout.active = rd.use_stamp_note
+        layout.prop(rd, "stamp_note_text", text="")
+
+
+class RENDER_PT_stamp_burn(RenderOutputButtonsPanel, Panel):
+    bl_label = "Burn Into Image"
+    bl_parent_id = "RENDER_PT_stamp"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw_header(self, context):
+        rd = context.scene.render
+
+        self.layout.prop(rd, "use_stamp", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        rd = context.scene.render
+
+        layout.use_pr

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list