Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Numblaze
Copy link
Contributor

@Numblaze Numblaze commented Jun 15, 2025

Blueprint Node Validation Support

  • Added support for node validation via Blueprints using a new K2_ValidateNode() function
  • Blueprints can now log validation messages (errors, warnings, notes) using new LogValidation...() functions exposed on UFlowNodeBase

Flow Asset Validation Logs All Severities

  • Before fix : validation only logged warnings and notes if at least one error was present
  • After fix : UFlowAsset validation logic ensures that all node validation messages are logged, regardless of their severity

Flow Node AddOn Node Validation

  • The node validation code has been moved from UFlowNode to UFlowNodeBase to allow validation of Flow Node AddOns
  • Flow asset validation also validates AddOns

Example in a Blueprint Flow Node

image

- UFlowNode::ValidateNode() is now blueprint-implementable
- UFlowNode now has functions to log validation errors, warnings and notes
- UFlowAsset validation fix : if the validation contains only warnings and/or notes but no errors, the messages are still logged
@MothDoctor MothDoctor self-assigned this Jun 15, 2025
EDataValidationResult K2_ValidateNode();

// Log validation error (editor-only)
UFUNCTION(BlueprintCallable, Category = "FlowNode|Validation")
Copy link
Contributor

@MaksymKapelianovych MaksymKapelianovych Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add meta = (DevelopmentOnly) to these functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done !

@MaksymKapelianovych
Copy link
Contributor

MaksymKapelianovych commented Jun 15, 2025

That's a nice addition for BP nodes, but I noticed that this is for UFlowNode (as previous validation logic). I propose to move it to UFlowNodeBase, it will give users ability to implement validation logic for AddOns also, because currently we can't do that, only runtime message logging is supported.

@Numblaze
Copy link
Contributor Author

Numblaze commented Jun 16, 2025

That's a nice addition for BP nodes, but I noticed that this is for UFlowNode (as previous validation logic). I propose to move it to UFlowNodeBase, it will give users ability to implement validation logic for AddOns also, because currently we can't do that, only runtime message logging is supported.

I've taken the feedback into account, and AddOns validation is now possible :)
However, I have an unresolved issue at this stage : when you add a validation log and pass the AddOn reference in the message, the clickable link doesn't redirect to the node in the graph.

Do you have any ideas on the ideal way to do this?
I thought about referencing the Flow Node owner, but it's only valued at runtime in the AddOn.

@MaksymKapelianovych
Copy link
Contributor

Unfortunately, SGraphPanel does not know anything about AddOns. When SGraphPanel::Update is called, it loops over top level nodes only, creates their respective SWidgets and stores them in a map NodeToWidgetLookup. When you want to select some node, JumpToNode is called and, eventually, in SNodePanel::Tick it tries to find respective SWidget for UEdGraphNode in NodeToWidgetLookup map (in our case, this is AddOn node) and it is not there :)

We could try to add UEdGraphNodes created for AddOns to Nodes array in UEdGraph, but I don't know if this will work) Simpler way would be just to pass owning FlowNode, but as you said, it is available at runtime only.

image
image

@MaksymKapelianovych
Copy link
Contributor

I think we can add ParentNode property to AddOns (it will contain pointer to owning UFlowNode). We can set it in UFlowGraphNode::AddSubNode or UFlowGraphNode::SetParentNodeForSubNode (currently only graph node knows about its parent, but it is direct parent, so it can be another AddOn). Then we have to have getter function for ParentNode in UFlowNodeBase, that will return this for UFlowNode and actual parent UFlowNode for UFlowNodeAddOn. And change this

FFlowGraphToken::FFlowGraphToken(const UFlowNodeBase* InFlowNodeBase)
	: GraphNode(InFlowNodeBase->GetGraphNode())
{
	CachedText = InFlowNodeBase->GetNodeTitle();
}

to this

FFlowGraphToken::FFlowGraphToken(const UFlowNodeBase* InFlowNodeBase)
	: GraphNode(InFlowNodeBase->GetParentNode()->GetGraphNode())
{
	CachedText = InFlowNodeBase->GetNodeTitle();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants