MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / copyNodesInternal

Method copyNodesInternal

Gui/NodeGraphPrivate.cpp:194–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void
195NodeGraphPrivate::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
225NATRON_NAMESPACE_EXIT

Callers 4

copyNodesMethod · 0.80
copySelectedNodesMethod · 0.80

Calls 9

clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
isVisibleMethod · 0.45
getNodeMethod · 0.45
serializeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected