From 41bb0548b0c1ac62d30cf14fca371b220e40f72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 25 May 2020 10:07:10 +0200 Subject: Fix T76897: Lamp Power Not Updating from Driver Lamps were not tagged with `ID_RECALC_SHADING` when they were updated from drivers. As a result, Cycles considered the lamp as unchanged. This is resolved by having a (seemingly non-functional) callback in a new `LIGHT_UPDATE` depsgraph node. This patch unconditionally adds the `LIGHT_UPDATE` node + the relation from the lamp's PARAMETERS node. Differential Revision: https://developer.blender.org/D7822 Reviewed by: brecht --- source/blender/blenkernel/BKE_light.h | 3 +++ source/blender/blenkernel/intern/light.c | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/BKE_light.h b/source/blender/blenkernel/BKE_light.h index a6f0fdbc8a3..2764233bc68 100644 --- a/source/blender/blenkernel/BKE_light.h +++ b/source/blender/blenkernel/BKE_light.h @@ -30,6 +30,7 @@ extern "C" { #include "BLI_compiler_attrs.h" +struct Depsgraph; struct Light; struct Main; @@ -37,6 +38,8 @@ struct Light *BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUS struct Light *BKE_light_copy(struct Main *bmain, const struct Light *la) ATTR_WARN_UNUSED_RESULT; struct Light *BKE_light_localize(struct Light *la) ATTR_WARN_UNUSED_RESULT; +void BKE_light_eval(struct Depsgraph *depsgraph, struct Light *la); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/light.c b/source/blender/blenkernel/intern/light.c index 3d0503b2e70..58d50787c9f 100644 --- a/source/blender/blenkernel/intern/light.c +++ b/source/blender/blenkernel/intern/light.c @@ -47,6 +47,8 @@ #include "BLT_translation.h" +#include "DEG_depsgraph.h" + static void light_init_data(ID *id) { Light *la = (Light *)id; @@ -167,3 +169,8 @@ Light *BKE_light_localize(Light *la) return lan; } + +void BKE_light_eval(struct Depsgraph *depsgraph, Light *la) +{ + DEG_debug_print_eval(depsgraph, __func__, la->id.name, la); +} -- cgit v1.2.3