[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58577] branches/soc-2013-ui_replay: Some initial changes to the toolbar.
Vincent Akkermans
vincent at ack-err.net
Wed Jul 24 17:51:06 CEST 2013
Revision: 58577
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58577
Author: ack-err
Date: 2013-07-24 15:51:05 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
Some initial changes to the toolbar. Buttons can be double height, shortcuts show, many panels instead of a few (only object and edit mode).
Modified Paths:
--------------
branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/soc-2013-ui_replay/source/blender/blenloader/intern/readfile.c
branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
branches/soc-2013-ui_replay/source/blender/editors/include/UI_interface.h
branches/soc-2013-ui_replay/source/blender/editors/interface/interface_layout.c
branches/soc-2013-ui_replay/source/blender/editors/space_clip/clip_toolbar.c
branches/soc-2013-ui_replay/source/blender/editors/space_clip/space_clip.c
branches/soc-2013-ui_replay/source/blender/editors/space_view3d/space_view3d.c
branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_intern.h
branches/soc-2013-ui_replay/source/blender/editors/space_view3d/view3d_toolbar.c
branches/soc-2013-ui_replay/source/blender/makesrna/intern/rna_ui_api.c
Modified: branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-07-24 14:39:21 UTC (rev 58576)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-07-24 15:51:05 UTC (rev 58577)
@@ -28,97 +28,123 @@
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
+# ********** common tools for two or more modes ****************
-# **************** standard tool clusters ******************
+def grease_panel(mode):
+ class cls(View3DPanel, Panel):
+ bl_context = mode
+ bl_label = "Grease & Measure"
+ def draw(self, context):
+ layout = self.layout
-# 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...")
+ col = layout.column(align=True)
+ row = col.row(align=True, button_height=2)
+ row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
+ row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
-# Keyframing tools
-def draw_keyframing_tools(context, layout):
- col = layout.column(align=True)
- col.label(text="Keyframes:")
- row = col.row()
- row.operator("anim.keyframe_insert_menu", text="Insert")
- row.operator("anim.keyframe_delete_v3d", text="Remove")
+ row = col.row(align=True, button_height=2)
+ row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
+ row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
+ row = col.row()
+ row.prop(context.tool_settings, "use_grease_pencil_sessions")
-# Grease Pencil tools
-def draw_gpencil_tools(context, layout):
- col = layout.column(align=True)
+ col.operator("view3d.ruler")
- col.label(text="Grease Pencil:")
+ cls.__name__ = "VIEW3D_PT_tools_%s_grease" % mode
+ return cls
- row = col.row()
- row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
- row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
+def history_panel(mode):
+ class cls(View3DPanel, Panel):
+ bl_context = mode
+ bl_label = "History"
- row = col.row()
- row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
- row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
+ def draw(self, context):
+ layout = self.layout
+ col = layout.column(align=True, button_height=2)
+ col.operator("screen.redo_last", text="Change last")
+
+ col = layout.column(align=True)
+ col.operator("screen.repeat_last")
+ col.operator("screen.repeat_history", text="History...")
- row = col.row()
- row.prop(context.tool_settings, "use_grease_pencil_sessions")
+ cls.__name__ = "VIEW3D_PT_tools_%s_history" % mode
+ return cls
- col.operator("view3d.ruler")
-
# ********** default tools for object-mode ****************
-class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
+class VIEW3D_PT_tools_objectmode_transform(View3DPanel, Panel):
bl_context = "objectmode"
- bl_label = "Object Tools"
+ bl_label = "Transform"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
- col.label(text="Transform:")
- col.operator("transform.translate")
- row = col.row(align=True, button_height=2)
- row.operator("transform.rotate")
- row.operator("transform.resize", text="Scale")
+ row = col.row(align=True)
+ row.operator("transform.translate", text="", single_unit=False, icon='MAN_TRANS')
+ row.operator("transform.rotate", text="", single_unit=False, icon='MAN_ROT')
+ row.operator("transform.resize", text="", single_unit=False, icon='MAN_SCALE')
+ col.operator("object.origin_set", text="Origin")
+
+class VIEW3D_PT_tools_objectmode_adjust(View3DPanel, Panel):
+ bl_context = "objectmode"
+ bl_label = "Adjust"
+ def draw(self, context):
+ layout = self.layout
+ #active_object = context.active_object
+ #if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}:
col = layout.column(align=True)
- col.operator("object.origin_set", text="Origin")
+ col.operator("object.shade_smooth", text="Shade smooth")
+ col.operator("object.shade_flat", text="Shade flat")
+class VIEW3D_PT_tools_objectmode_add(View3DPanel, Panel):
+ bl_context = "objectmode"
+ bl_label = "Add & Delete"
+
+ def draw(self, context):
+ layout = self.layout
+
col = layout.column(align=True)
- col.label(text="Object:")
- col.operator("object.duplicate_move")
- col.operator("object.delete")
+ row = col.row(align=True, button_height=2)
+ # TODO: wrong operators in these two lines
+ row.operator("wm.call_menu", text="", single_unit=False, icon='MAN_ROT').name = 'INFO_MT_add'
+ row.operator("object.delete", text="", single_unit=False, icon='MAN_TRANS')
+
+ col = layout.column(align=True)
+ row = col.row(align=True)
+ row.operator("object.duplicate_move", text="", single_unit=False, icon='MAN_ROT')
+ row.operator("object.duplicate_move_linked", text="", single_unit=False, icon='MAN_TRANS')
+ row = col.row(align=True)
col.operator("object.join")
+
+VIEW3D_PT_tools_objectmode_grease = grease_panel("objectmode")
- active_object = context.active_object
- if active_object and active_object.type in {'MESH', 'CURVE', 'SURFACE'}:
+VIEW3D_PT_tools_objectmode_history = history_panel("objectmode")
- 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_objectmode_keyframes(View3DPanel, Panel):
+ bl_context = "objectmode"
+ bl_label = "Keyframes"
+
+ def draw(self, context):
+ layout = self.layout
- draw_keyframing_tools(context, layout)
-
col = layout.column(align=True)
- col.label(text="Motion Paths:")
- row = col.row(align=True)
- row.operator("object.paths_calculate", text="Calculate")
- row.operator("object.paths_clear", text="Clear")
+ row = col.row(align=True, button_height=2)
- draw_repeat_tools(context, layout)
+ row.operator("anim.keyframe_insert_menu", text="Insert", single_unit=False)
+ row.operator("anim.keyframe_delete_v3d", text="Remove", single_unit=False)
- draw_gpencil_tools(context, layout)
col = layout.column(align=True)
+ col.operator("object.paths_calculate", text="Calculate motion")
+ col.operator("object.paths_clear", text="Clear motion")
-
class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
bl_context = "objectmode"
- bl_label = "Rigid Body Tools"
+ bl_label = "Rigid Body"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
@@ -141,80 +167,112 @@
col.label(text="Constraints:")
col.operator("rigidbody.connect", text="Connect")
+
# ********** default tools for editmode_mesh ****************
-
-class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
+class VIEW3D_PT_tools_editmode_transform(View3DPanel, Panel):
bl_context = "mesh_edit"
- bl_label = "Mesh Tools"
+ bl_label = "Transform"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
- col.label(text="Transform:")
- col.operator("transform.translate")
- col.operator("transform.rotate")
- col.operator("transform.resize", text="Scale")
+ row = col.row(align=True)
+ row.operator("transform.translate", text="", single_unit=False, icon='MAN_TRANS')
+ row.operator("transform.rotate", text="", single_unit=False, icon='MAN_ROT')
+ row.operator("transform.resize", text="", single_unit=False, icon='MAN_SCALE')
col.operator("transform.shrink_fatten", text="Shrink/Fatten")
col.operator("transform.push_pull", text="Push/Pull")
col = layout.column(align=True)
- col.label(text="Deform:")
- row = col.row(align=True)
- row.operator("transform.edge_slide", text="Slide Edge")
- row.operator("transform.vert_slide", text="Vertex")
- col.operator("mesh.noise")
- col.operator("mesh.vertices_smooth")
+ col.operator("transform.edge_slide", text="Slide edge")
+ col.operator("transform.vert_slide", text="Slide vertex")
col = layout.column(align=True)
- col.label(text="Add:")
+ col.operator("mesh.vertices_smooth", text="Smooth vertices")
+class VIEW3D_PT_tools_editmode_add(View3DPanel, Panel):
+ bl_context = "mesh_edit"
+ bl_label = "Add & Delete"
+
+ def draw(self, context):
+ layout = self.layout
+
+ col = layout.column(align=True)
+ row = col.row(align=True, button_height=2)
+ row.operator("wm.call_menu", text="", single_unit=False, icon='MAN_ROT').name = 'INFO_MT_mesh_add'
+ row.operator("wm.call_menu", text="", single_unit=False, icon='MAN_TRANS').name = 'VIEW3D_MT_edit_mesh_delete'
+
+ col = layout.column(align=True)
+ col.operator("mesh.duplicate_move", text="Duplicate", single_unit=False, icon='MAN_ROT')
+
+class VIEW3D_PT_tools_editmode_topology(View3DPanel, Panel):
+ bl_context = "mesh_edit"
+ bl_label = "Topology"
+
+ def draw(self, context):
+ layout = self.layout
+
+ col = layout.column(align=True)
+ row = col.row(align=True, button_height=2)
+ row.operator("view3d.edit_mesh_extrude_move_normal", text="", single_unit=False, icon='MAN_ROT')
+ row.operator("view3d.edit_mesh_extrude_individual_move", text="", single_unit=False, icon='MAN_TRANS')
col.menu("VIEW3D_MT_edit_mesh_extrude")
- col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list