Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-30 13:46:14 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-30 13:46:14 +0400
commit585bc327e2609768e4f19ee07cee0bd0417ff47d (patch)
treed4b5ad168bf21c355360d8851727e306516b06ba /source/blender/compositor/nodes/COM_MuteNode.cpp
parent977188e3736db9442bc0c31aa1844d92c5119da0 (diff)
Fix incorrect connections for muted nodes in tile compositor
Not tile compositor would use the same routines to detect which links to add for muted node.
Diffstat (limited to 'source/blender/compositor/nodes/COM_MuteNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_MuteNode.cpp49
1 files changed, 43 insertions, 6 deletions
diff --git a/source/blender/compositor/nodes/COM_MuteNode.cpp b/source/blender/compositor/nodes/COM_MuteNode.cpp
index f52b7216cca..7b9dcf686fc 100644
--- a/source/blender/compositor/nodes/COM_MuteNode.cpp
+++ b/source/blender/compositor/nodes/COM_MuteNode.cpp
@@ -20,14 +20,16 @@
* Monique Dewanchand
*/
-#include <stdio.h>
-
#include "COM_MuteNode.h"
#include "COM_SocketConnection.h"
#include "COM_SetValueOperation.h"
#include "COM_SetVectorOperation.h"
#include "COM_SetColorOperation.h"
+extern "C" {
+ #include "BLI_listbase.h"
+}
+
MuteNode::MuteNode(bNode *editorNode) : Node(editorNode)
{
/* pass */
@@ -84,14 +86,49 @@ void MuteNode::reconnect(ExecutionSystem *graph, OutputSocket *output)
output->clearConnections();
}
+template<class SocketType> void MuteNode::fillSocketMap(vector<SocketType *> &sockets, SocketMap &socketMap)
+{
+ for (typename vector<SocketType *>::iterator it = sockets.begin(); it != sockets.end(); it++) {
+ Socket *socket = (Socket *) *it;
+
+ socketMap.insert(std::pair<bNodeSocket *, Socket *>(socket->getbNodeSocket(), socket));
+ }
+}
+
void MuteNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
+ bNode *editorNode = this->getbNode();
vector<OutputSocket *> &outputsockets = this->getOutputSockets();
- for (unsigned int index = 0; index < outputsockets.size(); index++) {
- OutputSocket *output = outputsockets[index];
- if (output->isConnected()) {
- reconnect(graph, output);
+ if (editorNode->typeinfo->internal_connect) {
+ vector<InputSocket *> &inputsockets = this->getInputSockets();
+ bNodeTree *editorTree = (bNodeTree *) context->getbNodeTree();
+ SocketMap socketMap;
+ ListBase intlinks;
+ bNodeLink *link;
+
+ intlinks = editorNode->typeinfo->internal_connect(editorTree, editorNode);
+
+ this->fillSocketMap<OutputSocket>(outputsockets, socketMap);
+ this->fillSocketMap<InputSocket>(inputsockets, socketMap);
+
+ for (link = (bNodeLink *) intlinks.first; link; link = link->next) {
+ if (link->fromnode == editorNode) {
+ InputSocket *fromSocket = (InputSocket *) socketMap.find(link->fromsock)->second;
+ OutputSocket *toSocket = (OutputSocket *) socketMap.find(link->tosock)->second;
+
+ toSocket->relinkConnections(fromSocket->getConnection()->getFromSocket(), false);
+ }
+ }
+
+ BLI_freelistN(&intlinks);
+ }
+ else {
+ for (unsigned int index = 0; index < outputsockets.size(); index++) {
+ OutputSocket *output = outputsockets[index];
+ if (output->isConnected()) {
+ reconnect(graph, output);
+ }
}
}
}