Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Vazquez <venomgfx@gmail.com>2018-05-14 15:00:29 +0300
committerPablo Vazquez <venomgfx@gmail.com>2018-05-14 15:00:37 +0300
commite33016c77ef2727247a2b11b04554a7ea941c94d (patch)
treea1204b69e6ab17626372c9103b93ee78783da449 /release
parent3ebe389605feee1d6956b1d5f438fed55b235e7e (diff)
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
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py16
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py40
2 files changed, 31 insertions, 25 deletions
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