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

Method AddSubNode

Source/FlowEditor/Private/Graph/Nodes/FlowGraphNode.cpp:1541–1573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1539}
1540
1541void UFlowGraphNode::AddSubNode(UFlowGraphNode* SubNode, class UEdGraph* ParentGraph)
1542{
1543 const FScopedTransaction Transaction(LOCTEXT("AddNode", "Add Node"));
1544 ParentGraph->Modify();
1545 Modify();
1546
1547 SubNode->SetFlags(RF_Transactional);
1548
1549 // set outer to be the graph so it doesn't go away
1550 SubNode->Rename(nullptr, ParentGraph, REN_NonTransactional);
1551 SubNode->SetParentNodeForSubNode(this);
1552
1553 SubNode->CreateNewGuid();
1554 SubNode->PostPlacedNewNode();
1555
1556 SubNode->AllocateDefaultPins();
1557 SubNode->AutowireNewNode(nullptr);
1558
1559 SubNode->NodePosX = 0;
1560 SubNode->NodePosY = 0;
1561
1562 SubNodes.Add(SubNode);
1563 if (SubNode->NodeInstance)
1564 {
1565 SubNode->NodeInstance->OnAddOnRequestedParentReconstruction.BindUObject(this, &UFlowGraphNode::OnExternalChange);
1566 }
1567 OnSubNodeAdded(SubNode);
1568
1569 ParentGraph->NotifyGraphChanged();
1570 GetFlowGraph()->UpdateAsset();
1571
1572 // NOTE - We do not need to RebuildRuntimeAddOnsFromEditorSubNodes here, because UpdateAsset() will do it
1573}
1574
1575void UFlowGraphNode::OnSubNodeAdded(UFlowGraphNode* SubNode)
1576{

Callers 3

PerformActionMethod · 0.45
RecreateNodeMethod · 0.45
PasteNodesHereMethod · 0.45

Calls 7

GetFlowGraphFunction · 0.85
PostPlacedNewNodeMethod · 0.80
AllocateDefaultPinsMethod · 0.80
AutowireNewNodeMethod · 0.80
NotifyGraphChangedMethod · 0.80
UpdateAssetMethod · 0.80

Tested by

no test coverage detected