[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59068] branches/soc-2013-ui_replay: The VIEW3D editor gets an extra, extensive toolbar.

Vincent Akkermans vincent at ack-err.net
Sun Aug 11 14:59:52 CEST 2013


Revision: 59068
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59068
Author:   ack-err
Date:     2013-08-11 12:59:51 +0000 (Sun, 11 Aug 2013)
Log Message:
-----------
The VIEW3D editor gets an extra, extensive toolbar. The idea is that this frees up space from the left sidebar for tool options and custom panels.

The extra menubar is meant to provide a place for many non-modal operators in a flatter hierarchy than the current header menu (less clicks, better visibility). The left sidebar is then meant to house custom panels and more activity based panels.

* fixed a bug in the undo/operator stack integration code whereby operators were freed in certain cases
* removed Select and Special menus from the header, and placed the underlying menus in the extra toolbar
* removed some of the sidebar panels, will work on replacing these with more activity based panels
* moved all grease pencil buttons and options into a single panel for the toolbar

Modified Paths:
--------------
    branches/soc-2013-ui_replay/release/scripts/modules/bpy_types.py
    branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/__init__.py
    branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_info.py
    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/blenkernel/BKE_screen.h
    branches/soc-2013-ui_replay/source/blender/blenkernel/intern/blender.c
    branches/soc-2013-ui_replay/source/blender/blenloader/intern/versioning_250.c
    branches/soc-2013-ui_replay/source/blender/editors/armature/armature_relations.c
    branches/soc-2013-ui_replay/source/blender/editors/gpencil/gpencil_buttons.c
    branches/soc-2013-ui_replay/source/blender/editors/include/BIF_glutil.h
    branches/soc-2013-ui_replay/source/blender/editors/include/ED_screen.h
    branches/soc-2013-ui_replay/source/blender/editors/interface/interface_panel.c
    branches/soc-2013-ui_replay/source/blender/editors/screen/area.c
    branches/soc-2013-ui_replay/source/blender/editors/screen/glutil.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_buttons.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/editors/util/editmode_undo.c
    branches/soc-2013-ui_replay/source/blender/makesdna/DNA_screen_types.h
    branches/soc-2013-ui_replay/source/blender/makesrna/RNA_access.h
    branches/soc-2013-ui_replay/source/blender/makesrna/intern/rna_screen.c
    branches/soc-2013-ui_replay/source/blender/makesrna/intern/rna_ui.c
    branches/soc-2013-ui_replay/source/blender/makesrna/intern/rna_wm.c
    branches/soc-2013-ui_replay/source/blender/windowmanager/intern/wm.c
    branches/soc-2013-ui_replay/source/blender/windowmanager/intern/wm_event_system.c
    branches/soc-2013-ui_replay/source/blender/windowmanager/intern/wm_operators.c

Added Paths:
-----------
    branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_menubar.py

Modified: branches/soc-2013-ui_replay/release/scripts/modules/bpy_types.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/modules/bpy_types.py	2013-08-11 12:44:59 UTC (rev 59067)
+++ branches/soc-2013-ui_replay/release/scripts/modules/bpy_types.py	2013-08-11 12:59:51 UTC (rev 59068)
@@ -743,6 +743,10 @@
                        filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
 
 
+class MenuBar(StructRNA, _GenericUI, metaclass=RNAMeta):
+    __slots__ = ()
+
+
 class Region(StructRNA):
     __slots__ = ()
 

Modified: branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/__init__.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/__init__.py	2013-08-11 12:44:59 UTC (rev 59067)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/__init__.py	2013-08-11 12:59:51 UTC (rev 59068)
@@ -76,6 +76,7 @@
     "space_userpref",
     "space_view3d",
     "space_view3d_toolbar",
+    "space_view3d_menubar",
 ]
 
 import bpy

Modified: branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_info.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_info.py	2013-08-11 12:44:59 UTC (rev 59067)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_info.py	2013-08-11 12:59:51 UTC (rev 59068)
@@ -37,7 +37,7 @@
         if context.area.show_menus:
             sub = row.row(align=True)
             sub.menu("INFO_MT_file")
-            sub.menu("INFO_MT_add")
+            # sub.menu("INFO_MT_add")
             if rd.use_game_engine:
                 sub.menu("INFO_MT_game")
             else:

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-11 12:44:59 UTC (rev 59067)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d.py	2013-08-11 12:59:51 UTC (rev 59068)
@@ -44,28 +44,18 @@
 
             sub.menu("VIEW3D_MT_view")
 
-            # 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")
 
-            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()
@@ -1634,9 +1624,7 @@
         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...")

Added: branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_menubar.py
===================================================================
--- branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_menubar.py	                        (rev 0)
+++ branches/soc-2013-ui_replay/release/scripts/startup/bl_ui/space_view3d_menubar.py	2013-08-11 12:59:51 UTC (rev 59068)
@@ -0,0 +1,1628 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+import bpy
+from bpy.types import MenuBar, Menu
+from bpy.app.translations import contexts as i18n_contexts
+
+# *********** UTILITIES ***********
+
+class ShowHideMenu():
+    bl_label = "Show/Hide"
+    _operator_name = ""
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("%s.reveal" % self._operator_name, text="Show Hidden")
+        layout.operator("%s.hide" % self._operator_name, text="Hide Selected").unselected = False
+        layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
+
+class VIEW3D_MT_menubar_particle_hide(ShowHideMenu, Menu):
+    _operator_name = "particle"
+
+class VIEW3D_MT_menubar_pose_hide(ShowHideMenu, Menu):
+    _operator_name = "pose"
+
+class VIEW3D_MT_menubar_mesh_hide(ShowHideMenu, Menu):
+    _operator_name = "mesh"
+
+class VIEW3D_MT_menubar_curve_hide(ShowHideMenu, Menu):
+    _operator_name = "curve"
+
+class VIEW3D_MT_menubar_obj_hide(Menu):
+    bl_label = "Show/Hide"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator("object.hide_view_clear", text="Show Hidden")
+        layout.operator("object.hide_view_set", text="Hide Selected").unselected = False
+        layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True
+
+class VIEW3D_MT_menubar_meta_hide(Menu):
+    bl_label = "Show/Hide"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("mball.reveal_metaelems", text="Show Hidden")
+        layout.operator("mball.hide_metaelems", text="Hide Selected").unselected = False
+        layout.operator("mball.hide_metaelems", text="Hide Unselected").unselected = True
+
+
+class VIEW3D_MT_menubar_general_history(Menu):
+    bl_label = "History"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("ed.undo")
+        layout.operator("ed.redo")
+        layout.separator()
+        layout.operator("screen.redo_last")
+        layout.operator("screen.repeat_last")
+        layout.operator("screen.repeat_history", text="History...")
+
+
+class VIEW3D_MT_menubar_general_snap(Menu):
+    bl_label = "Snap"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
+        layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
+        layout.separator()
+        layout.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected")
+        layout.operator("view3d.snap_cursor_to_center", text="Cursor to Center")
+        layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
+        layout.operator("view3d.snap_cursor_to_active", text="Cursor to Active")
+
+
+def general_mirror(context, layout):
+    layout.operator("transform.mirror", text="Mirror Interactive")
+    layout.operator_context = 'INVOKE_REGION_WIN'
+    props = layout.operator("transform.mirror", text="Mirror X (global)")
+    props.constraint_axis = (True, False, False)
+    props.constraint_orientation = 'GLOBAL'
+    props = layout.operator("transform.mirror", text="Mirror Y (global)")
+    props.constraint_axis = (False, True, False)
+    props.constraint_orientation = 'GLOBAL'
+    props = layout.operator("transform.mirror", text="Mirror Z (global)")
+    props.constraint_axis = (False, False, True)
+    props.constraint_orientation = 'GLOBAL'
+
+    if context.edit_object:
+        props = layout.operator("transform.mirror", text="Mirror X (local)")
+        props.constraint_axis = (True, False, False)
+        props.constraint_orientation = 'LOCAL'
+        props = layout.operator("transform.mirror", text="Mirror Y (local)")
+        props.constraint_axis = (False, True, False)
+        props.constraint_orientation = 'LOCAL'
+        props = layout.operator("transform.mirror", text="Mirror Z (local)")
+        props.constraint_axis = (False, False, True)
+        props.constraint_orientation = 'LOCAL'
+
+        layout.operator("object.vertex_group_mirror")
+
+
+
+class VIEW3D_MT_menubar_general_animation(Menu):
+    bl_label = "Animation"
+
+    def draw(self, context): 
+        layout = self.layout 
+
+        layout.operator("anim.keyframe_insert_menu")
+        layout.operator("anim.keyframe_delete_v3d")
+        layout.operator("anim.keyframe_clear_v3d", text="Clear Keyframes...")
+        layout.operator("anim.keying_set_active_set", text="Change Keying Set...")
+        layout.separator()
+        if context.mode == 'POSE':
+            layout.operator("pose.paths_calculate", text="Calculate Motion Paths")
+            layout.operator("pose.paths_clear", text="Clear Motion Paths")
+        else:
+            layout.operator("object.paths_calculate", text="Calculate Motion Paths")

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list