Commit: 351c00d29ab1d41867bfbae77b92625e5bf442e6
Author: Alaska
Date:   Sat Apr 2 22:42:05 2022 +0200
Branches: master
https://developer.blender.org/rB351c00d29ab1d41867bfbae77b92625e5bf442e6

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

===================================================================

M       intern/cycles/blender/addon/ui.py

===================================================================

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

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to