[Bf-blender-cvs] [80811aa5813] override-recursive-resync: Fix T88515: Cycles does not update light transform from linked collections

Kévin Dietrich noreply at git.blender.org
Mon Jun 14 16:35:01 CEST 2021


Commit: 80811aa581361b3a03df9c1b84af70218847f188
Author: Kévin Dietrich
Date:   Tue Jun 8 10:17:07 2021 +0200
Branches: override-recursive-resync
https://developer.blender.org/rB80811aa581361b3a03df9c1b84af70218847f188

Fix T88515: Cycles does not update light transform from linked collections

When moving a linked collection, we seem to only receive a depsgraph update
for an empty object so the Blender synchronization cannot discriminate it
and tag the object(s) (light or geometry) for an update through
id_map.set_recalc.

This missing transform update only affects lights since we do not check
manually if the transformations were modified like we do for objects.

To fix this, add a check to see if the transformation is different provided
that a light was already created.

Reviewed By: brecht

Maniphest Tasks: T88515

Differential Revision: https://developer.blender.org/D11574

===================================================================

M	intern/cycles/blender/blender_light.cpp

===================================================================

diff --git a/intern/cycles/blender/blender_light.cpp b/intern/cycles/blender/blender_light.cpp
index 283ed7d0adc..ae353b32633 100644
--- a/intern/cycles/blender/blender_light.cpp
+++ b/intern/cycles/blender/blender_light.cpp
@@ -34,12 +34,17 @@ void BlenderSync::sync_light(BL::Object &b_parent,
                              bool *use_portal)
 {
   /* test if we need to sync */
-  Light *light;
   ObjectKey key(b_parent, persistent_id, b_ob_instance, false);
   BL::Light b_light(b_ob.data());
 
+  Light *light = light_map.find(key);
+
+  /* Check if the transform was modified, in case a linked collection is moved we do not get a
+   * specific depsgraph update (T88515). This also mimics the behavior for Objects. */
+  const bool tfm_updated = (light && light->get_tfm() != tfm);
+
   /* Update if either object or light data changed. */
-  if (!light_map.add_or_update(&light, b_ob, b_parent, key)) {
+  if (!tfm_updated && !light_map.add_or_update(&light, b_ob, b_parent, key)) {
     Shader *shader;
     if (!shader_map.add_or_update(&shader, b_light)) {
       if (light->get_is_portal())



More information about the Bf-blender-cvs mailing list