diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-08 12:15:56 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-08-08 12:15:56 +0400 |
commit | 9ccb8b8c408707093fcfd888b0b1e92a83c79727 (patch) | |
tree | 686a8eaca6ab6cf1def23eb460d0c955f8f7efbb /source/blender/compositor/nodes | |
parent | 3179ee8a86fd147dbed37eefb1864326e7479cc3 (diff) |
Fix crash in cases when render layers node is muted
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r-- | source/blender/compositor/nodes/COM_MuteNode.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/compositor/nodes/COM_MuteNode.cpp b/source/blender/compositor/nodes/COM_MuteNode.cpp index 2c96473a556..eb2da147eca 100644 --- a/source/blender/compositor/nodes/COM_MuteNode.cpp +++ b/source/blender/compositor/nodes/COM_MuteNode.cpp @@ -110,6 +110,7 @@ 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(); SocketMap socketMap; ListBase intlinks; @@ -132,10 +133,37 @@ void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co else { createDefaultOutput(graph, toSocket); } + + relinkedsockets.push_back(toSocket); } } } + /* in some cases node could be marked as muted, but it wouldn't have internal connections + * this happens in such cases as muted render layer node + * + * to deal with such cases create default operation for not-relinked output sockets + */ + + for (unsigned int index = 0; index < outputsockets.size(); index++) { + OutputSocket *output = outputsockets[index]; + + if (output->isConnected()) { + bool relinked = false; + vector<OutputSocket *>::iterator it; + + for (it = relinkedsockets.begin(); it != relinkedsockets.end(); it++) { + if (*it == output) { + relinked = true; + break; + } + } + + if (!relinked) + createDefaultOutput(graph, output); + } + } + BLI_freelistN(&intlinks); } else { |