MCPcopy Create free account
hub / github.com/MothCocoon/FlowGraph / CopySelectedNodes

Method CopySelectedNodes

Source/FlowEditor/Private/Graph/FlowGraphEditor.cpp:703–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703void SFlowGraphEditor::CopySelectedNodes() const
704{
705 // Export the selected nodes and place the text on the clipboard
706 FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes();
707 FGraphPanelSelectionSet NewSelectedNodes;
708
709 for (FGraphPanelSelectionSet::TIterator SelectedIter(SelectedNodes); SelectedIter; ++SelectedIter)
710 {
711 if (UFlowGraphNode* FlowGraphNode = Cast<UFlowGraphNode>(*SelectedIter))
712 {
713 constexpr int32 RootEdNodeParentIndex = INDEX_NONE;
714 PrepareFlowGraphNodeForCopy(*FlowGraphNode, RootEdNodeParentIndex, NewSelectedNodes);
715 }
716 else
717 {
718 NewSelectedNodes.Add(*SelectedIter);
719 }
720 }
721
722 FString ExportedText;
723
724 FEdGraphUtilities::ExportNodesToText(NewSelectedNodes, ExportedText);
725 FPlatformApplicationMisc::ClipboardCopy(*ExportedText);
726
727 for (FGraphPanelSelectionSet::TIterator SelectedIter(NewSelectedNodes); SelectedIter; ++SelectedIter)
728 {
729 if (UFlowGraphNode* FlowGraphNode = Cast<UFlowGraphNode>(*SelectedIter))
730 {
731 FlowGraphNode->PostCopyNode();
732 }
733 }
734}
735
736void SFlowGraphEditor::PrepareFlowGraphNodeForCopy(UFlowGraphNode& FlowGraphNode, const int32 ParentEdNodeIndex, FGraphPanelSelectionSet& NewSelectedNodes)
737{

Callers

nothing calls this directly

Calls 1

PostCopyNodeMethod · 0.80

Tested by

no test coverage detected