Flow Node Validation enhancements#298
Conversation
- 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
Source/Flow/Public/Nodes/FlowNode.h
Outdated
| EDataValidationResult K2_ValidateNode(); | ||
|
|
||
| // Log validation error (editor-only) | ||
| UFUNCTION(BlueprintCallable, Category = "FlowNode|Validation") |
There was a problem hiding this comment.
Maybe add meta = (DevelopmentOnly) to these functions?
|
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. |
Also added meta = DevelopmentOnly for blueprint validation functions
I've taken the feedback into account, and AddOns validation is now possible :) Do you have any ideas on the ideal way to do this? |
|
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. |
|
I think we can add to this |
++ UFlowNodeBase::GetParentNode ++ UFlowNodeAddon property ParentNode (editor only) with getter (overiding UFlowNodeBase::GetParentNode) and setter ++ UFlowNode returns self for GetParentNode ++ UFlowGraphNode::SetParentNodeForSubNode attempts to set the parent node to the flow node instance if it is an addOn - UFlowGraphNode::AddSubNode SubNode->SetParentNodeForSubNode is executed after SubNode->PostPlacedNewNode() to ensure the instance is set for parent detection - Updated FFlowGraphToken::FFlowGraphToken to use the new getter of the parent node
I've finally fixed this as you suggested ! |
acd78b4 to
22f316a
Compare
…ing GetGraphNode we might want to cache editor-time pointer to owning Flow Node t may require more work than just caching it, as pointer needs to be updated during editor operations
|
Hey, I finally managed to review it and merge it! I decided to revert part of the change (caching the owner of AddOn) as it might require more work: this pointer might need to be updated during various editor operations. For now, it's safer to get this pointer dynamically. We might revisit that in the future. Thank you for the improvements :) |


Blueprint Node Validation Support
Flow Asset Validation Logs All Severities
Flow Node AddOn Node Validation
Example in a Blueprint Flow Node