From d4f06e926adf6e6c2460e7057930a99c62afb19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20S=C3=B6nnichsen?= Date: Thu, 25 Dec 2025 22:55:47 +0100 Subject: [PATCH] Added virtual method to allow saving non-executing flow nodes --- Source/Flow/Private/FlowAsset.cpp | 2 +- Source/Flow/Private/Nodes/FlowNode.cpp | 5 +++++ Source/Flow/Public/Nodes/FlowNode.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Flow/Private/FlowAsset.cpp b/Source/Flow/Private/FlowAsset.cpp index 521ed3e36..d46a091d8 100644 --- a/Source/Flow/Private/FlowAsset.cpp +++ b/Source/Flow/Private/FlowAsset.cpp @@ -1399,7 +1399,7 @@ FFlowAssetSaveData UFlowAsset::SaveInstance(TArray& SavedFlo GetNodesInExecutionOrder(GetDefaultEntryNode(), NodesInExecutionOrder); for (UFlowNode* Node : NodesInExecutionOrder) { - if (Node && Node->ActivationState == EFlowNodeState::Active) + if (Node && Node->ShouldSave()) { // iterate SubGraphs if (UFlowNode_SubGraph* SubGraphNode = Cast(Node)) diff --git a/Source/Flow/Private/Nodes/FlowNode.cpp b/Source/Flow/Private/Nodes/FlowNode.cpp index 048339277..76a8895d5 100644 --- a/Source/Flow/Private/Nodes/FlowNode.cpp +++ b/Source/Flow/Private/Nodes/FlowNode.cpp @@ -991,6 +991,11 @@ void UFlowNode::OnPassThrough_Implementation() Finish(); } +bool UFlowNode::ShouldSave_Implementation() +{ + return GetActivationState() == EFlowNodeState::Active; +} + #if WITH_EDITOR TMap UFlowNode::GetWireRecords() const { diff --git a/Source/Flow/Public/Nodes/FlowNode.h b/Source/Flow/Public/Nodes/FlowNode.h index b9da34695..6f832b7e1 100644 --- a/Source/Flow/Public/Nodes/FlowNode.h +++ b/Source/Flow/Public/Nodes/FlowNode.h @@ -368,6 +368,9 @@ class FLOW_API UFlowNode UFUNCTION(BlueprintNativeEvent, Category = "FlowNode") void OnPassThrough(); + + UFUNCTION(BlueprintNativeEvent, Category = "FlowNode") + bool ShouldSave(); ////////////////////////////////////////////////////////////////////////// // Utils