Fix T39848: Reroute nodes were not handled properly after compositor

cleanup patch.

These simply need a proxy node, which will be replaced by direct
operation links afterward.
This commit is contained in:
Lukas Tönne
2014-04-23 17:00:04 +02:00
parent 14ab812da5
commit ad6d897d98
2 changed files with 17 additions and 5 deletions

View File

@@ -134,12 +134,16 @@ void NodeGraph::add_bNode(const CompositorContext &context, bNodeTree *b_ntree,
/* special node types */
if (b_node->type == NODE_GROUP) {
add_proxies_group(context, b_node, key);
return;
}
Node *node = Converter::convert(b_node);
if (node)
add_node(node, b_ntree, key, is_active_group);
else if (b_node->type == NODE_REROUTE) {
add_proxies_reroute(b_ntree, b_node, key, is_active_group);
}
else {
/* regular nodes, handled in Converter */
Node *node = Converter::convert(b_node);
if (node)
add_node(node, b_ntree, key, is_active_group);
}
}
NodeInput *NodeGraph::find_input(const NodeRange &node_range, bNodeSocket *b_socket)
@@ -278,3 +282,9 @@ void NodeGraph::add_proxies_group(const CompositorContext &context, bNode *b_nod
add_bNodeTree(context, nodes_start, b_group_tree, key);
}
void NodeGraph::add_proxies_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group)
{
SocketProxyNode *proxy = new SocketProxyNode(b_node, (bNodeSocket *)b_node->inputs.first, (bNodeSocket *)b_node->outputs.first);
add_node(proxy, b_ntree, key, is_active_group);
}

View File

@@ -105,6 +105,8 @@ protected:
void add_proxies_group_outputs(bNode *b_node, bNode *b_node_io, bool use_buffer);
void add_proxies_group(const CompositorContext &context, bNode *b_node, bNodeInstanceKey key);
void add_proxies_reroute(bNodeTree *b_ntree, bNode *b_node, bNodeInstanceKey key, bool is_active_group);
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeGraph")
#endif