Fix #146377: Light groups not updating with persistent data enabled

This feature is not used for viewport rendering, so a missing update
is not visible there. But for persistent data the depsgraph tag is required.

Pull Request: https://projects.blender.org/blender/blender/pulls/154271
This commit is contained in:
Brecht Van Lommel 2026-02-12 15:00:55 +01:00 • committed by Brecht Van Lommel
parent 62a604bb54
commit e580ddf160
3 changed files with 4 additions and 2 deletions

View file

@ -124,10 +124,10 @@ void BlenderSync::sync_background_light(blender::bScreen *b_screen, blender::Vie
if (update) {
/* Lights should be shadow catchers by default. */
object->set_is_shadow_catcher(true);
object->set_lightgroup(
ustring((b_world && b_world->lightgroup) ? b_world->lightgroup->name : ""));
}
object->set_lightgroup(
ustring((b_world && b_world->lightgroup) ? b_world->lightgroup->name : ""));
object->set_asset_name(ustring(b_world->id.name + 2));
/* Create geometry. */

View file

@ -3724,6 +3724,7 @@ static void rna_def_object(BlenderRNA *brna)
"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_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
/* Light Linking. */
prop = RNA_def_property(srna, "light_linking", PROP_POINTER, PROP_NONE);

View file

@ -280,6 +280,7 @@ void RNA_def_world(BlenderRNA *brna)
prop, "rna_World_lightgroup_get", "rna_World_lightgroup_length", "rna_World_lightgroup_set");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Lightgroup", "Lightgroup that the world belongs to");
RNA_def_property_update(prop, 0, "rna_World_draw_update");
/* Reflection Probe Baking. */
prop = RNA_def_property(srna, "probe_resolution", PROP_ENUM, PROP_NONE);