From 351c00d29ab1d41867bfbae77b92625e5bf442e6 Mon Sep 17 00:00:00 2001 From: Alaska Date: Sat, 2 Apr 2022 22:42:05 +0200 Subject: Fix T96973: Re-add Cycles shading menu to lights This patch re-adds the shading menu to lights to allow people to use lights in light groups. This patch also hides all settings in the shading menu that are not useful for the light object. Reviewed By: lukasstockner97 Maniphest Tasks: T96973 Differential Revision: https://developer.blender.org/D14527 --- intern/cycles/blender/addon/ui.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 621a5571f63..c97afa86fad 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1088,7 +1088,7 @@ class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel): return False ob = context.object - return ob and has_geometry_visibility(ob) and ob.type != 'LIGHT' + return ob and has_geometry_visibility(ob) def draw(self, context): pass @@ -1099,6 +1099,10 @@ class CYCLES_OBJECT_PT_shading_shadow_terminator(CyclesButtonsPanel, Panel): bl_parent_id = "CYCLES_OBJECT_PT_shading" bl_context = "object" + @classmethod + def poll(cls, context): + return context.object.type != 'LIGHT' + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -1116,6 +1120,10 @@ class CYCLES_OBJECT_PT_shading_gi_approximation(CyclesButtonsPanel, Panel): bl_parent_id = "CYCLES_OBJECT_PT_shading" bl_context = "object" + @classmethod + def poll(cls, context): + return context.object.type != 'LIGHT' + def draw(self, context): layout = self.layout layout.use_property_split = True @@ -1138,7 +1146,7 @@ class CYCLES_OBJECT_PT_shading_caustics(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and not use_metal(context) + return CyclesButtonsPanel.poll(context) and not use_metal(context) and context.object.type != 'LIGHT' def draw(self, context): layout = self.layout -- cgit v1.2.3