[Bf-blender-cvs] [e33016c77ef] blender2.8: UI Tweaks in 3D View

Pablo Vazquez noreply at git.blender.org
Mon May 14 14:00:40 CEST 2018


Commit: e33016c77ef2727247a2b11b04554a7ea941c94d
Author: Pablo Vazquez
Date:   Mon May 14 14:00:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBe33016c77ef2727247a2b11b04554a7ea941c94d

UI Tweaks in 3D View

* Move Shading modes out of the popover
* Move Show Overlays out of the popover
* Test moving the Mode to the topbar again
* Move submode (select vertex, edge, face) to the topbar
* Remove icon from show_manipulator toggle

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

M	release/scripts/startup/bl_ui/space_topbar.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 6e1cd63d52c..27933e05fbf 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -116,25 +116,21 @@ class TOPBAR_HT_lower_bar(Header):
 
         # Object Mode
         # -----------
-
-        # Testing move to 3D header.
-        '''
         object_mode = 'OBJECT' if object is None else object.mode
         act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[object_mode]
-        layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
-        '''
 
-        # Active Tool
-        # -----------
+        layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
 
-        from .space_toolsystem_common import ToolSelectPanelHelper
-        ToolSelectPanelHelper.draw_active_tool_header(context, layout)
+        layout.template_header_3D_mode()
 
     def draw_center(self, context):
         layout = self.layout
         mode = context.mode
 
-        layout.separator()
+        # Active Tool
+        # -----------
+        from .space_toolsystem_common import ToolSelectPanelHelper
+        ToolSelectPanelHelper.draw_active_tool_header(context, layout)
 
         # Object Mode Options
         # -------------------
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index ef57215741b..b7ab57d0f46 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -37,28 +37,40 @@ class VIEW3D_HT_header(Header):
         shading = view.shading
         # mode_string = context.mode
         obj = context.active_object
+        overlay = view.overlay
         toolsettings = context.tool_settings
 
         row = layout.row(align=True)
         row.template_header()
 
         mode = 'OBJECT' if obj is None else obj.mode
+
+        # Testing move mode to topbar.
+        '''
         act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[mode]
         layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
         del act_mode_item
 
         layout.template_header_3D_mode()
-
-        VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
+        '''
 
         # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
-        row = layout
         shading_type = view.shading.type
         shading_item = bpy.types.View3DShading.bl_rna.properties['type'].enum_items[shading_type]
-        row.popover(space_type='VIEW_3D', region_type='HEADER', panel_type="VIEW3D_PT_shading", text=shading_item.name, icon=shading_item.icon)
-        row.popover(space_type='VIEW_3D', region_type='HEADER', panel_type="VIEW3D_PT_overlay", text="Overlays", icon='WIRE')
 
-        layout.template_header_3D()
+        row = layout.row(align=True)
+        row.prop(shading, "type", text="", expand=True)
+
+        sub = row.row(align=True)
+        sub.enabled = shading.type != 'RENDERED'
+        sub.popover(space_type='VIEW_3D', region_type='HEADER', panel_type="VIEW3D_PT_shading")
+
+        row = layout.row(align=True)
+        row.prop(overlay, "show_overlays", icon="WIRE", text="")
+
+        sub = row.row(align=True)
+        sub.active = overlay.show_overlays
+        sub.popover(space_type='VIEW_3D', region_type='HEADER', panel_type="VIEW3D_PT_overlay")
 
         if obj:
             # Set above:
@@ -66,11 +78,13 @@ class VIEW3D_HT_header(Header):
 
             # Particle edit
             if mode == 'PARTICLE_EDIT':
+                row = layout.row()
                 row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
 
             # Occlude geometry
             if ((shading.type not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
                     (mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})):
+                row = layout.row()
                 row.prop(view, "use_occlude_geometry", text="")
 
         # Pose
@@ -93,6 +107,8 @@ class VIEW3D_HT_header(Header):
             row.prop(context.tool_settings.gpencil_sculpt, "use_select_mask")
             row.prop(context.tool_settings.gpencil_sculpt, "selection_alpha", slider=True)
 
+        VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
+
 
 class VIEW3D_MT_editor_menus(Menu):
     bl_space_type = 'VIEW3D_MT_editor_menus'
@@ -3483,18 +3499,14 @@ class VIEW3D_PT_shading(Panel):
         shading = view.shading
 
         col = layout.column()
-        col.prop(shading, "type", expand=True)
 
         if shading.type == 'SOLID':
-            col.separator()
             col.row().prop(shading, "color_type", expand=True)
 
             if shading.color_type == 'SINGLE':
-                col.separator()
                 col.row().prop(shading, "single_color", text="")
 
         if shading.type in ('SOLID', 'TEXTURED'):
-            col.separator()
             col.row().prop(shading, "light", expand=True)
             if shading.light == 'STUDIO':
                 col.row().template_icon_view(shading, "studio_light")
@@ -3513,7 +3525,7 @@ class VIEW3D_PT_shading(Panel):
 class VIEW3D_PT_overlay(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'HEADER'
-    bl_label = "Overlay"
+    bl_label = "Overlays"
 
     @classmethod
     def poll(cls, context):
@@ -3529,15 +3541,13 @@ class VIEW3D_PT_overlay(Panel):
         display_all = overlay.show_overlays
 
         col = layout.column()
-        col.prop(overlay, "show_overlays")
-        col.separator()
         col.prop(view, "show_world")
 
         col = layout.column()
         col.active = display_all
-        col.prop(overlay, "show_cursor")
+        col.prop(overlay, "show_cursor", text="3D Cursor")
 
-        col.prop(view, "show_manipulator")
+        col.prop(view, "show_manipulator", text="Manipulators")
 
         col = layout.column()
         col.active = display_all
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index d00c14ae1db..e8ab86c51a3 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2589,7 +2589,6 @@ static void rna_def_space_view3d(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_MANIPULATOR_DRAW);
 	RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
-	RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
 	prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);



More information about the Bf-blender-cvs mailing list