UI: remove history & object tools

Add object shading menu.
This commit is contained in:
Campbell Barton
2018-04-25 07:25:08 +02:00
parent 021444c827
commit e944e215bf
2 changed files with 12 additions and 63 deletions

View File

@@ -1434,6 +1434,7 @@ class VIEW3D_MT_object(Menu):
layout.menu("VIEW3D_MT_mirror")
layout.menu("VIEW3D_MT_object_clear")
layout.menu("VIEW3D_MT_object_apply")
layout.menu("VIEW3D_MT_object_shading")
layout.separator()
@@ -1652,6 +1653,16 @@ class VIEW3D_MT_object_specials(Menu):
props = layout.operator("object.hide_render_clear_all")
class VIEW3D_MT_object_shading(Menu):
# XXX, this menu is a place to store shading operator in object mode
bl_label = "Shading"
def draw(self, context):
layout = self.layout
layout.operator("object.shade_smooth", text="Smooth")
layout.operator("object.shade_flat", text="Flat")
class VIEW3D_MT_object_apply(Menu):
bl_label = "Apply"
@@ -3899,6 +3910,7 @@ classes = (
VIEW3D_MT_object_rigid_body,
VIEW3D_MT_object_clear,
VIEW3D_MT_object_specials,
VIEW3D_MT_object_shading,
VIEW3D_MT_object_apply,
VIEW3D_MT_object_parent,
VIEW3D_MT_object_track,

View File

@@ -64,42 +64,6 @@ def draw_vpaint_symmetry(layout, vpaint):
col = layout.column()
col.prop(vpaint, "radial_symmetry", text="Radial")
# ********** default tools for object-mode ****************
class VIEW3D_PT_tools_object(View3DPanel, Panel):
bl_category = "Tools"
bl_context = "objectmode"
bl_label = "Edit"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.operator("object.duplicate_move", text="Duplicate")
col.operator("object.duplicate_move_linked", text="Duplicate Linked")
col.operator("object.delete")
obj = context.active_object
if obj:
obj_type = obj.type
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'ARMATURE'}:
col = layout.column(align=True)
col.operator("object.join")
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'ARMATURE', 'FONT', 'LATTICE'}:
col = layout.column(align=True)
col.operator_menu_enum("object.origin_set", "type", text="Set Origin")
if obj_type in {'MESH', 'CURVE', 'SURFACE'}:
col = layout.column(align=True)
col.label(text="Shading:")
row = col.row(align=True)
row.operator("object.shade_smooth", text="Smooth")
row.operator("object.shade_flat", text="Flat")
# ********** default tools for editmode_mesh ****************
@@ -1505,33 +1469,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(GreasePencilBrushCurvesPanel, Pa
bl_space_type = 'VIEW_3D'
# Note: moved here so that it's always in last position in 'Tools' panels!
class VIEW3D_PT_tools_history(View3DPanel, Panel):
bl_category = "Tools"
# No bl_context, we are always available!
bl_label = "History"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
layout = self.layout
obj = context.object
col = layout.column(align=True)
row = col.row(align=True)
row.operator("ed.undo")
row.operator("ed.redo")
if obj is None or obj.mode != 'SCULPT':
# Sculpt mode does not generate an undo menu it seems...
col.operator("ed.undo_history")
col = layout.column(align=True)
col.label(text="Repeat:")
col.operator("screen.repeat_last")
col.operator("screen.repeat_history", text="History...")
classes = (
VIEW3D_PT_tools_object,
VIEW3D_PT_tools_meshedit_options,
VIEW3D_PT_tools_curveedit,
VIEW3D_PT_tools_curveedit_options_stroke,
@@ -1571,7 +1509,6 @@ classes = (
VIEW3D_PT_tools_grease_pencil_sculpt,
VIEW3D_PT_tools_grease_pencil_brush,
VIEW3D_PT_tools_grease_pencil_brushcurves,
VIEW3D_PT_tools_history,
)
if __name__ == "__main__": # only for live edit.