From ad35453cd19b3db779b0b3a90feac2e93c7a73cf Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Sat, 2 Apr 2022 00:11:11 +0200 Subject: Cycles: Add support for light groups Light groups are a type of pass that only contains lighting from a subset of light sources. They are created in the View layer, and light sources (lamps, objects with emissive materials and/or the environment) can be assigned to a group. Currently, each light group ends up generating its own version of the Combined pass. In the future, additional types of passes (e.g. shadowcatcher) might be getting their own per-lightgroup versions. The lightgroup creation and assignment is not Cycles-specific, so Eevee or external render engines could make use of it in the future. Note that Lightgroups are identified by their name - therefore, the name of the Lightgroup in the View Layer and the name that's set in an object's settings must match for it to be included. Currently, changing a Lightgroup's name does not update objects - this is planned for the future, along with other features such as denoising for light groups and viewing them in preview renders. Original patch by Alex Fuller (@mistaed), with some polishing by Lukas Stockner (@lukasstockner97). Differential Revision: https://developer.blender.org/D12871 --- .../scripts/startup/bl_ui/properties_view_layer.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'release/scripts/startup/bl_ui') diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py index 4dee7b73faf..83e797583ad 100644 --- a/release/scripts/startup/bl_ui/properties_view_layer.py +++ b/release/scripts/startup/bl_ui/properties_view_layer.py @@ -187,6 +187,33 @@ class VIEWLAYER_PT_layer_passes_cryptomatte(ViewLayerCryptomattePanel, Panel): COMPAT_ENGINES = {'BLENDER_EEVEE'} +class ViewLayerLightgroupsPanel(ViewLayerButtonsPanel, Panel): + bl_label = "Light Groups" + + def draw(self, context): + layout = self.layout + + layout.use_property_split = True + layout.use_property_decorate = False + + view_layer = context.view_layer + + row = layout.row() + col = row.column() + col.template_list("UI_UL_list", "lightgroups", view_layer, + "lightgroups", view_layer, "active_lightgroup_index", rows=2) + + col = row.column() + sub = col.column(align=True) + sub.operator("scene.view_layer_add_lightgroup", icon='ADD', text="") + sub.operator("scene.view_layer_remove_lightgroup", icon='REMOVE', text="") + + +class VIEWLAYER_PT_layer_passes_lightgroups(ViewLayerLightgroupsPanel): + bl_parent_id = "VIEWLAYER_PT_layer_passes" + COMPAT_ENGINES = {'CYCLES'} + + classes = ( VIEWLAYER_PT_layer, VIEWLAYER_PT_layer_passes, @@ -195,6 +222,7 @@ classes = ( VIEWLAYER_PT_eevee_layer_passes_effects, VIEWLAYER_PT_layer_passes_cryptomatte, VIEWLAYER_PT_layer_passes_aov, + VIEWLAYER_PT_layer_passes_lightgroups, VIEWLAYER_UL_aov, ) -- cgit v1.2.3