| 192 | } |
| 193 | |
| 194 | void |
| 195 | NodeGraphPrivate::copyNodesInternal(const NodesGuiList& selection, |
| 196 | NodeClipBoard & clipboard) |
| 197 | { |
| 198 | ///Clear clipboard |
| 199 | clipboard.nodes.clear(); |
| 200 | clipboard.nodesUI.clear(); |
| 201 | |
| 202 | NodesGuiList nodesToCopy = selection; |
| 203 | for (NodesGuiList::iterator it = nodesToCopy.begin(); it != nodesToCopy.end(); ++it) { |
| 204 | ///Also copy all nodes within the backdrop |
| 205 | NodesGuiList nodesWithinBD = _publicInterface->getNodesWithinBackdrop(*it); |
| 206 | for (NodesGuiList::iterator it2 = nodesWithinBD.begin(); it2 != nodesWithinBD.end(); ++it2) { |
| 207 | NodesGuiList::iterator found = std::find(nodesToCopy.begin(), nodesToCopy.end(), *it2); |
| 208 | if ( found == nodesToCopy.end() ) { |
| 209 | nodesToCopy.push_back(*it2); |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | for (NodesGuiList::iterator it = nodesToCopy.begin(); it != nodesToCopy.end(); ++it) { |
| 215 | if ( (*it)->isVisible() ) { |
| 216 | NodeSerializationPtr ns( new NodeSerialization( (*it)->getNode(), true ) ); |
| 217 | NodeGuiSerializationPtr nGuiS = std::make_shared<NodeGuiSerialization>(); |
| 218 | (*it)->serialize( nGuiS.get() ); |
| 219 | clipboard.nodes.push_back(ns); |
| 220 | clipboard.nodesUI.push_back(nGuiS); |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | NATRON_NAMESPACE_EXIT |
no test coverage detected