diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-29 18:04:51 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-29 18:04:51 +0400 |
commit | 36127e1255396776fab9d9abdf9bc5f8ba14c81a (patch) | |
tree | aa3a7a7f82fa551c53c0d9a06da2c57d1c58437a /source/blender/compositor/intern/COM_InputSocket.cpp | |
parent | 279de03fc52cc5859356d60be7f9330c4618e8d7 (diff) |
Added compositor graph functions for removing socket connections explicitly in convertToOperations. The InputSocket->unlink function should only be used in combination with relinkConnectionsDuplicate, in which case the original node connection will still exist. This would trigger an assert failure, so the original connection should be removed. Only node using this atm is the channel separation node, but will be needed for future group nodes too.
Diffstat (limited to 'source/blender/compositor/intern/COM_InputSocket.cpp')
-rw-r--r-- | source/blender/compositor/intern/COM_InputSocket.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_InputSocket.cpp b/source/blender/compositor/intern/COM_InputSocket.cpp index a9c280e0367..2493d4e5a27 100644 --- a/source/blender/compositor/intern/COM_InputSocket.cpp +++ b/source/blender/compositor/intern/COM_InputSocket.cpp @@ -122,6 +122,17 @@ void InputSocket::relinkConnections(InputSocket *relinkToSocket, int editorNode } } +void InputSocket::unlinkConnections(ExecutionSystem *system) +{ + SocketConnection *connection = getConnection(); + if (connection) { + system->removeSocketConnection(connection); + connection->getFromSocket()->removeConnection(connection); + setConnection(NULL); + delete connection; + } +} + bool InputSocket::isStatic() { if (isConnected()) { |