diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-21 16:46:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-21 17:52:34 +0300 |
commit | 202baaaa169fbd21f5b3680681bdb02b2a6e5c19 (patch) | |
tree | 8b45f7436fb15fc2b0e5c38a4c61becf21391da2 /release/scripts/startup/bl_ui/space_view3d.py | |
parent | 684739c6f9ddafbbf9e7a2bb4e195f6f28fd3972 (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 20 |
1 files changed, 20 insertions, 0 deletions
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, |