Skip to content
Snippets Groups Projects
space_view3d_toolshelf_menu.py 126 KiB
Newer Older
# ##### 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 #####
# some parts based on 3d_cursor_menu.py by Jonathan Smith (JayDez) & work by sim88 & sam.
# view3d_advanced_dynamic_toolshelf_menu by Brendon Murphy (meta-androcto)

bl_info = {
    "name": "Dynamic Toolshelf Menu",
    "author": "meta-androcto",
    "version": (3, 0, 2),
    "blender": (2, 77, 0),
    "location": "View3D > Spacebar Key, Dynamic Tab",
    "description": "Context Sensitive Toolshelf Menu",
    "warning": "",
    "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6/Py/"
                "Scripts/3D_interaction/Dynamic_Spacebar_Menu",
    "tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
from bpy.types import (
        Menu,
        Operator,
        Panel,
        AddonPreferences,
        )

from bl_ui.properties_paint_common import UnifiedPaintPanel

class View3DPanel():
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'


class VIEW3D_PT_Toolshelf_menu(View3DPanel, Panel):
    bl_label = "Dynamic Toolshelf"
    bl_category = "Dynamic"

    def draw(self, context):
        layout = self.layout
        settings = context.tool_settings
        layout.operator_context = 'INVOKE_REGION_WIN'
# No Object Selected #
        if not context.active_object:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_View_Directions2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_View_Navigation2", icon='PIVOT_BOUNDBOX')
            layout.menu("VIEW3D_MT_View_Toggle2", icon='WORKSPACE')
            layout.operator("view3d.snap_cursor_to_center",
                            text="Cursor to Center")
            layout.operator("view3d.snap_cursor_to_grid",
                            text="Cursor to Grid")
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
            if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
                layout.menu("VIEW3D_MT_Edit_Gpencil2", icon='GREASEPENCIL')
# Mesh Object Mode #
        if obj and obj.type == 'MESH' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
                layout.menu("VIEW3D_MT_Edit_Gpencil2", icon='GREASEPENCIL')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')


# Mesh Edit Mode #
        if obj and obj.type == 'MESH' and obj.mode in {'EDIT'}:
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Edit_Mesh2", icon='RESTRICT_SELECT_OFF')
            layout.menu("VIEW3D_MT_Edit_Multi2", icon='VERTEXSEL')
            layout.menu("VIEW3D_MT_mesh_add", text="Add Mesh", icon='OUTLINER_OB_MESH')
            layout.menu("VIEW3D_MT_Edit_Mesh2", text="Mesh", icon='MESH_DATA')
            layout.menu("VIEW3D_MT_TransformMenuEdit2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_EditCursorMenu2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_UV_Map2", icon='MOD_UVPROJECT')
            layout.menu("VIEW3D_MT_edit_mesh_specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_edit_mesh_extrude", icon='XRAY')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_edit_mesh_delete", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Sculpt Mode #
        if obj and obj.type == 'MESH' and obj.mode in {'SCULPT'}:
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Sculpts2", icon='SCULPTMODE_HLT')
            layout.menu("VIEW3D_MT_Brush_Selection2", text="Sculpt Tool", icon='BRUSH_SCULPT_DRAW')
            layout.menu("VIEW3D_MT_Brush_Settings2", icon='BRUSH_DATA')
            layout.menu("VIEW3D_MT_Hide_Masks2", icon='RESTRICT_VIEW_OFF')
            layout.menu("VIEW3D_MT_Sculpt_Specials2", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Vertex Paint #
        if obj and obj.type == 'MESH' and obj.mode in {'VERTEX_PAINT'}:
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Brush_Settings2", icon='BRUSH_DATA')
            layout.menu("VIEW3D_MT_Brush_Selection2", text="Vertex Paint Tool", icon='BRUSH_VERTEXDRAW')
            layout.menu("VIEW3D_MT_Vertex_Colors2", icon='GROUP_VCOL')
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Weight Paint Menu #
        if obj and obj.type == 'MESH' and obj.mode in {'WEIGHT_PAINT'}:
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Paint_Weights2", icon='WPAINT_HLT')
            layout.menu("VIEW3D_MT_Brush_Settings2", icon='BRUSH_DATA')
            layout.menu("VIEW3D_MT_Brush_Selection2", text="Weight Paint Tool", icon='BRUSH_TEXMASK')
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Texture Paint #
        if obj and obj.type == 'MESH' and obj.mode in {'TEXTURE_PAINT'}:
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Brush_Settings2", icon='BRUSH_DATA')
            layout.menu("VIEW3D_MT_Brush_Selection2", text="Texture Paint Tool", icon='SCULPTMODE_HLT')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='EDIT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Curve Object Mode #
        if obj and obj.type == 'CURVE' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Edit Curve #
        if obj and obj.type == 'CURVE' and obj.mode in {'EDIT'}:

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Edit_Curve2",
                        icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_curve_add", text="Add Curve",
            layout.menu("VIEW3D_MT_Edit_Curve2", icon='CURVE_DATA')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_EditCurveCtrlpoints2",
            layout.menu("VIEW3D_MT_EditCurveSpecials2",
                        icon='SOLO_OFF')
            UseSeparator(self, context)
            layout.operator("curve.delete", text="Delete Object",
                            icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Surface Object Mode #
        if obj and obj.type == 'SURFACE' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Edit Surface #
        if obj and obj.type == 'SURFACE' and obj.mode in {'EDIT'}:

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Edit_Surface2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_surface_add", text="Add Surface",
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.prop_menu_enum(settings, "proportional_edit",
                                  icon="PROP_CON")
            layout.prop_menu_enum(settings, "proportional_edit_falloff",
                                  icon="SMOOTHCURVE")
            layout.menu("VIEW3D_MT_EditCurveSpecials2",
                        icon='SOLO_OFF')
            UseSeparator(self, context)
            layout.operator("curve.delete", text="Delete Object",
                            icon='CANCEL')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Metaball Object Mode #
        if obj and obj.type == 'META' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Edit Metaball #
        if obj and obj.type == 'META' and obj.mode in {'EDIT'}:

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_SelectMetaball2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.metaball_add", "type",
                                      text="Add Metaball",
                                      icon='OUTLINER_OB_META')
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.prop_menu_enum(settings, "proportional_edit",
                                  icon="PROP_CON")
            layout.prop_menu_enum(settings, "proportional_edit_falloff",
                                  icon="SMOOTHCURVE")
            UseSeparator(self, context)
            layout.operator("mball.delete_metaelems", text="Delete Object",
                            icon='CANCEL')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Text Object Mode #
        if obj and obj.type == 'FONT' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            # New Entry For Switching to Editmode
            layout.operator("view3d.interactive_mode_text2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Text Edit Mode #
        # To Do: Space is already reserved for the typing tool
        if obj and obj.type == 'FONT' and obj.mode in {'EDIT'}:

            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_select_edit_text", icon='VIEW3D')
            layout.menu("VIEW3D_MT_edit_font", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.operator("object.editmode_toggle", text="Enter Object Mode",
                            icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Camera Object Mode #
        if obj and obj.type == 'CAMERA' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Lamp Object Mode #
        if obj and obj.type == 'LAMP' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenuLite2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Armature Object Mode #
        if obj and obj.type == 'ARMATURE' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenuArmature2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Armature2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Armature Edit #
        if obj and obj.type == 'ARMATURE' and obj.mode in {'EDIT'}:

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Edit_Armature2",
                        icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_armature_add", text="Add Armature",
                        icon='OUTLINER_OB_ARMATURE')
            layout.menu("VIEW3D_MT_Edit_Armature2", text="Armature",
                        icon='OUTLINER_DATA_ARMATURE')
            layout.menu("VIEW3D_MT_EditArmatureTK2",
                        icon='ARMATURE_DATA')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenuArmatureEdit2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_armature_specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_edit_armature_roll",
                        icon='BONE_DATA')
            UseSeparator(self, context)
            layout.operator("armature.delete", text="Delete Object",
                            icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Armature2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Armature Pose #
        if obj and obj.type == 'ARMATURE' and obj.mode in {'POSE'}:
            arm = context.active_object.data
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Pose2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_Pose2", icon='OUTLINER_DATA_POSE')
            layout.menu("VIEW3D_MT_TransformMenuArmaturePose2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_pose_transform", icon='EMPTY_DATA')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            layout.menu("VIEW3D_MT_PoseCopy2", icon='FILE')
            if arm.display_type in {'BBONE', 'ENVELOPE'}:
                layout.operator("transform.transform",
                                text="Scale Envelope Distance").mode = 'BONE_SIZE'
            layout.menu("VIEW3D_MT_pose_apply", icon='AUTO')
            layout.operator("pose.relax", icon='ARMATURE_DATA')
            layout.menu("VIEW3D_MT_KeyframeMenu2", icon='KEY_HLT')
            layout.menu("VIEW3D_MT_pose_specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_pose_group", icon='GROUP_BONE')
            UseSeparator(self, context)
            layout.operator_menu_enum("pose.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT_BONE')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Armature2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Lattice Object Mode #
        if obj and obj.type == 'LATTICE' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.modifier_add", "type", icon='MODIFIER')
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Edit Lattice #
        if obj and obj.type == 'LATTICE' and obj.mode in {'EDIT'}:

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Edit_Lattice2",
                        icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenu2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.prop_menu_enum(settings, "proportional_edit",
                                  icon="PROP_CON")
            layout.prop_menu_enum(settings, "proportional_edit_falloff",
                                  icon="SMOOTHCURVE")
            UseSeparator(self, context)
            layout.operator("lattice.make_regular")
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Other2", icon='OBJECT_DATA')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Empty Object Mode #
        if obj and obj.type == 'EMPTY' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenuLite2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_object_specials", text="Specials", icon='SOLO_OFF')
            layout.menu("VIEW3D_MT_Camera_Options2", icon='OUTLINER_OB_CAMERA')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# Speaker Object Mode #
        if obj and obj.type == 'SPEAKER' and obj.mode in {'OBJECT'}:
            layout.operator_context = 'INVOKE_REGION_WIN'
            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Object2", icon='RESTRICT_SELECT_OFF')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_AddMenu2", icon='OBJECT_DATAMODE')
            layout.menu("VIEW3D_MT_Object2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenuLite2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_ParentMenu2", icon='PIVOT_ACTIVE')
            layout.menu("VIEW3D_MT_GroupMenu2", icon='GROUP')
            UseSeparator(self, context)
            layout.operator_menu_enum("object.constraint_add", "type", text="Add Constraint", icon='CONSTRAINT')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')

# Particle Menu #
        if obj and context.mode == 'PARTICLE':

            layout.operator("wm.search_menu", text="Search", icon='VIEWZOOM')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_View_Menu2", icon='ZOOM_ALL')
            layout.menu("VIEW3D_MT_Select_Particle2",
                        icon='RESTRICT_SELECT_OFF')
            layout.menu("VIEW3D_MT_Selection_Mode_Particle2",
                        text="Select and Display Mode", icon='PARTICLE_PATH')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_TransformMenu2", icon='MANIPUL')
            layout.menu("VIEW3D_MT_MirrorMenu2", icon='MOD_MIRROR')
            layout.menu("VIEW3D_MT_CursorMenuLite2", icon='PIVOT_CURSOR')
            UseSeparator(self, context)
            layout.prop_menu_enum(settings, "proportional_edit",
                                  icon="PROP_CON")
            layout.prop_menu_enum(settings, "proportional_edit_falloff",
                                  icon="SMOOTHCURVE")
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_particle", icon='PARTICLEMODE')
            layout.menu("VIEW3D_MT_particle_specials", text="Hair Specials", icon='HAIR')
            UseSeparator(self, context)
            layout.operator("object.delete", text="Delete Object", icon='X')
            UseSeparator(self, context)
            layout.menu("VIEW3D_MT_UndoS2", icon='ARROW_LEFTRIGHT')
            layout.menu("VIEW3D_MT_Object_Interactive_Mode2", icon='VIEW3D')
            UseSeparator(self, context)
            layout.operator("view3d.toolshelf", icon='MENU_PANEL')
            layout.operator("view3d.properties", icon='MENU_PANEL')
# ********** Object Menu **********
class VIEW3D_MT_Object2(Menu):
    bl_context = "objectmode"
    bl_label = "Object"
    def draw(self, context):
        layout = self.layout
        view = context.space_data
        is_local_view = (view.local_view is not None)
        layout.operator("object.delete", text="Delete...").use_global = False
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_object_parent")
        layout.menu("VIEW3D_MT_Duplicate2")
        layout.operator("object.join")
        if is_local_view:
            layout.operator_context = 'EXEC_REGION_WIN'
            layout.operator("object.move_to_layer", text="Move out of Local View")
            layout.operator_context = 'INVOKE_REGION_WIN'
        else:
            layout.operator("object.move_to_layer", text="Move to Layer...")

        layout.menu("VIEW3D_MT_make_links", text="Make Links...")
        layout.menu("VIEW3D_MT_Object_Data_Link2")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_AutoSmooth2", icon='ALIASED')
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_object_constraints")
        layout.menu("VIEW3D_MT_object_track")
        layout.menu("VIEW3D_MT_object_animation")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_object_game")
        layout.menu("VIEW3D_MT_object_showhide")
        UseSeparator(self, context)
        layout.operator_menu_enum("object.convert", "target")


# ********** Object Add **********
class VIEW3D_MT_AddMenu2(Menu):
    bl_label = "Add Object"
    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.menu("VIEW3D_MT_mesh_add", text="Add Mesh",
        layout.menu("VIEW3D_MT_curve_add", text="Add Curve",
        layout.menu("VIEW3D_MT_surface_add", text="Add Surface",
                    icon='OUTLINER_OB_SURFACE')
        layout.operator_menu_enum("object.metaball_add", "type",
                                  icon='OUTLINER_OB_META')
        layout.operator("object.text_add", text="Add Text",
                        icon='OUTLINER_OB_FONT')
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_armature_add", text="Add Armature",
                    icon='OUTLINER_OB_ARMATURE')
        layout.operator("object.add", text="Lattice",
                        icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
        layout.operator_menu_enum("object.empty_add", "type", text="Empty", icon='OUTLINER_OB_EMPTY')
        UseSeparator(self, context)
        layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
        UseSeparator(self, context)
        layout.operator("object.camera_add", text="Camera",
                        icon='OUTLINER_OB_CAMERA')
        layout.operator_menu_enum("object.lamp_add", "type",
                                  icon="OUTLINER_OB_LAMP")
        UseSeparator(self, context)
        layout.operator_menu_enum("object.effector_add", "type",
                                  text="Force Field",
                                  icon='FORCE_FORCE')
        layout.menu("VIEW3D_MT_object_quick_effects", text="Quick Effects", icon='PARTICLES')
        UseSeparator(self, context)
        layout.operator_menu_enum("object.group_instance_add", "group",
                                  text="Group Instance",
                                  icon='GROUP_VERTEX')
# ********** Object Manipulator **********
class VIEW3D_MT_ManipulatorMenu12(Menu):
    bl_label = "Manipulator"
    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        props = layout.operator("view3d.enable_manipulator", text='Translate', icon='MAN_TRANS')
        props.translate = True
        props = layout.operator("view3d.enable_manipulator", text='Rotate', icon='MAN_ROT')
        props.rotate = True
        props = layout.operator("view3d.enable_manipulator", text='Scale', icon='MAN_SCALE')
        props.scale = True
        UseSeparator(self, context)
        props = layout.operator("view3d.enable_manipulator", text='Combo', icon='MAN_SCALE')
        props.scale = True
        props.rotate = True
        props.translate = True
        props = layout.operator("view3d.enable_manipulator", text='Hide', icon='MAN_SCALE')
        props.scale = False
        props.rotate = False
        props.translate = False


# ********** Object Mirror **********
class VIEW3D_MT_MirrorMenu2(Menu):
    bl_label = "Mirror"
    def draw(self, context):
        layout = self.layout
        layout.operator("transform.mirror", text="Interactive Mirror")
        UseSeparator(self, context)
        layout.operator_context = 'INVOKE_REGION_WIN'
        props = layout.operator("transform.mirror", text="X Global")
        props.constraint_axis = (True, False, False)
        props.constraint_orientation = 'GLOBAL'
        props = layout.operator("transform.mirror", text="Y Global")
        props.constraint_axis = (False, True, False)
        props.constraint_orientation = 'GLOBAL'
        props = layout.operator("transform.mirror", text="Z Global")
        props.constraint_axis = (False, False, True)
        props.constraint_orientation = 'GLOBAL'
            UseSeparator(self, context)
            props = layout.operator("transform.mirror", text="X Local")
            props.constraint_axis = (True, False, False)
            props.constraint_orientation = 'LOCAL'
            props = layout.operator("transform.mirror", text="Y Local")
            props.constraint_axis = (False, True, False)
            props.constraint_orientation = 'LOCAL'
            props = layout.operator("transform.mirror", text="Z Local")
            props.constraint_axis = (False, False, True)
            props.constraint_orientation = 'LOCAL'
            UseSeparator(self, context)
            layout.operator("object.vertex_group_mirror")
# ********** Object Snap Cursor **********
class VIEW3D_MT_Pivot2(Menu):
    bl_label = "Pivot"
    def draw(self, context):
        layout = self.layout
        layout.prop(context.space_data, "pivot_point", expand=True)
        if context.active_object.mode == 'OBJECT':
            UseSeparator(self, context)
            layout.prop(context.space_data, "use_pivot_point_align", text="Center Points")
class VIEW3D_Snap_Context2(Menu):
    bl_label = "Snapping"
    def draw(self, context):
        layout = self.layout
        toolsettings = context.tool_settings
        layout.prop(toolsettings, "snap_element", expand=True)
        layout.prop(toolsettings, "use_snap")
class VIEW3D_Snap_Origin2(Menu):
    bl_label = "Snap  "
    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'EXEC_AREA'
        layout.operator("object.origin_set",
                        text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
        UseSeparator(self, context)
        layout.operator("object.origin_set",
                        text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
        layout.operator("object.origin_set",
                        text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
        layout.operator("object.origin_set",
                        text="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
class VIEW3D_MT_CursorMenu2(Menu):
    bl_label = "Snap Cursor"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.menu("VIEW3D_Snap_Origin2")
        layout.menu("VIEW3D_Snap_Context2")
        UseSeparator(self, context)
        layout.operator("view3d.snap_cursor_to_selected",
                        text="Cursor to Selected")
        layout.operator("view3d.snap_cursor_to_center",
                        text="Cursor to Center")
        layout.operator("view3d.snap_cursor_to_grid",
                        text="Cursor to Grid")
        layout.operator("view3d.snap_cursor_to_active",
                        text="Cursor to Active")
        UseSeparator(self, context)
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor").use_offset = False
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor (Keep Offset)").use_offset = True
        layout.operator("view3d.snap_selected_to_grid",
                        text="Selection to Grid")
        layout.operator("view3d.snap_cursor_selected_to_center2",
                        text="Selection and Cursor to Center")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_Pivot2")
        layout.operator("view3d.pivot_cursor2",
                        text="Set Cursor as Pivot Point")
        layout.operator("view3d.revert_pivot2",
                        text="Revert Pivot Point")


class VIEW3D_MT_CursorMenuLite2(Menu):
    bl_label = "Snap Cursor"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.menu("VIEW3D_Snap_Origin2")
        UseSeparator(self, context)
        layout.operator("view3d.snap_cursor_to_selected",
                        text="Cursor to Selected")
        layout.operator("view3d.snap_cursor_to_center",
                        text="Cursor to Center")
        layout.operator("view3d.snap_cursor_to_grid",
                        text="Cursor to Grid")
        layout.operator("view3d.snap_cursor_to_active",
                        text="Cursor to Active")
        UseSeparator(self, context)
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor").use_offset = False
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor (Keep Offset)").use_offset = True
        layout.operator("view3d.snap_selected_to_grid",
                        text="Selection to Grid")
        layout.operator("view3d.snap_cursor_selected_to_center2",
                        text="Selection and Cursor to Center")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_Pivot2")
        layout.operator("view3d.pivot_cursor2",
                        text="Set Cursor as Pivot Point")
        layout.operator("view3d.revert_pivot2",
                        text="Revert Pivot Point")


# ********** Object Interactive Mode **********
class InteractiveMode2(Menu):
    bl_idname = "VIEW3D_MT_Object_Interactive_Mode2"
    bl_label = "Interactive Mode"
    bl_description = "Menu of objects interactive modes (Window Types)"

    def draw(self, context):
        layout = self.layout

        layout.operator(SetObjectMode2.bl_idname, text="Object", icon="OBJECT_DATAMODE").mode = "OBJECT"
        layout.operator(SetObjectMode2.bl_idname, text="Edit", icon="EDITMODE_HLT").mode = "EDIT"
        layout.operator(SetObjectMode2.bl_idname, text="Sculpt", icon="SCULPTMODE_HLT").mode = "SCULPT"
        layout.operator(SetObjectMode2.bl_idname, text="Vertex Paint", icon="VPAINT_HLT").mode = "VERTEX_PAINT"
        layout.operator(SetObjectMode2.bl_idname, text="Weight Paint", icon="WPAINT_HLT").mode = "WEIGHT_PAINT"
        layout.operator(SetObjectMode2.bl_idname, text="Texture Paint", icon="TPAINT_HLT").mode = "TEXTURE_PAINT"
        layout.operator(SetObjectMode2.bl_idname, text="Particle Edit", icon="PARTICLEMODE").mode = "PARTICLE_EDIT"
            layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")


# ********** Object Armature Interactive Mode **********
class InteractiveModeArmature2(Menu):
    bl_idname = "VIEW3D_MT_Object_Interactive_Armature2"
    bl_label = "Interactive Mode"
    bl_description = "Menu of objects interactive mode"

    def draw(self, context):
        layout = self.layout

        layout.operator(SetObjectMode2.bl_idname, text="Object", icon="OBJECT_DATAMODE").mode = "OBJECT"
        layout.operator(SetObjectMode2.bl_idname, text="Edit", icon="EDITMODE_HLT").mode = "EDIT"
        layout.operator(SetObjectMode2.bl_idname, text="Pose", icon="POSE_HLT").mode = "POSE"
            layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")


# ********** Interactive Mode Other **********
class InteractiveModeOther2(Menu):
    bl_idname = "VIEW3D_MT_Object_Interactive_Other2"
    bl_label = "Interactive Mode"
    bl_description = "Menu of objects interactive mode"

    def draw(self, context):
        layout = self.layout
        layout.operator("object.editmode_toggle", text="Edit/Object Toggle",
                        icon='OBJECT_DATA')
        if context.gpencil_data:
            layout.operator("view3d.interactive_mode_grease_pencil2", icon="GREASEPENCIL")


# ********** Grease Pencil Interactive Mode **********
class VIEW3D_OT_Interactive_Mode_Grease_Pencil2(Operator):
    bl_idname = "view3d.interactive_mode_grease_pencil2"
    bl_label = "Edit Strokes"
    bl_description = "Toggle Edit Strokes for Grease Pencil"

    @classmethod
    def poll(cls, context):
        return (context.gpencil_data is not None)

    def execute(self, context):
        try:
            bpy.ops.gpencil.editmode_toggle()
        except:
            self.report({'WARNING'}, "It is not possible to enter into the interactive mode")
        return {'FINISHED'}


class VIEW3D_MT_Edit_Gpencil2(Menu):
    bl_label = "GPencil"

    def draw(self, context):
        toolsettings = context.tool_settings

        layout = self.layout

        layout.operator("gpencil.brush_paint", text="Sculpt Strokes").wait_for_input = True
        layout.prop_menu_enum(toolsettings.gpencil_sculpt, "tool", text="Sculpt Brush")

        layout.menu("VIEW3D_MT_edit_gpencil_transform")
        layout.operator("transform.mirror", text="Mirror")
        layout.menu("GPENCIL_MT_snap")


        layout.menu("VIEW3D_MT_object_animation")   # NOTE: provides keyingset access...


        layout.menu("VIEW3D_MT_edit_gpencil_delete")
        layout.operator("gpencil.duplicate_move", text="Duplicate")


        layout.menu("VIEW3D_MT_select_gpencil")

        layout.operator("gpencil.copy", text="Copy")
        layout.operator("gpencil.paste", text="Paste")

        layout.separator()

        layout.prop_menu_enum(toolsettings, "proportional_edit")
        layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")

        layout.separator()

        layout.operator("gpencil.reveal")
        layout.operator("gpencil.hide", text="Show Active Layer Only").unselected = True
        layout.operator("gpencil.hide", text="Hide Active Layer").unselected = False

        layout.separator()

        layout.operator_menu_enum("gpencil.move_to_layer", "layer", text="Move to Layer")
        layout.operator_menu_enum("gpencil.convert", "type", text="Convert to Geometry...")


# ********** Text Interactive Mode **********
class VIEW3D_OT_Interactive_Mode_Text2(Operator):
    bl_idname = "view3d.interactive_mode_text2"
    bl_label = "Enter Edit Mode"
    bl_description = "Toggle object's editmode"

    @classmethod
    def poll(cls, context):
        return (context.active_object is not None)

    def execute(self, context):
        bpy.ops.object.editmode_toggle()
        self.report({'INFO'}, "Spacebar shortcut won't work in the Text Edit mode")
        return {'FINISHED'}


# ********** Object Parent **********
class VIEW3D_MT_ParentMenu2(Menu):
    bl_label = "Parent"

    def draw(self, context):
        layout = self.layout

        layout.operator("object.parent_set", text="Set")
        layout.operator("object.parent_clear", text="Clear")


# ********** Object Group **********
class VIEW3D_MT_GroupMenu2(Menu):
    bl_label = "Group"

    def draw(self, context):
        layout = self.layout
        layout.operator("collection.create")
        layout.operator("collection.objects_add_active")
        layout.operator("collection.objects_remove")
        layout.operator("collection.objects_remove_all")
        layout.operator("collection.objects_remove_active")


# ********** Object Camera Options **********
class VIEW3D_MT_Camera_Options2(Menu):
    bl_label = "Camera"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'EXEC_REGION_WIN'
        layout.operator("object.camera_add", text="Add Camera", icon='OUTLINER_OB_CAMERA')
        self.layout.operator("view3d.object_as_camera", text="Object As Camera", icon='OUTLINER_OB_CAMERA')
        self.layout.operator("view3d.viewnumpad", text="View Active Camera", icon='OUTLINER_OB_CAMERA').type = 'CAMERA'


class VIEW3D_MT_Object_Data_Link2(Menu):
    bl_label = "Object Data"

    def draw(self, context):
        layout = self.layout

        layout.operator_menu_enum("object.make_local", "type", text="Make Local...")
        layout.menu("VIEW3D_MT_make_single_user")
        layout.operator("object.proxy_make", text="Make Proxy...")
        layout.operator("object.make_dupli_face")
        UseSeparator(self, context)
        layout.operator("object.data_transfer")
        layout.operator("object.datalayout_transfer")


class VIEW3D_MT_Duplicate2(Menu):
    bl_label = "Duplicate"

    def draw(self, context):
        layout = self.layout

        layout.operator("object.duplicate_move")
        layout.operator("object.duplicate_move_linked")


class VIEW3D_MT_KeyframeMenu2(Menu):
    bl_label = "Keyframe"

    def draw(self, context):
        layout = self.layout
        layout.operator("anim.keyframe_insert_menu",
                        text="Insert Keyframe...")
        layout.operator("anim.keyframe_delete_v3d",
                        text="Delete Keyframe...")
        layout.operator("anim.keying_set_active_set",
                        text="Change Keying Set...")


class VIEW3D_MT_UndoS2(Menu):
    bl_label = "Undo/Redo"

    def draw(self, context):
        layout = self.layout

        layout.operator("ed.undo")
        layout.operator("ed.redo")
        UseSeparator(self, context)
        layout.operator("ed.undo_history")


# ********** Normals / Auto Smooth Menu **********
# Thanks to marvin.k.breuer for the Autosmooth part of the menu
class VIEW3D_MT_AutoSmooth2(Menu):
    bl_label = "Normals / Auto Smooth"

    def draw(self, context):
        layout = self.layout
        obj = context.object
        obj_data = context.active_object.data

        # moved the VIEW3D_MT_edit_mesh_normals contents here under an Edit mode check
        if obj and obj.type == 'MESH' and obj.mode in {'EDIT'}:
            layout.operator("mesh.normals_make_consistent",
                            text="Recalculate Outside").inside = False
            layout.operator("mesh.normals_make_consistent",
                            text="Recalculate Inside").inside = True
            layout.operator("mesh.flip_normals")
            UseSeparator(self, context)

        layout.prop(obj_data, "show_double_sided", text="Normals: Double Sided")
        UseSeparator(self, context)
        layout.prop(obj_data, "use_auto_smooth", text="Normals: Auto Smooth")

        # Auto Smooth Angle - two tab spaces to align it with the rest of the menu
        layout.prop(obj_data, "auto_smooth_angle",
                    text="       Auto Smooth Angle")


# Edit Mode Menu's #

# ********** Edit Mesh **********
class VIEW3D_MT_Edit_Mesh2(Menu):
    bl_label = "Mesh"

    def draw(self, context):
        layout = self.layout
        toolsettings = context.tool_settings
        view = context.space_data

        layout.menu("VIEW3D_MT_edit_mesh_vertices", icon='VERTEXSEL')
        layout.menu("VIEW3D_MT_edit_mesh_edges", icon='EDGESEL')
        layout.menu("VIEW3D_MT_edit_mesh_faces", icon='FACESEL')
        UseSeparator(self, context)
        layout.operator("mesh.duplicate_move")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_edit_mesh_clean", icon='AUTO')
        layout.prop(view, "use_occlude_geometry")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_AutoSmooth2", icon='META_DATA')
        layout.operator("mesh.loopcut_slide",
                        text="Loopcut", icon='UV_EDGESEL')
        UseSeparator(self, context)
        layout.operator("mesh.symmetrize")
        layout.operator("mesh.symmetry_snap")
        UseSeparator(self, context)
        layout.operator("mesh.bisect")
        layout.operator_menu_enum("mesh.sort_elements", "type", text="Sort Elements...")
        UseSeparator(self, context)
        layout.prop_menu_enum(toolsettings, "proportional_edit")
        layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
        UseSeparator(self, context)

        layout.prop(toolsettings, "use_mesh_automerge")
        # Double Threshold - two tab spaces to align it with the rest of the menu
        layout.prop(toolsettings, "double_threshold", text="       Double Threshold")

        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_edit_mesh_showhide")


# ********** Edit Multiselect **********

class VIEW3D_MT_Edit_Multi2(Menu):
    bl_label = "Multi Select"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'

        prop = layout.operator("wm.context_set_value", text="Vertex Select",
                               icon='VERTEXSEL')
        prop.value = "(True, False, False)"
        prop.data_path = "tool_settings.mesh_select_mode"

        prop = layout.operator("wm.context_set_value", text="Edge Select",
                               icon='EDGESEL')
        prop.value = "(False, True, False)"
        prop.data_path = "tool_settings.mesh_select_mode"

        prop = layout.operator("wm.context_set_value", text="Face Select",
                               icon='FACESEL')
        prop.value = "(False, False, True)"
        prop.data_path = "tool_settings.mesh_select_mode"
        UseSeparator(self, context)

        prop = layout.operator("wm.context_set_value",
                               text="Vertex & Edge Select",
                               icon='EDITMODE_HLT')
        prop.value = "(True, True, False)"
        prop.data_path = "tool_settings.mesh_select_mode"

        prop = layout.operator("wm.context_set_value",
                               text="Vertex & Face Select",
                               icon='XRAY')
        prop.value = "(True, False, True)"
        prop.data_path = "tool_settings.mesh_select_mode"

        prop = layout.operator("wm.context_set_value",
                               text="Edge & Face Select",
                               icon='SNAP_FACE')
        prop.value = "(False, True, True)"
        prop.data_path = "tool_settings.mesh_select_mode"
        UseSeparator(self, context)

        prop = layout.operator("wm.context_set_value",
                               text="Vertex & Edge & Face Select",
                               icon='SNAP_VOLUME')
        prop.value = "(True, True, True)"
        prop.data_path = "tool_settings.mesh_select_mode"


# ********** Edit Mesh Edge **********
class VIEW3D_MT_EditM_Edge2(Menu):
    bl_label = "Edges"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'

        layout.operator("mesh.mark_seam")
        layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
        UseSeparator(self, context)

        layout.operator("mesh.mark_sharp")
        layout.operator("mesh.mark_sharp", text="Clear Sharp").clear = True
        layout.operator("mesh.extrude_move_along_normals", text="Extrude")
        UseSeparator(self, context)

        layout.operator("mesh.edge_rotate",
                        text="Rotate Edge CW").direction = 'CW'
        layout.operator("mesh.edge_rotate",
                        text="Rotate Edge CCW").direction = 'CCW'
        UseSeparator(self, context)

        layout.operator("TFM_OT_edge_slide", text="Edge Slide")
        layout.operator("mesh.loop_multi_select", text="Edge Loop")
        layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
        layout.operator("mesh.loop_to_region")
        layout.operator("mesh.region_to_loop")


# ********** Edit Mesh Cursor **********
class VIEW3D_MT_EditCursorMenu2(Menu):
    bl_label = "Snap Cursor"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.operator("object.setorigintoselected2",
                        text="Origin to Selected V/F/E")
        UseSeparator(self, context)
        layout.menu("VIEW3D_Snap_Origin")
        layout.menu("VIEW3D_Snap_Context")
        UseSeparator(self, context)
        layout.operator("view3d.snap_cursor_to_selected",
                        text="Cursor to Selected")
        layout.operator("view3d.snap_cursor_to_center",
                        text="Cursor to Center")
        layout.operator("view3d.snap_cursor_to_grid",
                        text="Cursor to Grid")
        layout.operator("view3d.snap_cursor_to_active",
                        text="Cursor to Active")
        layout.operator("view3d.snap_cursor_to_edge_intersection2",
                        text="Cursor to Edge Intersection")
        UseSeparator(self, context)
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor").use_offset = False
        layout.operator("view3d.snap_selected_to_cursor",
                        text="Selection to Cursor (Keep Offset)").use_offset = True
        layout.operator("view3d.snap_selected_to_grid",
                        text="Selection to Grid")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_Pivot2")
        layout.operator("view3d.pivot_cursor2",
                        text="Set Cursor as Pivot Point")
        layout.operator("view3d.revert_pivot2",
                        text="Revert Pivot Point")


# ********** Edit Mesh UV **********
class VIEW3D_MT_UV_Map2(Menu):
    bl_label = "UV Mapping"

    def draw(self, context):
        layout = self.layout
        layout.operator("uv.unwrap")
        UseSeparator(self, context)
        layout.operator_context = 'INVOKE_DEFAULT'
        layout.operator("uv.smart_project")
        layout.operator("uv.lightmap_pack")
        layout.operator("uv.follow_active_quads")
        layout.operator_context = 'EXEC_REGION_WIN'
        layout.operator("uv.cube_project")
        layout.operator("uv.cylinder_project")
        layout.operator("uv.sphere_project")
        layout.operator_context = 'INVOKE_REGION_WIN'
        UseSeparator(self, context)
        layout.operator("uv.project_from_view").scale_to_bounds = False
        layout.operator("uv.project_from_view", text="Project from View (Bounds)").scale_to_bounds = True
        UseSeparator(self, context)
        layout.operator("uv.reset")


# ********** Edit Curve **********
class VIEW3D_MT_Edit_Curve2(Menu):
    bl_label = "Curve"

    def draw(self, context):
        layout = self.layout

        toolsettings = context.tool_settings

        layout.operator("curve.extrude_move")
        layout.operator("curve.spin")
        layout.operator("curve.duplicate_move")
        layout.operator("curve.split")
        layout.operator("curve.separate")
        layout.operator("curve.make_segment")
        layout.operator("curve.cyclic_toggle")
        UseSeparator(self, context)
        layout.operator("curve.delete", text="Delete...")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_edit_curve_segments")
        layout.prop_menu_enum(toolsettings, "proportional_edit",
                              icon="PROP_CON")
        layout.prop_menu_enum(toolsettings, "proportional_edit_falloff",
                              icon="SMOOTHCURVE")
        layout.menu("VIEW3D_MT_edit_curve_showhide")


class VIEW3D_MT_EditCurveCtrlpoints2(Menu):
    bl_label = "Control Points"

    def draw(self, context):
        layout = self.layout

        edit_object = context.edit_object

        if edit_object.type == 'CURVE':
            layout.operator("transform.transform").mode = 'TILT'
            layout.operator("curve.tilt_clear")
            layout.operator("curve.separate")
            layout.operator_menu_enum("curve.handle_type_set", "type")
            layout.menu("VIEW3D_MT_hook")


class VIEW3D_MT_EditCurveSegments2(Menu):
    bl_label = "Curve Segments"

    def draw(self, context):
        layout = self.layout
        layout.operator("curve.subdivide")
        layout.operator("curve.switch_direction")


class VIEW3D_MT_EditCurveSpecials2(Menu):
    bl_label = "Specials"

    def draw(self, context):
        layout = self.layout
        layout.operator("curve.subdivide")
        UseSeparator(self, context)
        layout.operator("curve.switch_direction")
        layout.operator("curve.spline_weight_set")
        layout.operator("curve.radius_set")
        UseSeparator(self, context)
        layout.operator("curve.smooth")
        layout.operator("curve.smooth_weight")
        layout.operator("curve.smooth_radius")
        layout.operator("curve.smooth_tilt")


# Brushes Menu's #
# Thanks to CoDEmanX for the code
class VIEW3D_MT_Brush_Selection2(Menu):
    bl_label = "Brush Tool"

    def draw(self, context):
        layout = self.layout
        settings = UnifiedPaintPanel.paint_settings(context)

        # check if brush exists (for instance, in paint mode before adding a slot)
        if hasattr(settings, 'brush'):
            brush = settings.brush
        else:
            brush = None

        if not brush:
            return

        if not context.particle_edit_object:
            if UseBrushesLists():
                flow = layout.column_flow(columns=3)

                for brsh in bpy.data.brushes:
                    if (context.sculpt_object and brsh.use_paint_sculpt):
                        props = flow.operator("wm.context_set_id", text=brsh.name,
                                              icon_value=layout.icon(brsh))
                        props.data_path = "tool_settings.sculpt.brush"
                        props.value = brsh.name
                    elif (context.image_paint_object and brsh.use_paint_image):
                        props = flow.operator("wm.context_set_id", text=brsh.name,
                                              icon_value=layout.icon(brsh))
                        props.data_path = "tool_settings.image_paint.brush"
                        props.value = brsh.name
                    elif (context.vertex_paint_object and brsh.use_paint_vertex):
                        props = flow.operator("wm.context_set_id", text=brsh.name,
                                              icon_value=layout.icon(brsh))
                        props.data_path = "tool_settings.vertex_paint.brush"
                        props.value = brsh.name
                    elif (context.weight_paint_object and brsh.use_paint_weight):
                        props = flow.operator("wm.context_set_id", text=brsh.name,
                                              icon_value=layout.icon(brsh))
                        props.data_path = "tool_settings.weight_paint.brush"
                        props.value = brsh.name
            else:
                layout.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)


class VIEW3D_MT_Brush_Settings2(Menu):
    bl_label = "Brush Settings"

    def draw(self, context):
        layout = self.layout
        settings = UnifiedPaintPanel.paint_settings(context)
        brush = settings.brush

        ups = context.tool_settings.unified_paint_settings
        layout.prop(ups, "use_unified_size", text="Unified Size")
        layout.prop(ups, "use_unified_strength", text="Unified Strength")
        if context.image_paint_object or context.vertex_paint_object:
            layout.prop(ups, "use_unified_color", text="Unified Color")
        UseSeparator(self, context)

        layout.menu("VIEW3D_MT_brush_paint_modes")

        if not brush:
            return

        if context.sculpt_object:
            sculpt_tool = brush.sculpt_tool

            UseSeparator(self, context)
            layout.operator_menu_enum("brush.curve_preset", "shape", text="Curve Preset")
            UseSeparator(self, context)

            if sculpt_tool != 'GRAB':
                layout.prop_menu_enum(brush, "stroke_method")

                if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
                    layout.prop_menu_enum(brush, "direction")

                if sculpt_tool == 'LAYER':
                    layout.prop(brush, "use_persistent")
                    layout.operator("sculpt.set_persistent_base")


# Sculpt Menu's #
class VIEW3D_MT_Sculpts2(Menu):
    bl_label = "Sculpt"

    def draw(self, context):
        layout = self.layout
        toolsettings = context.tool_settings
        sculpt = toolsettings.sculpt

        layout.prop(sculpt, "use_symmetry_x")
        layout.prop(sculpt, "use_symmetry_y")
        layout.prop(sculpt, "use_symmetry_z")

        UseSeparator(self, context)
        layout.prop(sculpt, "lock_x")
        layout.prop(sculpt, "lock_y")
        layout.prop(sculpt, "lock_z")

        UseSeparator(self, context)
        layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
        layout.prop(sculpt, "show_low_resolution")
        layout.prop(sculpt, "use_deform_only")

        UseSeparator(self, context)
        layout.prop(sculpt, "show_brush")
        layout.prop(sculpt, "show_diffuse_color")


class VIEW3D_MT_Hide_Masks2(Menu):
    bl_label = "Hide/Mask"

    def draw(self, context):
        layout = self.layout

        props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
        UseSeparator(self, context)
        props = layout.operator("view3d.select_box", text="Box Mask", icon="BORDER_RECT")
        props = layout.operator("paint.hide_show", text="Box Hide")
        props.action = 'HIDE'
        props.area = 'INSIDE'

        props = layout.operator("paint.hide_show", text="Box Show")
        props.action = 'SHOW'
        props.area = 'INSIDE'
        UseSeparator(self, context)

        props = layout.operator("paint.mask_flood_fill", text="Fill Mask", icon="BORDER_RECT")
        props.mode = 'VALUE'
        props.value = 1

        props = layout.operator("paint.mask_flood_fill", text="Clear Mask")
        props.mode = 'VALUE'
        props.value = 0

        layout.operator("paint.mask_flood_fill", text="Invert Mask").mode = 'INVERT'
        UseSeparator(self, context)

        props = layout.operator("paint.hide_show", text="Show All", icon="RESTRICT_VIEW_OFF")
        props.action = 'SHOW'
        props.area = 'ALL'

        props = layout.operator("paint.hide_show", text="Hide Masked", icon="RESTRICT_VIEW_ON")
        props.area = 'MASKED'
        props.action = 'HIDE'


# Sculpt Specials Menu (Thanks to marvin.k.breuer) #
class VIEW3D_MT_Sculpt_Specials2(Menu):
    bl_label = "Sculpt Specials"

    def draw(self, context):
        layout = self.layout
        settings = context.tool_settings

        if context.sculpt_object.use_dynamic_topology_sculpting:
            layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dyntopo")
            UseSeparator(self, context)
            if (settings.sculpt.detail_type_method == 'CONSTANT'):
                layout.prop(settings.sculpt, "constant_detail", text="Const.")
                layout.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
            else:
                layout.prop(settings.sculpt, "detail_size", text="Detail")

            UseSeparator(self, context)
            layout.operator("sculpt.symmetrize", icon='ARROW_LEFTRIGHT')
            layout.prop(settings.sculpt, "symmetrize_direction", "")
            UseSeparator(self, context)
            layout.operator("sculpt.optimize")
            if (settings.sculpt.detail_type_method == 'CONSTANT'):
                layout.operator("sculpt.detail_flood_fill")

            UseSeparator(self, context)
            layout.prop(settings.sculpt, "detail_refine_method", text="")
            layout.prop(settings.sculpt, "detail_type_method", text="")
            UseSeparator(self, context)
            layout.prop(settings.sculpt, "use_smooth_shading", "Smooth")

        else:
            layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dyntopo")


# Display Wire (Thanks to marvin.k.breuer) #
class VIEW3D_OT_Display_Wire_All2(Operator):
    """Display Wire on All Objects"""
    bl_label = "Wire on All Objects"
    bl_idname = "view3d.display_wire_all2"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):

        for obj in bpy.data.objects:
            if obj.show_wire:
                obj.show_all_edges = False
                obj.show_wire = False
            else:
                obj.show_all_edges = True
                obj.show_wire = True

        return {'FINISHED'}


# Vertex Color Menu #
class VIEW3D_MT_Vertex_Colors2(Menu):
    bl_label = "Vertex Colors"

    def draw(self, context):
        layout = self.layout
        layout.operator("paint.vertex_color_set")
        UseSeparator(self, context)
        layout.operator("paint.vertex_color_smooth")
        layout.operator("paint.vertex_color_dirt")


# Weight Paint Menu #
class VIEW3D_MT_Paint_Weights2(Menu):
    bl_label = "Weights"

    def draw(self, context):
        layout = self.layout

        layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
        layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
        UseSeparator(self, context)

        layout.operator("object.vertex_group_normalize_all", text="Normalize All")
        layout.operator("object.vertex_group_normalize", text="Normalize")
        UseSeparator(self, context)

        layout.operator("object.vertex_group_mirror", text="Mirror")
        layout.operator("object.vertex_group_invert", text="Invert")
        UseSeparator(self, context)
        layout.operator("object.vertex_group_clean", text="Clean")
        layout.operator("object.vertex_group_quantize", text="Quantize")
        UseSeparator(self, context)
        layout.operator("object.vertex_group_levels", text="Levels")
        layout.operator("object.vertex_group_smooth", text="Smooth")
        UseSeparator(self, context)
        props = layout.operator("object.data_transfer", text="Transfer Weights")
        props.use_reverse_transfer = True
        props.data_type = 'VGROUP_WEIGHTS'
        UseSeparator(self, context)
        layout.operator("object.vertex_group_limit_total", text="Limit Total")
        layout.operator("object.vertex_group_fix", text="Fix Deforms")

        UseSeparator(self, context)

        layout.operator("paint.weight_set")


# Armature Menu's #

class VIEW3D_MT_Edit_Armature2(Menu):
    bl_label = "Armature"

    def draw(self, context):
        layout = self.layout
        toolsettings = context.tool_settings

        layout.prop_menu_enum(toolsettings, "proportional_edit", icon="PROP_CON")
        layout.prop_menu_enum(toolsettings, "proportional_edit_falloff", icon="SMOOTHCURVE")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
        layout.operator("armature.merge")
        layout.operator("armature.fill")
        layout.operator("armature.split")
        layout.operator("armature.separate")
        layout.operator("armature.switch_direction", text="Switch Direction")
        layout.operator_context = 'EXEC_AREA'
        layout.operator("armature.symmetrize")
        UseSeparator(self, context)
        layout.operator("armature.delete")
        UseSeparator(self, context)
        layout.operator_context = 'INVOKE_DEFAULT'
        layout.operator("armature.armature_layers")
        layout.operator("armature.bone_layers")


class VIEW3D_MT_EditArmatureTK2(Menu):
    bl_label = "Armature Tools"

    def draw(self, context):
        layout = self.layout
        layout.operator("armature.subdivide", text="Subdivide")
        layout.operator("armature.extrude_move")
        layout.operator("armature.extrude_forked")
        layout.operator("armature.duplicate_move")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_edit_armature_delete")
        UseSeparator(self, context)
        layout.operator("transform.transform",
                        text="Scale Envelope Distance").mode = 'BONE_SIZE'
        layout.operator("transform.transform",
                        text="Scale B-Bone Width").mode = 'BONE_SIZE'


# Armature Pose Menu's #

class VIEW3D_MT_Pose2(Menu):
    bl_label = "Pose"

    def draw(self, context):
        layout = self.layout

        layout.menu("VIEW3D_MT_object_animation")
        layout.menu("VIEW3D_MT_pose_slide")
        layout.menu("VIEW3D_MT_pose_propagate")
        layout.menu("VIEW3D_MT_pose_library")
        layout.menu("VIEW3D_MT_pose_motion")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_pose_group")
        layout.menu("VIEW3D_MT_object_parent")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_pose_ik")
        layout.menu("VIEW3D_MT_pose_constraints")
        layout.menu("VIEW3D_MT_PoseNames2")
        layout.operator("pose.quaternions_flip")
        layout.operator_context = 'INVOKE_AREA'
        UseSeparator(self, context)
        layout.operator("armature.armature_layers", text="Change Armature Layers...")
        layout.operator("pose.bone_layers", text="Change Bone Layers...")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_pose_showhide")
        layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")


# Transform Menu's #

class VIEW3D_MT_TransformMenu2(Menu):
    bl_label = "Transform"

    def draw(self, context):
        layout = self.layout
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_object_clear")
        layout.menu("VIEW3D_MT_object_apply")
        UseSeparator(self, context)
        layout.operator("transform.translate", text="Move Texture Space").texture_space = True
        layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
        UseSeparator(self, context)
        layout.operator("object.randomize_transform")
        layout.operator("transform.tosphere", text="To Sphere")
        layout.operator("transform.shear", text="Shear")
        layout.operator("transform.bend", text="Bend")
        layout.operator("transform.push_pull", text="Push/Pull")
        UseSeparator(self, context)
        layout.operator("object.align")
        layout.operator_context = 'EXEC_REGION_WIN'
        layout.operator("transform.transform",
                        text="Align to Transform Orientation").mode = 'ALIGN'
# ********** Edit Mesh Transform **********
class VIEW3D_MT_TransformMenuEdit2(Menu):
    bl_label = "Transform"
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        layout.operator("transform.tosphere", text="To Sphere")
        layout.operator("transform.shear", text="Shear")
        layout.operator("transform.bend", text="Bend")
        layout.operator("transform.push_pull", text="Push/Pull")
        layout.operator("transform.vertex_warp", text="Warp")
        layout.operator("transform.vertex_random", text="Randomize")
        UseSeparator(self, context)
        layout.operator("transform.translate", text="Move Texture Space").texture_space = True
        layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
        UseSeparator(self, context)
        layout.operator_context = 'EXEC_REGION_WIN'
        layout.operator("transform.transform",
                        text="Align to Transform Orientation").mode = 'ALIGN'
        layout.operator("object.origin_set",
                        text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'


# ********** Transform Lite/Short **********
class VIEW3D_MT_TransformMenuLite2(Menu):
    bl_label = "Transform"

    def draw(self, context):
        layout = self.layout
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_object_clear")
        layout.menu("VIEW3D_MT_object_apply")
        UseSeparator(self, context)
        layout.operator("transform.transform",
                        text="Align to Transform Orientation").mode = 'ALIGN'


# ********** Transform Camera **********
class VIEW3D_MT_TransformMenuCamera2(Menu):
    bl_label = "Transform"

    def draw(self, context):
        layout = self.layout

        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.menu("VIEW3D_MT_object_clear")
        layout.menu("VIEW3D_MT_object_apply")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        layout.operator("object.align")
        layout.operator_context = 'EXEC_REGION_WIN'
        UseSeparator(self, context)
        layout.operator("transform.transform",
                        text="Align to Transform Orientation").mode = 'ALIGN'


# ********** Transform Armature  **********
class VIEW3D_MT_TransformMenuArmature2(Menu):
    bl_label = "Transform"

    def draw(self, context):
        layout = self.layout
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        UseSeparator(self, context)
        layout.operator("armature.align")
        layout.operator("object.align")
        layout.operator_context = 'EXEC_AREA'
        UseSeparator(self, context)
        layout.operator("object.origin_set",
                        text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
        layout.operator("object.origin_set",
                        text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
        layout.operator("object.origin_set",
                        text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
        layout.operator("object.origin_set",
                        text="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
# ********** Transform Armature Edit **********
class VIEW3D_MT_TransformMenuArmatureEdit2(Menu):
    bl_label = "Transform"
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        UseSeparator(self, context)
        layout.operator("transform.tosphere", text="To Sphere")
        layout.operator("transform.shear", text="Shear")
        layout.operator("transform.bend", text="Bend")
        layout.operator("transform.push_pull", text="Push/Pull")
        layout.operator("transform.vertex_warp", text="Warp")
        UseSeparator(self, context)
        layout.operator("transform.vertex_random", text="Randomize")
        layout.operator("armature.align")
        layout.operator_context = 'EXEC_AREA'
# ********** Transform Armature Pose **********
class VIEW3D_MT_TransformMenuArmaturePose2(Menu):
    bl_label = "Transform"

    def draw(self, context):
        layout = self.layout
        layout.menu("VIEW3D_MT_ManipulatorMenu12")
        layout.operator("transform.translate", text="Move")
        layout.operator("transform.rotate", text="Rotate")
        layout.operator("transform.resize", text="Scale")
        UseSeparator(self, context)
        layout.operator("pose.transforms_clear", text="Clear All")
        layout.operator("pose.loc_clear", text="Location")
        layout.operator("pose.rot_clear", text="Rotation")
        layout.operator("pose.scale_clear", text="Scale")

        UseSeparator(self, context)

        layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
        obj = context.object
        if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
            if obj.data.display_type == 'BBONE':
                layout.operator("transform.transform", text="Scale BBone").mode = 'BONE_SIZE'
            elif obj.data.display_type == 'ENVELOPE':
                layout.operator("transform.transform", text="Scale Envelope Distance").mode = 'BONE_SIZE'
                layout.operator("transform.transform", text="Scale Radius").mode = 'BONE_ENVELOPE'


# View Menu's #

class VIEW3D_MT_View_Directions2(Menu):
    bl_label = "Directions"

    def draw(self, context):
        layout = self.layout
        layout.operator("view3d.viewnumpad", text="Camera").type = 'CAMERA'
        UseSeparator(self, context)
        layout.operator("view3d.viewnumpad", text="Top").type = 'TOP'
        layout.operator("view3d.viewnumpad", text="Bottom").type = 'BOTTOM'
        UseSeparator(self, context)
        layout.operator("view3d.viewnumpad", text="Front").type = 'FRONT'
        layout.operator("view3d.viewnumpad", text="Back").type = 'BACK'
        UseSeparator(self, context)
        layout.operator("view3d.viewnumpad", text="Right").type = 'RIGHT'
        layout.operator("view3d.viewnumpad", text="Left").type = 'LEFT'


class VIEW3D_MT_View_Border2(Menu):
    bl_label = "Set Border"

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.operator("view3d.clip_border", text="Clipping Border...")
        layout.operator("view3d.zoom_border", text="Zoom Border...")
        layout.operator("view3d.render_border", text="Render Border...").camera_only = False
class VIEW3D_MT_View_Toggle2(Menu):
    bl_label = "View Toggle"
    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        layout.operator("screen.area_dupli")
        UseSeparator(self, context)
        layout.operator("screen.region_quadview")
        layout.operator("screen.screen_full_area", text="Toggle Maximize Area")
        layout.operator("screen.screen_full_area").use_hide_panels = True
class VIEW3D_MT_View_Menu2(Menu):
    bl_label = "View"
    def draw(self, context):
        layout = self.layout
        layout.menu("VIEW3D_MT_Shade2")
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_view_cameras", text="Cameras")
        layout.menu("VIEW3D_MT_View_Directions2")
        layout.menu("VIEW3D_MT_View_Navigation2")
        layout.menu("VIEW3D_MT_View_Align2")
        layout.menu("VIEW3D_MT_View_Toggle2")
        layout.operator("view3d.view_persportho")
        layout.operator("view3d.localview", text="View Global/Local")
        layout.operator("view3d.view_selected").use_all_regions = False
        layout.operator("view3d.view_all").center = False
        UseSeparator(self, context)
        layout.menu("VIEW3D_MT_View_Border2")
        layout.operator("view3d.layers", text="Show All Layers").nr = 0
        UseSeparator(self, context)
        # New menu entry for Animation player
        layout.menu("VIEW3D_MT_Animation_Player2",
                    text="Playback Animation", icon='PLAY')


class VIEW3D_MT_View_Navigation2(Menu):
    bl_label = "Navigation"
    def draw(self, context):
        from math import pi
        layout = self.layout
        layout.operator_enum("view3d.view_orbit", "type")
        props = layout.operator("view3d.view_orbit", "Orbit Opposite")
        props.type = 'ORBITRIGHT'
        props.angle = pi

        UseSeparator(self, context)
        layout.operator("view3d.view_roll", text="Roll Left").type = 'LEFT'
        layout.operator("view3d.view_roll", text="Roll Right").type = 'RIGHT'
        UseSeparator(self, context)
        layout.operator_enum("view3d.view_pan", "type")
        UseSeparator(self, context)
        layout.operator("view3d.zoom", text="Zoom In").delta = 1
        layout.operator("view3d.zoom", text="Zoom Out").delta = -1
        UseSeparator(self, context)
        layout.operator("view3d.zoom_camera_1_to_1", text="Zoom Camera 1:1")
        UseSeparator(self, context)
        layout.operator("view3d.fly")
        layout.operator("view3d.walk")


class VIEW3D_MT_View_Align2(Menu):
    bl_label = "Align View"

    def draw(self, context):
        layout = self.layout
        layout.operator("view3d.view_all", text="Center Cursor and View All").center = True
        layout.operator("view3d.view_center_cursor")
        UseSeparator(self, context)
        layout.operator("view3d.camera_to_view", text="Align Active Camera to View")
        layout.operator("view3d.camera_to_view_selected", text="Align Active Camera to Selected")
        UseSeparator(self, context)
        layout.operator("view3d.view_selected")
        layout.operator("view3d.view_lock_to_active")
        layout.operator("view3d.view_lock_clear")
class VIEW3D_MT_View_Align_Selected2(Menu):
    bl_label = "Align View to Active"
        props = layout.operator("view3d.viewnumpad", text="Top")
        props.align_active = True
        props.type = 'TOP'
        props = layout.operator("view3d.viewnumpad", text="Bottom")
        props.align_active = True
        props.type = 'BOTTOM'
        props = layout.operator("view3d.viewnumpad", text="Front")
        props.align_active = True
        props.type = 'FRONT'
        props = layout.operator("view3d.viewnumpad", text="Back")
        props.align_active = True
        props.type = 'BACK'
        props = layout.operator("view3d.viewnumpad", text="Right")
        props.align_active = True
        props.type = 'RIGHT'
        props = layout.operator("view3d.viewnumpad", text="Left")
        props.align_active = True
        props.type = 'LEFT'


class VIEW3D_MT_View_Cameras2(Menu):
    bl_label = "Cameras"
    def draw(self, context):
        layout = self.layout
        layout.operator("view3d.object_as_camera")
        layout.operator("view3d.viewnumpad", text="Active Camera").type = 'CAMERA'
# Matcap and AO, Wire all and X-Ray entries thanks to marvin.k.breuer
class VIEW3D_MT_Shade2(Menu):
    bl_label = "Shade"
        layout.prop(context.space_data, "viewport_shade", expand=True)
        UseSeparator(self, context)
        if context.active_object:
            if(context.mode == 'EDIT_MESH'):
                layout.operator("MESH_OT_faces_shade_smooth")
                layout.operator("MESH_OT_faces_shade_flat")
            else:
                layout.operator("OBJECT_OT_shade_smooth")
                layout.operator("OBJECT_OT_shade_flat")

        UseSeparator(self, context)
        layout.operator("view3d.display_wire_all2", text="Wire all", icon='SHADING_WIRE')
        layout.prop(context.object, "show_in_front", text="X-Ray", icon="META_CUBE")

        UseSeparator(self, context)
        layout.prop(context.space_data.fx_settings, "use_ssao",
                    text="Ambient Occlusion", icon="GROUP")
        layout.prop(context.space_data, "use_matcap", icon="MATCAP_01")

        if context.space_data.use_matcap:
            row = layout.column(1)
Loading
Loading full blame...