[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59664] branches/soc-2013-ui_replay: Work in progress: polishing and redoing some of the panel layouts for the view3d.

Vincent Akkermans vincent at ack-err.net
Fri Aug 30 18:25:57 CEST 2013


Revision: 59664
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59664
Author:   ack-err
Date:     2013-08-30 16:25:56 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
Work in progress: polishing and redoing some of the panel layouts for the view3d. 

Modified Paths:
--------------
    branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d.py
    branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2013-ui_replay/source/blender/editors/gpencil/gpencil_buttons.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/interface/interface_templates.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_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.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d.py	2013-08-30 14:49:20 UTC (rev 59663)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d.py	2013-08-30 16:25:56 UTC (rev 59664)
@@ -44,18 +44,28 @@
 
             sub.menu("VIEW3D_MT_view")
 
-            # if edit_object:
-            #     sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
-            # elif obj:
-            #     if mode_string not in {'PAINT_TEXTURE'}:
-            #         sub.menu("VIEW3D_MT_%s" % mode_string.lower())
-            #     if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
-            #         sub.menu("VIEW3D_MT_brush")
-            #     if mode_string == 'SCULPT':
-            #         sub.menu("VIEW3D_MT_hide_mask")
-            # else:
-            #     sub.menu("VIEW3D_MT_object")
+            # Select Menu
+            if mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}:
+                mesh = obj.data
+                if mesh.use_paint_mask:
+                    sub.menu("VIEW3D_MT_select_paint_mask")
+                elif mesh.use_paint_mask_vertex and mode_string == 'PAINT_WEIGHT':
+                    sub.menu("VIEW3D_MT_select_paint_mask_vertex")
+            elif mode_string not in {'EDIT_TEXT', 'SCULPT'}:
+                sub.menu("VIEW3D_MT_select_%s" % mode_string.lower())
 
+            if edit_object:
+                sub.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
+            elif obj:
+                if mode_string not in {'PAINT_TEXTURE'}:
+                    sub.menu("VIEW3D_MT_%s" % mode_string.lower())
+                if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
+                    sub.menu("VIEW3D_MT_brush")
+                if mode_string == 'SCULPT':
+                    sub.menu("VIEW3D_MT_hide_mask")
+            else:
+                sub.menu("VIEW3D_MT_object")
+
         # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
         row = layout
         layout.template_header_3D()
@@ -1624,7 +1634,9 @@
         layout = self.layout
 
         layout.operator("poselib.browse_interactive", text="Browse Poses...")
+
         layout.separator()
+
         layout.operator("poselib.pose_add", text="Add Pose...")
         layout.operator("poselib.pose_rename", text="Rename Pose...")
         layout.operator("poselib.pose_remove", text="Remove Pose...")

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-08-30 14:49:20 UTC (rev 59663)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-08-30 16:25:56 UTC (rev 59664)
@@ -30,55 +30,222 @@
 
 # ********** common tools for two or more modes ****************
 
-# class VIEW3D_PT_tools_modeswitch(View3DPanel, Panel):
-#     bl_label = "Modes"
+def history_panel(mode):
+    class cls(View3DPanel, Panel):
+        bl_context = mode
+        bl_label = "History"
 
-#     def draw(self, context):
-#         layout = self.layout
-#         active_object = context.active_object
+        def draw(self, context):
+                layout = self.layout 
+                # col = layout.column(align=True, button_height=1.5)
+                # 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...")
 
-#         col = layout.column(align=True)
-#         row = col.row(align=True)
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='OBJECT_DATAMODE').mode = "OBJECT"
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='EDITMODE_HLT').mode = "EDIT"
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='SCULPTMODE_HLT').mode = "SCULPT"
+    cls.__name__ = "VIEW3D_PT_tools_%s_history" % mode
+    return cls
 
-#         row = col.row(align=True)
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='VPAINT_HLT').mode = "VERTEX_PAINT"
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='TPAINT_HLT').mode = "TEXTURE_PAINT"
-#         row.operator("object.mode_set", text="", single_unit=False, shortcut=False, icon='WPAINT_HLT').mode = "WEIGHT_PAINT"
-    
+# ********** default tools for object-mode ****************
 
-# def grease_panel(mode):
-#     class cls(View3DPanel, Panel):
-#         bl_context = mode
-#         bl_label = "Grease & Measure"
-#         def draw(self, context):
-#             layout = self.layout
+# VIEW3D_PT_tools_objectmode_modes = switch_panel("objectmode");
 
-#             col = layout.column(align=True)
-#             row = col.row(align=True, button_height=2)
+class VIEW3D_PT_tools_objectmode_transform(View3DPanel, Panel):
+    bl_context = "objectmode"
+    bl_label = "Transform"
 
-#             row.operator("gpencil.draw", text="", shortcut=False, single_unit=False, icon='GREASE_DRAW').mode = 'DRAW'
-#             row.operator("gpencil.draw", text="", shortcut=False, single_unit=False, icon='GREASE_LINE').mode = 'DRAW_STRAIGHT'
+    def draw(self, context):
+        layout = self.layout
 
-#             row = col.row(align=True, button_height=2)
-#             row.operator("gpencil.draw", text="", shortcut=False, single_unit=False, icon='GREASE_POLY').mode = 'DRAW_POLY'
-#             row.operator("gpencil.draw", text="", shortcut=False, single_unit=False, icon='GREASE_ERASE').mode = 'ERASER'
+        col = layout.column(align=True)
+        row = col.row(align=True)
+        row.operator("transform.translate", text="", single_unit=False, icon='MAN_TRANS', shortcut=False)
+        row.operator("transform.rotate", text="", single_unit=False, icon='MAN_ROT', shortcut=False)
+        row.operator("transform.resize", text="", single_unit=False, icon='MAN_SCALE', shortcut=False)
+        col.operator("object.origin_set", text="Origin")
+                
+class VIEW3D_PT_tools_objectmode_add(View3DPanel, Panel):
+    bl_context = "objectmode"
+    bl_label = "Add & Delete"
 
-#             row = col.row()
-#             row.prop(context.tool_settings, "use_grease_pencil_sessions", text="use sketching sessions")
+    def draw(self, context):
+        layout = self.layout
 
-#             col.operator("view3d.ruler", icon='RULER')
+        col = layout.column(align=True)
+        row = col.row(align=True, button_height=1.5)
+        row.operator("wm.call_menu", text="", single_unit=False, shortcut=False, icon='TOOLBAR_ADD').name = 'INFO_MT_add'
+        row.operator("object.delete", text="", shortcut=False, single_unit=False, icon='TOOLBAR_DELETE')
+        
+        col = layout.column(align=True)
+        row = col.row(align=True)
+        row.operator("object.duplicate_move", text="", shortcut=False, single_unit=False, icon='TOOLBAR_DUP')
+        row.operator("object.duplicate_move_linked", text="", shortcut=False, single_unit=False, icon='TOOLBAR_DUP_LINKED')
+        row = col.row(align=True)
+        col.operator("object.join")
 
-#     cls.__name__ = "VIEW3D_PT_tools_%s_grease" % mode
-#     return cls
+class VIEW3D_PT_tools_objectmode_adjust(View3DPanel, Panel):
+    bl_context = "objectmode"
+    bl_label = "Adjust"
 
-# ********** default tools for object-mode ****************
+    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.shade_smooth", text="Shade smooth")
+        col.operator("object.shade_flat", text="Shade flat")
         
+VIEW3D_PT_tools_objectmode_history = history_panel("objectmode")
 
+class VIEW3D_PT_tools_objectmode_keyframes(View3DPanel, Panel):
+    bl_context = "objectmode"
+    bl_label = "Keyframes"
+    
+    def draw(self, context):
+        layout = self.layout 
+
+        col = layout.column(align=True)
+        row = col.row(align=True, button_height=1.5)
+
+        row.operator("anim.keyframe_insert_menu", text="", single_unit=False, shortcut=False, icon='KEY_HLT')
+        row.operator("anim.keyframe_delete_v3d", text="", single_unit=False, shortcut=False, icon='KEY_DEHLT')
+
+        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"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        col = layout.column(align=True)
+        col.label(text="Add/Remove:")
+        row = col.row()
+        row.operator("rigidbody.objects_add", text="Add Active").type = 'ACTIVE'
+        row.operator("rigidbody.objects_add", text="Add Passive").type = 'PASSIVE'
+        row = col.row()
+        row.operator("rigidbody.objects_remove", text="Remove")
+
+        col = layout.column(align=True)
+        col.label(text="Object Tools:")
+        col.operator("rigidbody.shape_change", text="Change Shape")
+        col.operator("rigidbody.mass_calculate", text="Calculate Mass")
+        col.operator("rigidbody.object_settings_copy", text="Copy from Active")
+        col.operator("rigidbody.bake_to_keyframes", text="Bake To Keyframes")
+        col.label(text="Constraints:")
+        col.operator("rigidbody.connect", text="Connect")
+
+
 # ********** default tools for editmode_mesh ****************
 
+# VIEW3D_PT_tools_editmode_modes = switch_panel("mesh_edit");
+
+class VIEW3D_PT_tools_editmode_transform(View3DPanel, Panel):
+    bl_context = "mesh_edit"
+    bl_label = "Transform"
+
+    def draw(self, context):
+        layout = self.layout
+
+        col = layout.column(align=True)
+        row = col.row(align=True)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list