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
This commit is contained in:
Alaska 2022-04-02 22:42:05 +02:00 committed by Lukas Stockner
parent a567bef5cc
commit 351c00d29a
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #96973, Light objects can NOT be added to light groups
Referenced by issue #78008, Cycles: Light Group render passes improvements
1 changed files with 10 additions and 2 deletions

View File

@ -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