예제 #1
0
def render_settings_panel(self, context):
    layout = self.layout
    scene = context.scene
    cscene = scene.cycles
    ccscene = scene.cycles_curves
    props = scene.eevee
    view = scene.view_settings
    cbk = scene.render.bake
    rd = scene.render

    tabs = scene.SM_Render_Settings_Props

    layout.operator("sop.sm_gos_popup", icon="MENU_PANEL")

    col = layout.column()
    row = col.row(align=True)

    row.operator("render.render", icon="RENDER_STILL")
    row.operator("render.render", text="Animation",
                 icon="RENDER_ANIMATION").animation = True

    ui_spacer(col, 2)

    col = col.column()
    col.use_property_split = True
    col.use_property_decorate = False

    if rd.has_multiple_engines:
        col.prop(rd, "engine", text="Render Engine")

    if context.engine == 'CYCLES':
        from cycles import engine
        cscene = scene.cycles

        col = layout.column()
        col.prop(cscene, "feature_set")

        col = layout.column()
        col.active = show_device_active(context)
        col.prop(cscene, "device")

        if engine.with_osl() and use_cpu(context):
            col.prop(cscene, "shading_system")
    ui_spacer(col, 2)

    if context.engine == 'CYCLES':
        layout.prop(tabs, "SM_RS_cycles_tabs", expand=True)

        if tabs.SM_RS_cycles_tabs == 'OUTPUT':
            layout.prop(tabs, "SM_RS_output_sub_tabs", expand=True)

            if tabs.SM_RS_output_sub_tabs == 'DIM':
                RENDER_PT_dimensions.draw(self, context)
                layout.label(text="Time Remapping")
                RENDER_PT_frame_remapping.draw(self, context)

            if tabs.SM_RS_output_sub_tabs == 'OUTPUT':
                RENDER_PT_output.draw(self, context)
                box = layout.box()
                col = box.column(align=True)
                col.prop(scene, 'auto_save_after_render')
                if scene.auto_save_after_render is True:
                    col = box.column(align=True)
                    col.prop(context.scene,
                             'auto_save_format',
                             text='as',
                             expand=False)
                    col.prop(context.scene, 'auto_save_blend', toggle=False)
                    col.prop(context.scene,
                             'auto_save_subfolders',
                             toggle=False)
                    col.prop(context.scene,
                             'auto_save_use_framenumber',
                             toggle=False)
            if tabs.SM_RS_output_sub_tabs == 'META':
                RENDER_PT_stamp.draw(self, context)

                box = layout.box()
                box.prop(rd, "use_stamp_note")
                if rd.use_stamp_note is True:
                    box.active = rd.use_stamp_note
                    box.prop(rd, "stamp_note_text", text="")

                box = layout.box()
                box.prop(rd, "use_stamp")
                if rd.use_stamp is True:
                    col = layout.column()
                    col.active = rd.use_stamp
                    col.prop(rd, "stamp_font_size", text="Font Size")
                    col.column().prop(rd, "stamp_foreground", slider=True)
                    col.column().prop(rd, "stamp_background", slider=True)
                    col.prop(rd, "use_stamp_labels", text="Include Labels")
            if tabs.SM_RS_output_sub_tabs == 'OTHER':
                CYCLES_PT_post_processing.draw(self, context)
                box = layout.box()
                box.prop(rd, "use_multiview", text="Stereoscopy")
                if rd.use_multiview is True:
                    RENDER_PT_stereoscopy.draw(self, context)
                    ui_spacer(layout, 1)
                    RENDER_PT_output_views.draw(self, context)

        if tabs.SM_RS_cycles_tabs == 'CM':
            RENDER_PT_color_management.draw(self, context)
            ui_spacer(layout, 1)
            layout.prop(view, "use_curve_mapping", text="Use Curves")
            if view.use_curve_mapping is True:
                RENDER_PT_color_management_curves.draw(self, context)

        # Cycles Stuff
        if tabs.SM_RS_cycles_tabs == 'BAKE':
            ui_spacer(layout, 1)
            CYCLES_RENDER_PT_bake.draw(self, context)
            CYCLES_RENDER_PT_bake_influence.draw(self, context)

            if rd.use_bake_multires is False:
                ui_spacer(layout, 1)
                box = layout.box()
                box.prop(cbk, 'use_selected_to_active')

            if cbk.use_selected_to_active is True:
                CYCLES_RENDER_PT_bake_selected_to_active.draw(self, context)

            layout.label(text="Output:")
            CYCLES_RENDER_PT_bake_output.draw(self, context)

        if tabs.SM_RS_cycles_tabs == 'SAMPLING':
            CYCLES_RENDER_PT_sampling.draw(self, context)
            ui_spacer(layout, 1)
            if cscene.progressive != 'PATH' and use_branched_path(
                    context) is True:
                layout.use_property_split = True
                layout.use_property_decorate = False

                col = layout.column(align=True)
                col.prop(cscene, "diffuse_samples", text="Diffuse")
                col.prop(cscene, "glossy_samples", text="Glossy")
                col.prop(cscene, "transmission_samples", text="Transmission")
                col.prop(cscene, "ao_samples", text="AO")

                sub = col.row(align=True)
                sub.active = use_sample_all_lights(context)
                sub.prop(cscene, "mesh_light_samples", text="Mesh Light")
                col.prop(cscene, "subsurface_samples", text="Subsurface")
                col.prop(cscene, "volume_samples", text="Volume")

            draw_samples_info(layout, context)
            CYCLES_RENDER_PT_sampling_advanced.draw(self, context)

        if tabs.SM_RS_cycles_tabs == 'PERFORMANCE':
            CYCLES_RENDER_PT_performance_threads.draw(self, context)
            CYCLES_RENDER_PT_performance_tiles.draw(self, context)
            CYCLES_RENDER_PT_performance_acceleration_structure.draw(
                self, context)
            CYCLES_RENDER_PT_performance_final_render.draw(self, context)
            CYCLES_RENDER_PT_performance_viewport.draw(self, context)

        if tabs.SM_RS_cycles_tabs == 'OTHER':
            layout.prop(tabs, "SM_RS_cycles_sub_tabs", expand=True)
            if tabs.SM_RS_cycles_sub_tabs == 'FREESTYLE':
                layout.prop(rd, "use_freestyle", text="Enable Freestyle")
                if rd.use_freestyle is True:
                    RENDER_PT_freestyle.draw(self, context)
            if tabs.SM_RS_cycles_sub_tabs == 'HAIR':
                layout.prop(ccscene, "use_curves", text="Enable Hair")
                if ccscene.use_curves is True:
                    CYCLES_RENDER_PT_hair.draw(self, context)
            if tabs.SM_RS_cycles_sub_tabs == 'SIMPLIFY':
                layout.prop(rd, "use_simplify", text="Enable Simplify")
                if rd.use_simplify is True:
                    CYCLES_RENDER_PT_simplify_viewport.draw(self, context)
                    CYCLES_RENDER_PT_simplify_render.draw(self, context)
                    CYCLES_RENDER_PT_simplify_culling.draw(self, context)
            if tabs.SM_RS_cycles_sub_tabs == 'MBLUR':
                layout.prop(rd, "use_motion_blur", text="Enable Motion Blur")
                if rd.use_motion_blur is True:
                    CYCLES_RENDER_PT_motion_blur.draw(self, context)
                    CYCLES_RENDER_PT_motion_blur_curve.draw(self, context)
            if tabs.SM_RS_cycles_sub_tabs == 'FILM':
                CYCLES_RENDER_PT_film.draw(self, context)
                CYCLES_RENDER_PT_film_pixel_filter.draw(self, context)
                box = layout.box()
                box.prop(cscene, "film_transparent", text="Transparency")
                if cscene.film_transparent is True:
                    CYCLES_RENDER_PT_film_transparency.draw(self, context)

    elif context.engine == 'BLENDER_EEVEE':
        layout.prop(tabs, "SM_RS_eevee_tabs", expand=True)
        if tabs.SM_RS_eevee_tabs == 'OUTPUT':
            layout.prop(tabs, "SM_RS_output_sub_tabs", expand=True)

            if tabs.SM_RS_output_sub_tabs == 'DIM':
                RENDER_PT_dimensions.draw(self, context)
                layout.label(text="Time Remapping")
                RENDER_PT_frame_remapping.draw(self, context)

            if tabs.SM_RS_output_sub_tabs == 'OUTPUT':
                RENDER_PT_output.draw(self, context)
                box = layout.box()
                col = box.column(align=True)
                col.prop(scene, 'auto_save_after_render')
                if scene.auto_save_after_render is True:
                    col = box.column(align=True)
                    col.prop(context.scene,
                             'auto_save_format',
                             text='as',
                             expand=False)
                    col.prop(context.scene, 'auto_save_blend', toggle=False)
                    col.prop(context.scene,
                             'auto_save_subfolders',
                             toggle=False)
                    col.prop(context.scene,
                             'auto_save_use_framenumber',
                             toggle=False)

            if tabs.SM_RS_output_sub_tabs == 'META':
                RENDER_PT_stamp.draw(self, context)

                box = layout.box()
                box.prop(rd, "use_stamp_note")
                if rd.use_stamp_note is True:
                    box.active = rd.use_stamp_note
                    box.prop(rd, "stamp_note_text", text="")

                box = layout.box()
                box.prop(rd, "use_stamp")
                if rd.use_stamp is True:
                    col = layout.column()
                    col.active = rd.use_stamp
                    col.prop(rd, "stamp_font_size", text="Font Size")
                    col.column().prop(rd, "stamp_foreground", slider=True)
                    col.column().prop(rd, "stamp_background", slider=True)
                    col.prop(rd, "use_stamp_labels", text="Include Labels")

            if tabs.SM_RS_output_sub_tabs == 'OTHER':
                CYCLES_PT_post_processing.draw(self, context)
                box = layout.box()
                box.prop(rd, "use_multiview", text="Stereoscopy")
                if rd.use_multiview is True:
                    RENDER_PT_stereoscopy.draw(self, context)
                    ui_spacer(layout, 1)
                    RENDER_PT_output_views.draw(self, context)

        if tabs.SM_RS_eevee_tabs == 'CM':
            RENDER_PT_color_management.draw(self, context)
            ui_spacer(layout, 1)
            layout.prop(view, "use_curve_mapping", text="Use Curves")
            if view.use_curve_mapping is True:
                RENDER_PT_color_management_curves.draw(self, context)

        if tabs.SM_RS_eevee_tabs == 'LIGHT':
            RENDER_PT_eevee_indirect_lighting.draw(self, context)
            RENDER_PT_eevee_indirect_lighting_display.draw(self, context)

        if tabs.SM_RS_eevee_tabs == 'OTHER':
            box = layout.box()
            box.label(text="Film")
            RENDER_PT_eevee_film.draw(self, context)
            layout.prop(props, "use_overscan")
            if props.use_overscan is True:
                RENDER_PT_eevee_film_overscan.draw(self, context)
            box = layout.box()
            box.label(text="Sampling")
            RENDER_PT_eevee_sampling.draw(self, context)
            box = layout.box()
            box.prop(rd, "use_freestyle", text="Enable Freestyle")
            if rd.use_freestyle is True:
                RENDER_PT_freestyle.draw(self, context)

            box = layout.box()
            box.prop(rd, "use_simplify", text="Enable Simplify")
            if rd.use_simplify is True:
                CYCLES_RENDER_PT_simplify_viewport.draw(self, context)
                CYCLES_RENDER_PT_simplify_render.draw(self, context)
                CYCLES_RENDER_PT_simplify_culling.draw(self, context)

        if tabs.SM_RS_eevee_tabs == 'PP':
            box = layout.box()
            box.prop(props, "use_gtao", text="Ambient Occlusion - AO")
            box.prop(props, "use_bloom", text="Bloom - Bloom")
            box.prop(props, "use_ssr", text="Screen Space Reflections - SSR")
            box.prop(props, "use_volumetric", text="Volumetric - Volumetric")
            box.prop(props, "use_motion_blur", text="Motion Blur - Other")
            box.prop(props, "use_sss", text="Subsurface Scattering - Other")
            box.prop(props, "use_dof", text="Depth of Field - Other")
            layout.label(text="Settings")
            layout.prop(tabs, 'SM_RS_eevee_sub_tabs', expand=True)
            if tabs.SM_RS_eevee_sub_tabs == 'AO':
                if props.use_gtao is True:
                    RENDER_PT_eevee_ambient_occlusion.draw(self, context)
                else:
                    layout.label(text="Please Enable: Ambient Occlusion")
            if tabs.SM_RS_eevee_sub_tabs == 'BLOOM':
                if props.use_bloom is True:
                    RENDER_PT_eevee_bloom.draw(self, context)
                else:
                    layout.label(text="Please Enable: Bloom")

            if tabs.SM_RS_eevee_sub_tabs == 'SSR':
                if props.use_ssr is True:
                    RENDER_PT_eevee_screen_space_reflections.draw(
                        self, context)
                else:
                    layout.label(
                        text="Please Enable: Screen Space Reflections")

            if tabs.SM_RS_eevee_sub_tabs == 'VOLUMETRIC':
                if props.use_volumetric is True:
                    RENDER_PT_eevee_volumetric.draw(self, context)
                    box = layout.box()
                    box.prop(props,
                             "use_volumetric_lights",
                             text="Volumetric Lighting")
                    if props.use_volumetric_lights is True:
                        box.prop(props,
                                 "volumetric_light_clamp",
                                 text="Light Clamping")
                    box = layout.box()
                    box.prop(props,
                             "use_volumetric_shadows",
                             text="Volumetric Shadows")
                    if props.use_volumetric_shadows is True:
                        box.prop(props,
                                 "volumetric_shadow_samples",
                                 text="Shadow Samples")
                else:
                    layout.label(text="Please Enable: Volumetric")

            if tabs.SM_RS_eevee_sub_tabs == 'OTHER':
                box = layout.box()
                box.active = props.use_motion_blur
                box.use_property_split = True
                box.label(text="Motion Blur")
                box.prop(props, "motion_blur_samples")
                box.prop(props, "motion_blur_shutter")
                box = layout.box()
                box.active = props.use_sss
                box.use_property_split = True
                box.label(text="Subsurface Scattering")
                box.prop(props, "sss_samples")
                box.prop(props, "sss_jitter_threshold")
                box.prop(props, "use_sss_separate_albedo")
                box = layout.box()
                box.active = props.use_dof
                box.use_property_split = True
                box.label(text="Depth of Field")
                box.prop(props, "bokeh_max_size")

    elif context.engine == 'BLENDER_WORKBENCH':
        layout.prop(tabs, "SM_RS_workbench_tabs", expand=True)
        if tabs.SM_RS_workbench_tabs == 'OUTPUT':
            layout.prop(tabs, "SM_RS_output_sub_tabs", expand=True)

            if tabs.SM_RS_output_sub_tabs == 'DIM':
                RENDER_PT_dimensions.draw(self, context)
                layout.label(text="Time Remapping")
                RENDER_PT_frame_remapping.draw(self, context)

            if tabs.SM_RS_output_sub_tabs == 'OUTPUT':
                RENDER_PT_output.draw(self, context)
                box = layout.box()
                col = box.column(align=True)
                col.prop(scene, 'auto_save_after_render')
                if scene.auto_save_after_render is True:
                    col = box.column(align=True)
                    col.prop(context.scene,
                             'auto_save_format',
                             text='as',
                             expand=False)
                    col.prop(context.scene, 'auto_save_blend', toggle=False)
                    col.prop(context.scene,
                             'auto_save_subfolders',
                             toggle=False)
                    col.prop(context.scene,
                             'auto_save_use_framenumber',
                             toggle=False)

            if tabs.SM_RS_output_sub_tabs == 'META':
                RENDER_PT_stamp.draw(self, context)

                box = layout.box()
                box.prop(rd, "use_stamp_note")
                if rd.use_stamp_note is True:
                    box.active = rd.use_stamp_note
                    box.prop(rd, "stamp_note_text", text="")

                box = layout.box()
                box.prop(rd, "use_stamp")
                if rd.use_stamp is True:
                    col = layout.column()
                    col.active = rd.use_stamp
                    col.prop(rd, "stamp_font_size", text="Font Size")
                    col.column().prop(rd, "stamp_foreground", slider=True)
                    col.column().prop(rd, "stamp_background", slider=True)
                    col.prop(rd, "use_stamp_labels", text="Include Labels")

            if tabs.SM_RS_output_sub_tabs == 'OTHER':
                CYCLES_PT_post_processing.draw(self, context)
                box = layout.box()
                box.prop(rd, "use_multiview", text="Stereoscopy")
                if rd.use_multiview is True:
                    RENDER_PT_stereoscopy.draw(self, context)
                    ui_spacer(layout, 1)
                    RENDER_PT_output_views.draw(self, context)

        if tabs.SM_RS_workbench_tabs == 'MAIN':
            VIEW3D_PT_shading_lighting.draw(self, context)
            VIEW3D_PT_shading_color.draw(self, context)
            VIEW3D_PT_shading_options.draw(self, context)
            RENDER_PT_opengl_film.draw(self, context)

        if tabs.SM_RS_workbench_tabs == 'CM':
            RENDER_PT_color_management.draw(self, context)
            ui_spacer(layout, 1)
            layout.prop(view, "use_curve_mapping", text="Use Curves")
            if view.use_curve_mapping is True:
                RENDER_PT_color_management_curves.draw(self, context)

        if tabs.SM_RS_workbench_tabs == 'SIMPLIFY':
            layout.prop(rd, "use_simplify", text="Enable Simplify")
            if rd.use_simplify is True:
                RENDER_PT_simplify_viewport.draw(self, context)
                RENDER_PT_simplify_render.draw(self, context)

    else:
        layout.label(text="Not Supported")
예제 #2
0
 def draw(self, context):
     VIEW3D_PT_shading_color._draw_color_type(self, context)
예제 #3
0
def gos_panel(self, layout, context):

    view = context.space_data
    scene = context.scene
    gos_props = scene.SM_GOS_Props

    if hasattr(scene, "gaf_props"):
        gaf_props = scene.gaf_props
        gaf = True
        tabs = gos_props.SM_GOS_gaffer_tabs
    else:
        tabs = gos_props.SM_GOS_tabs
        gaf = False

    row = layout.row(align=True)
    if hasattr(view, "overlay"):
        overlay = view.overlay
        row.prop(overlay, "show_overlays", icon='OVERLAY', text="")
        # row.popover(panel="VIEW3D_PT_overlay")

    if hasattr(view, "shading"):
        shading = view.shading
        # row.label(text="Shading:")
        if shading.type == 'WIREFRAME':
            row.prop(shading, "show_xray_wireframe", text="", icon='XRAY')
        else:
            row.prop(shading, "show_xray", text="", icon='XRAY')

        row.prop(shading, "type", text=" ", expand=True)
        # row.popover(panel="VIEW3D_PT_shading")
    row = layout.row(align=True)
    if gaf is True:
        row.prop(gos_props, "SM_GOS_gaffer_tabs", expand=True)

        if tabs == "LIGHTS":
            if context.scene.render.engine == "CYCLES":
                layout.prop(gaf_props,
                            'hdri_handler_enabled',
                            text="Enable Gaffer HDRI")
            bpy.types.GAFFER_PT_lights.draw(self, context)

        if tabs == "TOOLS":
            bpy.types.GAFFER_PT_tools.draw(self, context)
    else:
        row.prop(gos_props, "SM_GOS_tabs", expand=True)

    if tabs == "OVERLAYS":
        if view.type == "VIEW_3D":
            layout.label(text="Guides")
            VIEW3D_PT_overlay_guides.draw(self, context)
            layout.label(text="Object")
            VIEW3D_PT_overlay_object.draw(self, context)
            layout.label(text="Geometry")
            VIEW3D_PT_overlay_geometry.draw(self, context)
            layout.separator()
            layout.prop(view, "show_reconstruction", text="Motion Tacking")
            VIEW3D_PT_overlay_motion_tracking.draw(self, context)

            if context.mode == "EDIT_MESH":
                layout.label(text="Mesh:")
                VIEW3D_PT_overlay_edit_mesh.draw(self, context)
                VIEW3D_PT_overlay_edit_mesh_shading.draw(self, context)
                VIEW3D_PT_overlay_edit_mesh_measurement.draw(self, context)
                VIEW3D_PT_overlay_edit_mesh_normals.draw(self, context)
                VIEW3D_PT_overlay_edit_mesh_freestyle.draw(self, context)
            if context.mode == "EDIT_CURVE":
                layout.label(text="Curve:")
                VIEW3D_PT_overlay_edit_curve.draw(self, context)
            if context.mode in {
                    'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'
            }:
                VIEW3D_PT_overlay_texture_paint.draw_header(self, context)
                VIEW3D_PT_overlay_texture_paint.draw(self, context)
            if context.mode == "POSE":
                layout.label(text="Pose Mode")
                VIEW3D_PT_overlay_pose.draw(self, context)
            if context.mode == "SCULPT":
                layout.label(text="Sculpt")
                VIEW3D_PT_overlay_sculpt.draw(self, context)
        else:
            layout.label(text="Not in 3D View")

    if tabs == "SHADING":
        if hasattr(view, "shading"):
            shading = view.shading
            if shading.type in {'SOLID', 'MATERIAL'}:
                layout.label(text="Lighting")
                VIEW3D_PT_shading_lighting.draw(self, context)

            if shading.type in {'WIREFRAME', 'SOLID'}:
                layout.label(text="Color")
                #VIEW3D_PT_shading_color.draw(self, context)
                shading = VIEW3D_PT_shading.get_shading(context)
                if shading.type == 'WIREFRAME':
                    layout.row().prop(shading,
                                      "wireframe_color_type",
                                      expand=True)
                else:
                    VIEW3D_PT_shading_color._draw_color_type(self, context)
                    layout.separator()
                VIEW3D_PT_shading_color._draw_background_color(self, context)

            layout.label(text="Options")
            VIEW3D_PT_shading_options.draw(self, context)
        else:
            layout.label(text="Not in 3D View")