forked from bartvdbraak/blender
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
This commit is contained in:
parent
3ebe389605
commit
e33016c77e
@ -116,25 +116,21 @@ class TOPBAR_HT_lower_bar(Header):
|
|||||||
|
|
||||||
# Object Mode
|
# Object Mode
|
||||||
# -----------
|
# -----------
|
||||||
|
|
||||||
# Testing move to 3D header.
|
|
||||||
'''
|
|
||||||
object_mode = 'OBJECT' if object is None else object.mode
|
object_mode = 'OBJECT' if object is None else object.mode
|
||||||
act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[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)
|
layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
|
||||||
'''
|
|
||||||
|
|
||||||
# Active Tool
|
layout.template_header_3D_mode()
|
||||||
# -----------
|
|
||||||
|
|
||||||
from .space_toolsystem_common import ToolSelectPanelHelper
|
|
||||||
ToolSelectPanelHelper.draw_active_tool_header(context, layout)
|
|
||||||
|
|
||||||
def draw_center(self, context):
|
def draw_center(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
mode = context.mode
|
mode = context.mode
|
||||||
|
|
||||||
layout.separator()
|
# Active Tool
|
||||||
|
# -----------
|
||||||
|
from .space_toolsystem_common import ToolSelectPanelHelper
|
||||||
|
ToolSelectPanelHelper.draw_active_tool_header(context, layout)
|
||||||
|
|
||||||
# Object Mode Options
|
# Object Mode Options
|
||||||
# -------------------
|
# -------------------
|
||||||
|
@ -37,28 +37,40 @@ class VIEW3D_HT_header(Header):
|
|||||||
shading = view.shading
|
shading = view.shading
|
||||||
# mode_string = context.mode
|
# mode_string = context.mode
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
|
overlay = view.overlay
|
||||||
toolsettings = context.tool_settings
|
toolsettings = context.tool_settings
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.template_header()
|
row.template_header()
|
||||||
|
|
||||||
mode = 'OBJECT' if obj is None else obj.mode
|
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]
|
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)
|
layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
|
||||||
del act_mode_item
|
del act_mode_item
|
||||||
|
|
||||||
layout.template_header_3D_mode()
|
layout.template_header_3D_mode()
|
||||||
|
'''
|
||||||
VIEW3D_MT_editor_menus.draw_collapsible(context, layout)
|
|
||||||
|
|
||||||
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
# Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
|
||||||
row = layout
|
|
||||||
shading_type = view.shading.type
|
shading_type = view.shading.type
|
||||||
shading_item = bpy.types.View3DShading.bl_rna.properties['type'].enum_items[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:
|
if obj:
|
||||||
# Set above:
|
# Set above:
|
||||||
@ -66,11 +78,13 @@ class VIEW3D_HT_header(Header):
|
|||||||
|
|
||||||
# Particle edit
|
# Particle edit
|
||||||
if mode == 'PARTICLE_EDIT':
|
if mode == 'PARTICLE_EDIT':
|
||||||
|
row = layout.row()
|
||||||
row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
|
row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True)
|
||||||
|
|
||||||
# Occlude geometry
|
# Occlude geometry
|
||||||
if ((shading.type not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or
|
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'})):
|
(mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})):
|
||||||
|
row = layout.row()
|
||||||
row.prop(view, "use_occlude_geometry", text="")
|
row.prop(view, "use_occlude_geometry", text="")
|
||||||
|
|
||||||
# Pose
|
# 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, "use_select_mask")
|
||||||
row.prop(context.tool_settings.gpencil_sculpt, "selection_alpha", slider=True)
|
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):
|
class VIEW3D_MT_editor_menus(Menu):
|
||||||
bl_space_type = 'VIEW3D_MT_editor_menus'
|
bl_space_type = 'VIEW3D_MT_editor_menus'
|
||||||
@ -3483,18 +3499,14 @@ class VIEW3D_PT_shading(Panel):
|
|||||||
shading = view.shading
|
shading = view.shading
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(shading, "type", expand=True)
|
|
||||||
|
|
||||||
if shading.type == 'SOLID':
|
if shading.type == 'SOLID':
|
||||||
col.separator()
|
|
||||||
col.row().prop(shading, "color_type", expand=True)
|
col.row().prop(shading, "color_type", expand=True)
|
||||||
|
|
||||||
if shading.color_type == 'SINGLE':
|
if shading.color_type == 'SINGLE':
|
||||||
col.separator()
|
|
||||||
col.row().prop(shading, "single_color", text="")
|
col.row().prop(shading, "single_color", text="")
|
||||||
|
|
||||||
if shading.type in ('SOLID', 'TEXTURED'):
|
if shading.type in ('SOLID', 'TEXTURED'):
|
||||||
col.separator()
|
|
||||||
col.row().prop(shading, "light", expand=True)
|
col.row().prop(shading, "light", expand=True)
|
||||||
if shading.light == 'STUDIO':
|
if shading.light == 'STUDIO':
|
||||||
col.row().template_icon_view(shading, "studio_light")
|
col.row().template_icon_view(shading, "studio_light")
|
||||||
@ -3513,7 +3525,7 @@ class VIEW3D_PT_shading(Panel):
|
|||||||
class VIEW3D_PT_overlay(Panel):
|
class VIEW3D_PT_overlay(Panel):
|
||||||
bl_space_type = 'VIEW_3D'
|
bl_space_type = 'VIEW_3D'
|
||||||
bl_region_type = 'HEADER'
|
bl_region_type = 'HEADER'
|
||||||
bl_label = "Overlay"
|
bl_label = "Overlays"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
@ -3529,15 +3541,13 @@ class VIEW3D_PT_overlay(Panel):
|
|||||||
display_all = overlay.show_overlays
|
display_all = overlay.show_overlays
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(overlay, "show_overlays")
|
|
||||||
col.separator()
|
|
||||||
col.prop(view, "show_world")
|
col.prop(view, "show_world")
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.active = display_all
|
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 = layout.column()
|
||||||
col.active = display_all
|
col.active = display_all
|
||||||
|
@ -2589,7 +2589,6 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
|||||||
prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
|
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_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_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);
|
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
Loading…
Reference in New Issue
Block a user