Viewport: change Z key to shading pie menu to switch mode, X-ray and overlays.

This lets us do the most common shading switching with one shortcut. We keep
alt+Z and shift+Z for quickly toggling to lookdev and rendered mode and back,
it's debatable which settings deserve a dedicated shortcut like this.

The downside is that switching X-ray is a little slower, and that there is
some risk of accidentally going to lookdev or rendered mode which can be slow
to cancel.
This commit is contained in:
Brecht Van Lommel
2018-09-21 15:46:49 +02:00
parent 684739c6f9
commit 202baaaa16
3 changed files with 32 additions and 18 deletions

View File

@@ -3792,6 +3792,25 @@ class VIEW3D_MT_view_pie(Menu):
pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED')
class VIEW3D_MT_shading_pie(Menu):
bl_label = "Shading"
def draw(self, context):
layout = self.layout
view = context.space_data
pie = layout.menu_pie()
pie.prop(view.shading, "type", expand=True)
pie.prop(view.overlay, "show_overlays", icon='OVERLAY')
if context.mode == 'POSE':
pie.prop(view.overlay, "show_bone_select", icon='ORTHO')
elif context.mode == 'EDIT_MESH':
pie.prop(view.shading, "show_xray", icon='ORTHO')
elif view.shading.type in {'SOLID', 'WIREFRAME'}:
pie.prop(view.shading, "show_xray", icon='ORTHO')
# ********** Panel **********
@@ -5195,6 +5214,7 @@ classes = (
VIEW3D_MT_edit_gpencil_interpolate,
VIEW3D_MT_object_mode_pie,
VIEW3D_MT_view_pie,
VIEW3D_MT_shading_pie,
VIEW3D_PT_view3d_properties,
VIEW3D_PT_view3d_camera_lock,
VIEW3D_PT_view3d_cursor,