Beispiel #1
0
 def draw(self, context):
     VIEW3D_PT_shading_color._draw_color_type(self, context)
Beispiel #2
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")