Depsgraph: Fix missing relation from node tree to light
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Jan 2019 15:17:53 +0000 (16:17 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 4 Jan 2019 15:17:53 +0000 (16:17 +0100)
Was only happening when lamp had driver on the Light datablock.

Reported by Dalai Felinto in T60137.

source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

index 04f3898..29a31ef 100644 (file)
@@ -1442,6 +1442,11 @@ void DepsgraphNodeBuilder::build_lamp(Lamp *lamp)
                                     DEG_NODE_TYPE_PARAMETERS,
                                     NULL,
                                     DEG_OPCODE_PARAMETERS_EVAL);
+       /* NOTE: We mark this node as both entry and exit. This way we have a
+        * node to link all dependencies for shading (which includes relation to the
+        * lamp object, and incldues relation from node tree) without adding a
+        * dedicated component type. */
+       op_node->set_as_entry();
        op_node->set_as_exit();
        /* lamp's nodetree */
        build_nodetree(lamp->nodetree);