Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2022-04-02 01:11:11 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2022-04-02 07:14:27 +0300
commitad35453cd19b3db779b0b3a90feac2e93c7a73cf (patch)
tree3ad7893815bda3e34e18302422ad1f978e828603 /source/blender/makesrna/intern/rna_object.c
parent5387d33e5f954c4cecdb7ffd3d1042d8632d6c15 (diff)
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index e4495df36f1..f995ee3383e 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2292,6 +2292,21 @@ static int rna_Object_mesh_symmetry_yz_editable(PointerRNA *ptr, const char **UN
return PROP_EDITABLE;
}
+void rna_Object_lightgroup_get(PointerRNA *ptr, char *value)
+{
+ BKE_lightgroup_membership_get(((Object *)ptr->owner_id)->lightgroup, value);
+}
+
+int rna_Object_lightgroup_length(PointerRNA *ptr)
+{
+ return BKE_lightgroup_membership_length(((Object *)ptr->owner_id)->lightgroup);
+}
+
+void rna_Object_lightgroup_set(PointerRNA *ptr, const char *value)
+{
+ BKE_lightgroup_membership_set(&((Object *)ptr->owner_id)->lightgroup, value);
+}
+
#else
static void rna_def_vertex_group(BlenderRNA *brna)
@@ -3775,6 +3790,15 @@ static void rna_def_object(BlenderRNA *brna)
RNA_def_property_editable_func(prop, "rna_Object_mesh_symmetry_yz_editable");
RNA_def_property_ui_text(prop, "Z", "Enable mesh symmetry in the Z axis");
+ /* Lightgroup Membership */
+ prop = RNA_def_property(srna, "lightgroup", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop,
+ "rna_Object_lightgroup_get",
+ "rna_Object_lightgroup_length",
+ "rna_Object_lightgroup_set");
+ RNA_def_property_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Lightgroup", "Lightgroup that the object belongs to");
+
RNA_define_lib_overridable(false);
/* anim */