From 626ca4a2d53e8d855bbe09f9fc8b27980245eb82 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 8 Nov 2018 18:58:00 +0100 Subject: [PATCH] Fix X-Ray option showing in LookDev mode, where it does nothing. --- release/scripts/startup/bl_ui/space_view3d.py | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 81eeb567696..c01db5d1cca 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4158,6 +4158,11 @@ class VIEW3D_PT_shading_options(Panel): bl_label = "Options" bl_parent_id = 'VIEW3D_PT_shading' + @classmethod + def poll(cls, context): + shading = VIEW3D_PT_shading.get_shading(context) + return shading.type in {'WIREFRAME', 'SOLID'} + def draw(self, context): layout = self.layout @@ -4165,8 +4170,6 @@ class VIEW3D_PT_shading_options(Panel): col = layout.column() - is_shadows = shading.show_shadows - row = col.row() if shading.type == 'WIREFRAME': @@ -4174,18 +4177,17 @@ class VIEW3D_PT_shading_options(Panel): sub = row.row() sub.active = shading.show_xray_wireframe sub.prop(shading, "xray_alpha_wireframe", text="X-Ray") - else: + elif shading.type == 'SOLID': row.prop(shading, "show_xray", text="") sub = row.row() sub.active = shading.show_xray sub.prop(shading, "xray_alpha", text="X-Ray") - if shading.type == 'SOLID': row = col.row() row.prop(shading, "show_shadows", text="") row.active = not shading.show_xray sub = row.row(align=True) - sub.active = is_shadows + sub.active = shading.show_shadows sub.prop(shading, "shadow_intensity", text="Shadow") sub.popover( panel="VIEW3D_PT_shading_options_shadow", @@ -4209,16 +4211,15 @@ class VIEW3D_PT_shading_options(Panel): text="" ) - if shading.type in {'SOLID', 'WIREFRAME'}: - row = layout.split() - row.prop(shading, "show_object_outline") - sub = row.row() - sub.active = shading.show_object_outline - sub.prop(shading, "object_outline_color", text="") + row = layout.split() + row.prop(shading, "show_object_outline") + sub = row.row() + sub.active = shading.show_object_outline + sub.prop(shading, "object_outline_color", text="") - col = layout.column() - if (shading.light is not 'MATCAP') and (shading.type is not 'WIREFRAME'): - col.prop(shading, "show_specular_highlight") + col = layout.column() + if (shading.light is not 'MATCAP') and (shading.type is not 'WIREFRAME'): + col.prop(shading, "show_specular_highlight") class VIEW3D_PT_shading_options_shadow(Panel):