MeshAnalysis: Disable when XRay is turned on

When XRay is turned on the mesh analysis did not draw correct. This
change won't draw the mesh analysis overlay when xray is turned on.

In terms of giving the user a visual feedback of this limitation we
render the overlay options inactive.

Reviewed By: brecht, fclem

Maniphest Tasks: T65225

Differential Revision: https://developer.blender.org/D4965
This commit is contained in:
2019-05-28 13:00:40 +02:00
parent 94370e23e9
commit dee5c1aa40
3 changed files with 14 additions and 4 deletions

View File

@@ -5557,6 +5557,7 @@ class VIEW3D_PT_overlay_edit_mesh_shading(Panel):
layout = self.layout
view = context.space_data
shading = view.shading
overlay = view.overlay
tool_settings = context.tool_settings
display_all = overlay.show_overlays
@@ -5574,12 +5575,21 @@ class VIEW3D_PT_overlay_edit_mesh_shading(Panel):
sub = row.row()
sub.prop(tool_settings, "vertex_group_user", expand=True)
col.prop(overlay, "show_statvis", text="Mesh Analysis")
if shading.type == 'WIREFRAME':
xray = shading.show_xray_wireframe and shading.xray_alpha_wireframe < 1.0
elif shading.type == 'SOLID':
xray = shading.show_xray and shading.xray_alpha < 1.0
else:
xray = False
statvis_active = not xray
row = col.row()
row.active = statvis_active
row.prop(overlay, "show_statvis", text="Mesh Analysis")
if overlay.show_statvis:
col = col.column()
col.active = statvis_active
sub = col.split()
sub.active = overlay.show_statvis
sub.label(text="Type")
sub.prop(statvis, "type", text="")