Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d_toolbar.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py67
1 files changed, 25 insertions, 42 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index d3dc6313cff..e91ec59a64f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -35,14 +35,6 @@ class View3DPanel():
# **************** standard tool clusters ******************
-# History/Repeat tools
-def draw_repeat_tools(context, layout):
- col = layout.column(align=True)
- col.label(text="Repeat:")
- col.operator("screen.repeat_last")
- col.operator("screen.repeat_history", text="History...")
-
-
# Keyframing tools
def draw_keyframing_tools(context, layout):
col = layout.column(align=True)
@@ -106,24 +98,6 @@ class VIEW3D_PT_tools_object(View3DPanel, Panel):
row.operator("object.shade_flat", text="Flat")
-class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
- bl_category = "Tools"
- bl_context = "objectmode"
- bl_label = "History"
- bl_options = {'DEFAULT_CLOSED'}
-
- def draw(self, context):
- layout = self.layout
-
- col = layout.column(align=True)
- row = col.row(align=True)
- row.operator("ed.undo")
- row.operator("ed.redo")
- col.operator("ed.undo_history")
-
- draw_repeat_tools(context, layout)
-
-
class VIEW3D_PT_tools_add_object(View3DPanel, Panel):
bl_category = "Create"
bl_context = "objectmode"
@@ -362,8 +336,6 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
col.operator_menu_enum("mesh.merge", "type")
col.operator("mesh.remove_doubles")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_meshweight(View3DPanel, Panel):
bl_category = "Tools"
@@ -541,8 +513,6 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
col.operator("curve.smooth")
col.operator("object.vertex_random")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_add_curve_edit(View3DPanel, Panel):
bl_category = "Create"
@@ -597,8 +567,6 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel, Panel):
col.label(text="Deform:")
col.operator("object.vertex_random")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_add_surface_edit(View3DPanel, Panel):
bl_category = "Create"
@@ -635,8 +603,6 @@ class VIEW3D_PT_tools_textedit(View3DPanel, Panel):
col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
- draw_repeat_tools(context, layout)
-
# ********** default tools for editmode_armature ****************
@@ -678,8 +644,6 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel, Panel):
col.label(text="Deform:")
col.operator("object.vertex_random")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
bl_category = "Options"
@@ -713,8 +677,6 @@ class VIEW3D_PT_tools_mballedit(View3DPanel, Panel):
col.label(text="Deform:")
col.operator("object.vertex_random")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_add_mball_edit(View3DPanel, Panel):
bl_category = "Create"
@@ -753,8 +715,6 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel, Panel):
col.label(text="Deform:")
col.operator("object.vertex_random")
- draw_repeat_tools(context, layout)
-
# ********** default tools for pose-mode ****************
@@ -797,8 +757,6 @@ class VIEW3D_PT_tools_posemode(View3DPanel, Panel):
row.operator("pose.paths_calculate", text="Calculate")
row.operator("pose.paths_clear", text="Clear")
- draw_repeat_tools(context, layout)
-
class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
bl_category = "Options"
@@ -1777,5 +1735,30 @@ class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel):
bl_category = "Grease Pencil"
+# 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 not in {'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...")
+
+
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)