[Bf-blender-cvs] [d2a491da5f8] blender2.8: Viewport: tweak shading pie menu to have X-ray on same side as wireframe.
Brecht Van Lommel
noreply at git.blender.org
Fri Sep 21 17:01:46 CEST 2018
Commit: d2a491da5f88d0a823d0aa6e01b9c29a9b055612
Author: Brecht Van Lommel
Date: Fri Sep 21 17:01:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd2a491da5f88d0a823d0aa6e01b9c29a9b055612
Viewport: tweak shading pie menu to have X-ray on same side as wireframe.
===================================================================
M 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 e6012f5d0b7..068276f44c6 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3797,18 +3797,27 @@ class VIEW3D_MT_shading_pie(Menu):
def draw(self, context):
layout = self.layout
+ pie = layout.menu_pie()
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')
+ else:
+ xray_active = (context.mode in 'EDIT_MESH') or \
+ (view.shading.type in {'SOLID', 'WIREFRAME'})
+
+ if xray_active:
+ sub = pie
+ else:
+ sub = pie.row()
+ sub.active = False
+
+ sub.prop(view.shading, "show_xray", icon='ORTHO')
+
+ pie.prop(view.overlay, "show_overlays", icon='OVERLAY')
# ********** Panel **********
More information about the Bf-blender-cvs
mailing list