[Bf-blender-cvs] [428a8d5] master: Object Mode Toolbar Tabs

Jonathan Williamson noreply at git.blender.org
Fri Jan 3 22:28:49 CET 2014


Commit: 428a8d5980277d70bc041129a5c33ca9c85c6b9e
Author: Jonathan Williamson
Date:   Sun Dec 22 17:13:29 2013 -0600
https://developer.blender.org/rB428a8d5980277d70bc041129a5c33ca9c85c6b9e

Object Mode Toolbar Tabs

Summary:
Here are the initial tabs for the 3D View Object Mode toolbar. This is based on the discussions between myself and @billrey in T37569

P.S. apologies for the duplicate. The first one I mistakenly sent to the Edit Mode task, T37568. I have corrected it and also made a couple changes, per @campbellbarton's request.

Reviewers: campbellbarton

CC: campbellbarton, brecht, billrey

Maniphest Tasks: T37569

Differential Revision: http://developer.blender.org/D129

===================================================================

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 9a56cc5..d9bbf3e 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -40,7 +40,6 @@ def draw_repeat_tools(context, layout):
     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)
@@ -49,7 +48,6 @@ def draw_keyframing_tools(context, layout):
     row.operator("anim.keyframe_insert_menu", text="Insert")
     row.operator("anim.keyframe_delete_v3d", text="Remove")
 
-
 # Grease Pencil tools
 def draw_gpencil_tools(context, layout):
     col = layout.column(align=True)
@@ -69,12 +67,12 @@ def draw_gpencil_tools(context, layout):
 
     col.operator("view3d.ruler")
 
-
 # ********** default tools for object-mode ****************
 
-class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
+class VIEW3D_PT_tools_basic(View3DPanel, Panel):
+    bl_category = "Basic"
     bl_context = "objectmode"
-    bl_label = "Object Tools"
+    bl_label = "Basic"
 
     def draw(self, context):
         layout = self.layout
@@ -84,25 +82,36 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
         col.operator("transform.translate")
         col.operator("transform.rotate")
         col.operator("transform.resize", text="Scale")
-
-        col = layout.column(align=True)
-        col.operator("object.origin_set", text="Origin")
-
-        col = layout.column(align=True)
-        col.label(text="Object:")
-        col.operator("object.duplicate_move", text="Duplicate")
-        col.operator("object.delete")
-        col.operator("object.join")
-
+            
         active_object = context.active_object
         if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}:
 
             col = layout.column(align=True)
+            col.label(text="Object:")
+            col.operator("object.join")
+            col.operator("object.duplicate_move", text="Duplicate")
+            col.operator("object.duplicate_move_linked", text="Duplicate Linked")
+            col.operator("object.delete")
+
+            col = layout.column(align=True)
+            col.operator("object.origin_set", text="Origin")
+
+            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")
 
+class VIEW3D_PT_tools_animation(View3DPanel, Panel):
+    bl_category = "Animation"
+    bl_context = "objectmode"
+    bl_label = "Animation"
+
+    def draw(self, context):
+        layout = self.layout
+
+        col = layout.column(align=True)
+
         draw_keyframing_tools(context, layout)
 
         col = layout.column(align=True)
@@ -111,15 +120,10 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
         row.operator("object.paths_calculate", text="Calculate")
         row.operator("object.paths_clear", text="Clear")
 
-        draw_repeat_tools(context, layout)
-
-        draw_gpencil_tools(context, layout)
-
-
 class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
+    bl_category = "Physics"
     bl_context = "objectmode"
     bl_label = "Rigid Body Tools"
-    bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
         layout = self.layout
@@ -142,8 +146,26 @@ class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
         col.label(text="Constraints:")
         col.operator("rigidbody.connect", text="Connect")
 
-# ********** default tools for editmode_mesh ****************
+# Grease Pencil tools
+class VIEW3D_PT_tools_greasepencil(View3DPanel, Panel):
+    bl_category = "Grease Pencil"
+    bl_label = "Grease Pencil"
+
+    def draw(self, context):
+        layout = self.layout
+        draw_gpencil_tools(context, layout)
+
+class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
+    bl_category = "History"
+    bl_context = "objectmode"
+    bl_label = "History"
 
+    def draw(self, context):
+        layout = self.layout     
+
+        draw_repeat_tools(context, layout)
+
+# ********** default tools for editmode_mesh ****************
 
 class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
     bl_context = "mesh_edit"




More information about the Bf-blender-cvs mailing list