Compositor:

*  Node muting in node groups didn't work.

[#32597] Mute one node in a group blocks it

It looked for connections in the main tree, and not inside the group.
This commit is contained in:
Jeroen Bakker 2012-09-25 13:02:52 +00:00
parent ed47d89d7f
commit b25cce1430
3 changed files with 18 additions and 2 deletions

@ -49,7 +49,8 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star
/* add all nodes of the tree to the node list */
bNode *node = (bNode *)tree->nodes.first;
while (node != NULL) {
addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
Node *nnode = addNode(nodes, node, isActiveGroup, system.getContext().isFastCalculation());
nnode->setbNodeGroup(groupnode);
node = (bNode *)node->next;
}

@ -53,6 +53,12 @@ private:
* @brief Is this node part of the active group
*/
bool m_inActiveGroup;
/**
* @brief The group node this node belongs to.
* @note: used to find the links in the current subtree for muting nodes
*/
bNode* m_bNodeGroup;
public:
Node(bNode *editorNode, bool create_sockets = true);
@ -134,6 +140,9 @@ public:
* @param socket
*/
OutputSocket *findOutputSocketBybNodeSocket(bNodeSocket *socket);
inline void setbNodeGroup(bNode* group) {this->m_bNodeGroup = group;}
inline bNode* getbNodeGroup() {return this->m_bNodeGroup;}
protected:
void addPreviewOperation(ExecutionSystem *system, CompositorContext *context, InputSocket *inputSocket);
void addPreviewOperation(ExecutionSystem *system, CompositorContext *context, OutputSocket *outputSocket);

@ -111,11 +111,17 @@ void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
if ((editorNode->flag & NODE_MUTED) && editorNode->typeinfo->internal_connect) {
vector<InputSocket *> &inputsockets = this->getInputSockets();
vector<OutputSocket *> relinkedsockets;
bNodeTree *editorTree = (bNodeTree *) context->getbNodeTree();
bNodeTree *editorTree;
SocketMap socketMap;
ListBase intlinks;
bNodeLink *link;
if (this->getbNodeGroup()) {
editorTree = (bNodeTree *) getbNodeGroup()->id;
} else {
editorTree = (bNodeTree *) context->getbNodeTree();
}
intlinks = editorNode->typeinfo->internal_connect(editorTree, editorNode);
this->fillSocketMap<OutputSocket>(outputsockets, socketMap);