Commit: 288147334ce81cf0be533c15f3698b88ef7c63f3
Author: Lukas Tönne
Date:   Wed Apr 2 10:59:35 2014 +0200
https://developer.blender.org/rB288147334ce81cf0be533c15f3698b88ef7c63f3

Fix T39547: Toggling render passes on active scene does not update
render layer nodes in a pinned tree from different scene.

The way these updates work is a nasty legacy hack:
https://developer.blender.org/diffusion/B/browse/master/source/blender/nodes/composite/node_composite_tree.c$277

This function is called //very frequently// by the get_from_context
method. However, this does not get called for pinned node trees, so
when showing a different scene's compositing nodes in the editor they
may not get updated correctly.

Now moved this update call out of get_from_context so it happens in any
case. Will be called no more frequently than before (on every redraw).
Eventually the depsgraph should handle this more precisely, it's just a
simple ID dependency anyway ...

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

M       source/blender/editors/space_node/node_edit.c
M       source/blender/nodes/composite/node_composite_tree.c

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

diff --git a/source/blender/editors/space_node/node_edit.c 
b/source/blender/editors/space_node/node_edit.c
index ac0834c..7c5ffa5 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -586,6 +586,14 @@ void snode_set_context(const bContext *C)
        if (snode->nodetree != ntree || snode->id != id || snode->from != from) 
{
                ED_node_tree_start(snode, ntree, id, from);
        }
+       
+       /* XXX Legacy hack to update render layer node outputs.
+        * This should be handled by the depsgraph eventually ...
+        */
+       if (ED_node_is_compositor(snode) && snode->nodetree) {
+               /* update output sockets based on available layers */
+               ntreeCompositForceHidden(snode->nodetree);
+       }
 }
 
 void snode_update(SpaceNode *snode, bNode *node)
diff --git a/source/blender/nodes/composite/node_composite_tree.c 
b/source/blender/nodes/composite/node_composite_tree.c
index f3a99d9..a1bc369 100644
--- a/source/blender/nodes/composite/node_composite_tree.c
+++ b/source/blender/nodes/composite/node_composite_tree.c
@@ -72,10 +72,6 @@ static void composite_get_from_context(const bContext *C, 
bNodeTreeType *UNUSED(
        *r_from = NULL;
        *r_id = &scene->id;
        *r_ntree = scene->nodetree;
-       
-       /* update output sockets based on available layers */
-       ntreeCompositForceHidden(scene->nodetree);
-       
 }
 
 static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, 
bNodeClassCallback func)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to