From 202baaaa169fbd21f5b3680681bdb02b2a6e5c19 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Sep 2018 15:46:49 +0200 Subject: 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. --- release/scripts/startup/bl_ui/space_view3d.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'release/scripts/startup/bl_ui/space_view3d.py') diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 00b96912ceb..e6012f5d0b7 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -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, -- cgit v1.2.3