diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-05-04 22:20:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-05-04 22:23:18 +0300 |
commit | f11dba88923f1710ef35eef61ea297800f718ce9 (patch) | |
tree | cff8acb1ba74b0ea8ce54d466ee5f39c5c03ef3f /intern | |
parent | 0fa1c65ee30d5a9e742ab313de440d44424e427e (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 53 |
1 files changed, 35 insertions, 18 deletions
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, |