-
Notifications
You must be signed in to change notification settings - Fork 325
Flow graph data pins refactor #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x
Are you sure you want to change the base?
Flow graph data pins refactor #313
Conversation
LindyHopperGT
commented
Dec 11, 2025
- Incremented UFlowGraph::GraphVersion to 2, created a data migration function (UpgradeAllFlowNodePins)
- FlowPinType namespace templates for the bulk of the "Supply/Resolve" pipeline support for data pins
- Updated standard FFlowPinType and FFlowDataPinValue subclasses to use them with the new resolve pipeline
- Reworked FlowSchema's pin compatibility checks to be more orderly, simpler and data-driven connectivity
- Created policies for schema connectivity rules for the standard types
- Updated FFlowNamedDataPinProperty to use FFlowDataPinValue as its property payload (including migrate functions from the old data)
- Updated FlowDataPinBlueprintLibrary with new auto-converts and functions to support data pin manipulation in blueprint
- Updated FlowNodeBase with the new Resolve pathway entry points & related refactors
- Updated FlowNode with the new Supply pathway entry points & related refactors
- Updated FlowPin to deprecateEnum PinType and add ContainerType (for Array data pins) and PinTypeName (the replacement for PinType Enum)
- Removed overrides TrySupplyDataPinAs... (now replaced by general version)
- Removed TrySupplyDataPinAs... variants from the IFlowDataPinValueSupplierInterface (leaving only the general replacement)
- Ported TryResolveDataPinAs... specialized versions to use the general version internally
- Adapted uses of TryResolveDataPinAs... to the general version TryResolveDataPin
- FlowNode (and AddOn) details customizations now inherit from TFlowDataPinValueOwnerCustomization, which adds a RequestRebuild() for rebuilding flow node details in a way that correctly rebuilds the FFlowDataPinValue customizations
- Refactored FlowAsset's automatic pin generation mechanism to be more clean, simple and work with the new system
- Details customizations for FFlowDataPinValue & specific subclasses
- Details customization for IFlowDataPinValueOwnerInterface implementers (via template)
- Added some details customization rebuild hooks into IFlowDataPinValueOwnerInterface to support FFlowDataPinValue details rebuilding
- Updated some flow nodes to use new Resolve functions (eg, Log, DefineProperties, Start, FormatText, etc.)
- Reworked FFlowPinSubsystem's api slightly
- Created new test classes and assets in FlowGraph_DataPinsTest
FlowAssetParams are a new data asset, that is optionally managed by the FlowAsset, sourcing properties from the Start node of the graph. These params can be subclassed to create overrides. At runtime, either the base or a compatible subclass may be used to provide data for start data pins in the flow graph. - Added FlowAssetParams - Added support to FlowAsset to optionally create and sync with FlowAssetParams base - Added AssetDefinition_FlorAssetParams to add 'create child', for creating 'subclassed' params that override some elements - Updated FFlowNamedDataPinProperty to have Guid and other properties used in the FlowAssetParams use-case - Added FlowNamedPropertiesSupplierInterface - Added FlowAssetProviderInterface - FFlowAssetParamsPtr - wrapper class for details customization - Added Params support to FlowComponent & FlowSubsystem Also: - Removed stale references to IFlowOwnerInterface - Merged over some deltas from IFlowExtended/Curated Property Customization
Each of our existing FFlowDataPinProperty* classes adapted to FFlowDataPinValue* (and details customization) & FFlowDataPinType* classes These new wrappers implement IsInputPin as a configurable and add Array support (in anticipation of Flow Data Pin array support) Added registration subsystem for these types (which registers the standard types) These are not used yet, but they will be later in the refactor
Flow: Incremented UFlowGraph::GraphVersion to 2, created a data migration function (UpgradeAllFlowNodePins) FlowPinType namespace templates for the bulk of the "Supply/Resolve" pipeline support for data pins Updated standard FFlowPinType and FFlowDataPinValue subclasses to use them with the new resolve pipeline Reworked FlowSchema's pin compatibility checks to be more orderly, simpler and data-driven connectivity Created policies for schema connectivity rules for the standard types Updated FFlowNamedDataPinProperty to use FFlowDataPinValue as its property payload (including migrate functions from the old data) Updated FlowDataPinBlueprintLibrary with new auto-converts and functions to support data pin manipulation in blueprint Updated FlowNodeBase with the new Resolve pathway entry points & related refactors Updated FlowNode with the new Supply pathway entry points & related refactors Updated FlowPin to deprecateEnum PinType and add ContainerType (for Array data pins) and PinTypeName (the replacement for PinType Enum) Removed overrides TrySupplyDataPinAs... (now replaced by general version) Removed TrySupplyDataPinAs... variants from the IFlowDataPinValueSupplierInterface (leaving only the general replacement) Ported TryResolveDataPinAs... specialized versions to use the general version internally Adapted uses of TryResolveDataPinAs... to the general version TryResolveDataPin FlowNode (and AddOn) details customizations now inherit from TFlowDataPinValueOwnerCustomization, which adds a RequestRebuild() for rebuilding flow node details in a way that correctly rebuilds the FFlowDataPinValue customizations Refactored FlowAsset's automatic pin generation mechanism to be more clean, simple and work with the new system Details customizations for FFlowDataPinValue & specific subclasses Details customization for IFlowDataPinValueOwnerInterface implementers (via template) Added some details customization rebuild hooks into IFlowDataPinValueOwnerInterface to support FFlowDataPinValue details rebuilding Updated some flow nodes to use new Resolve functions (eg, Log, DefineProperties, Start, FormatText, etc.) Reworked FFlowPinSubsystem's api slightly Created new test classes and assets in FlowGraph_DataPinsTest AIFlow: Added FlowBlackboardEntry subclasses for ActorArray and LocationArray Updated all of the UFlowBlackboardEntryValue classes to use FFlowDataPinValue api's Updated SetBlackboardValues/SetBlackboardValuesOnActor to minimally function, and deprecated them Introduced combined and updated SetBlackboardValuesV2 replacement for the former SetBlackboardValues* nodes Updated GetBlackboardValues to work with the new APIs
LindyHopperGT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review comments to guide readers through the review.
| "MarketplaceURL" : "", | ||
| "SupportURL": "https://discord.gg/Xmtr6GhbmW", | ||
| "EnabledByDefault" : true, | ||
| "EnabledByDefault" : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added by our central tech team, who didn't want Flow to be enabled by default, even if it was a part of our central tech plugins bundle.
| "GraphEditor", | ||
| "MessageLog", | ||
| "UnrealEd" | ||
| "PropertyEditor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the new Details Customization support needs to live in Flow Plugin proper, because that's where the code is, so the editor builds need these additional dependencies
| #include UE_INLINE_GENERATED_CPP_BY_NAME(FlowAssetParams) | ||
|
|
||
| #if WITH_EDITOR | ||
| void UFlowAssetParams::PostLoad() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlowAssetParams are an experimental feature at this point. They are just being started to be used internally, and may see some adjustments/changes/fixes in follow-up PR's in 2026.
Can start playing with them now, but be aware of their status.
| return false; | ||
| } | ||
|
|
||
| bool UFlowAsset::TryUpdateManagedFlowPinsForNode(UFlowNode& FlowNode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we start getting into the data pin refactor changes.
This function replaces the old HarvestDataPins system. it's been cleaned-up, simplified and modernized.
Some of the 'stuff' embedded in the old code has moved into FFlowPinType and other functions of the data pins core code.
| FFlowPin& NewFlowPin = InOutDataPinsNext->Add_GetRef(FFlowPin(PinAuthoredName, PinDisplayName)); | ||
| switch (PinType) | ||
| { | ||
| case EFlowPinType::Enum: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this pin creation code is handled now by FFlowPinType functions
|
|
||
| BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION | ||
|
|
||
| void SFlowDiff::Construct(const FArguments& InArgs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some Diff improvements we made
| #include "DetailCustomizations/FlowDataPinPropertyCustomizationBase.h" | ||
| #include "DetailWidgetRow.h" | ||
|
|
||
| void FFlowDataPinPropertyCustomizationBase::CustomizeHeader(TSharedRef<IPropertyHandle> InStructPropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are preseving the old property wrappers for now. but I went ahead and killed their old details customizations. so they will exist, but not be fancy.
|
|
||
| class IFlowDataPinValueOwnerInterface; | ||
|
|
||
| /* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Value customization classes.
I used ChatGPT 5 for a good chunk of this code. It turns out, it's pretty decent at writing details customization code.
Still took some massaging and iterations, but the result is pretty nice UI.
| class FFlowNodeAddOn_Details final : public IDetailCustomization | ||
| class UFlowNodeAddOn; | ||
|
|
||
| class FFlowNodeAddOn_Details final : public TFlowDataPinValueOwnerCustomization<UFlowNodeAddOn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deriving from this so we can get a refresh call to the parent property when a value changes.
This was important for the Single<->Array switching functionality in the new Values customizations.
| @@ -98,6 +99,10 @@ class FLOWEDITOR_API UFlowGraphSettings : public UDeveloperSettings | |||
| UPROPERTY(EditAnywhere, config, Category = "Nodes", meta = (ConfigRestartRequired = true)) | |||
| TArray<TSubclassOf<class UFlowNode>> NodesHiddenFromPalette; | |||
|
|
|||
| /** Configurable map of FlowAsset subclasses to the FlowAssetNodePolicy for that subclass */ | |||
| UPROPERTY(EditAnywhere, Config, Category = "Nodes", meta = (ConfigRestartRequired = true, AllowedClasses = "/Script/Flow.FlowAsset")) | |||
| TMap<FSoftClassPath, FFlowGraphNodesPolicy> PerAssetSubclassFlowNodePolicies; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have some subclasses of FlowAsset, and we want to define which nodes show up in each palette by the flow asset type itself.
removed some commented-out code that slipped in.