From f11dba88923f1710ef35eef61ea297800f718ce9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 4 May 2022 21:20:17 +0200 Subject: Fix Cycles world light group confusing UI Move to a subpanel of the Settings panel. Otherwise it seems like it's a setting of one of the shader nodes. --- intern/cycles/blender/addon/ui.py | 53 ++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'intern') diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 131b849a094..886f5345020 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1446,28 +1446,10 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel): layout.use_property_split = True world = context.world - view_layer = context.view_layer if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'): layout.prop(world, "color") - row = layout.row(align=True) - row.use_property_decorate = False - - sub = row.column(align=True) - sub.prop_search( - world, - "lightgroup", - view_layer, - "lightgroups", - text="Light Group", - results_are_suggestions=True, - ) - - sub = row.column(align=True) - sub.active = bool(world.lightgroup) and not any(lg.name == world.lightgroup for lg in view_layer.lightgroups) - sub.operator("scene.view_layer_add_lightgroup", icon='ADD', text="").name = world.lightgroup - class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel): bl_label = "Volume" @@ -1616,6 +1598,40 @@ class CYCLES_WORLD_PT_settings_volume(CyclesButtonsPanel, Panel): sub.prop(cworld, "volume_step_size") +class CYCLES_WORLD_PT_settings_light_group(CyclesButtonsPanel, Panel): + bl_label = "Light Group" + bl_parent_id = "CYCLES_WORLD_PT_settings" + bl_context = "world" + + @classmethod + def poll(cls, context): + return context.world and CyclesButtonsPanel.poll(context) + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + world = context.world + view_layer = context.view_layer + + row = layout.row(align=True) + + sub = row.column(align=True) + sub.prop_search( + world, + "lightgroup", + view_layer, + "lightgroups", + text="Light Group", + results_are_suggestions=True, + ) + + sub = row.column(align=True) + sub.active = bool(world.lightgroup) and not any(lg.name == world.lightgroup for lg in view_layer.lightgroups) + sub.operator("scene.view_layer_add_lightgroup", icon='ADD', text="").name = world.lightgroup + + class CYCLES_MATERIAL_PT_preview(CyclesButtonsPanel, Panel): bl_label = "Preview" bl_context = "material" @@ -2308,6 +2324,7 @@ classes = ( CYCLES_WORLD_PT_settings, CYCLES_WORLD_PT_settings_surface, CYCLES_WORLD_PT_settings_volume, + CYCLES_WORLD_PT_settings_light_group, CYCLES_MATERIAL_PT_preview, CYCLES_MATERIAL_PT_surface, CYCLES_MATERIAL_PT_volume, -- cgit v1.2.3