diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-30 20:39:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-30 20:39:39 +0400 |
commit | 9c35147666898c5272438636bfc515d749f901b1 (patch) | |
tree | 5aef6086e7c8f16f3b3ef53fc5234187811aef10 /source/blender/compositor | |
parent | 46ac23d04e528829e657c08e6c1d9c506455bb0b (diff) |
Fixed own regression introduced in recent compositor commit
MuteNode could be used as a replacement for other nodes when
using fast calculation or when using unknown node from blender.
Should work properly now.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/nodes/COM_MuteNode.cpp | 21 | ||||
-rw-r--r-- | source/blender/compositor/nodes/COM_MuteNode.h | 1 |
2 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/compositor/nodes/COM_MuteNode.cpp b/source/blender/compositor/nodes/COM_MuteNode.cpp index 7b9dcf686fc..2c96473a556 100644 --- a/source/blender/compositor/nodes/COM_MuteNode.cpp +++ b/source/blender/compositor/nodes/COM_MuteNode.cpp @@ -47,7 +47,12 @@ void MuteNode::reconnect(ExecutionSystem *graph, OutputSocket *output) } } } - + + createDefaultOutput(graph, output); +} + +void MuteNode::createDefaultOutput(ExecutionSystem *graph, OutputSocket *output) +{ NodeOperation *operation = NULL; switch (output->getDataType()) { case COM_DT_VALUE: @@ -100,7 +105,10 @@ void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co bNode *editorNode = this->getbNode(); vector<OutputSocket *> &outputsockets = this->getOutputSockets(); - if (editorNode->typeinfo->internal_connect) { + /* mute node is also used for unknown nodes and couple of nodes in fast mode + * can't use generic routines in that case + */ + if ((editorNode->flag & NODE_MUTED) && editorNode->typeinfo->internal_connect) { vector<InputSocket *> &inputsockets = this->getInputSockets(); bNodeTree *editorTree = (bNodeTree *) context->getbNodeTree(); SocketMap socketMap; @@ -117,7 +125,14 @@ void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co InputSocket *fromSocket = (InputSocket *) socketMap.find(link->fromsock)->second; OutputSocket *toSocket = (OutputSocket *) socketMap.find(link->tosock)->second; - toSocket->relinkConnections(fromSocket->getConnection()->getFromSocket(), false); + if (toSocket->isConnected()) { + if (fromSocket->isConnected()) { + toSocket->relinkConnections(fromSocket->getConnection()->getFromSocket(), false); + } + else { + createDefaultOutput(graph, toSocket); + } + } } } diff --git a/source/blender/compositor/nodes/COM_MuteNode.h b/source/blender/compositor/nodes/COM_MuteNode.h index 44fbe6e80c6..2e5250e625e 100644 --- a/source/blender/compositor/nodes/COM_MuteNode.h +++ b/source/blender/compositor/nodes/COM_MuteNode.h @@ -43,6 +43,7 @@ private: typedef std::map<bNodeSocket *, Socket *> SocketMap; void reconnect(ExecutionSystem *graph, OutputSocket *output); + void createDefaultOutput(ExecutionSystem *graph, OutputSocket *output); template<class SocketType> void fillSocketMap(vector<SocketType *> &sockets, SocketMap &socketMap); }; |