Open MaksymKapelianovych opened 1 month ago
For this issue I went with second option (Substitute UFlowNode_Start with UFlowNode_CustomInput) https://github.com/MothCocoon/FlowGraph/issues/205. Please let me know if you prefer different solution.
@MothDoctor @LindyHopperGT please take a look, especially AddOn part)
I am just now catching-up on this. I have a few thoughts.
I think there's a version of #3 that uses NodeInstanceClass
if NodeInstance
does not have a value.
AssignedNodeClasses
is a filter, not a definition for the 'type' of UFlowGraphNode
, but NodeInstanceClass
defines what 'type' the runtime NodeInstance
must be.
If both are null when CanDuplicateNode()
is called, then that seems like the flow graph is degenerate or malformed, because that UFlowGraphNode
has no type. In this case, you could make the argument that the answer should be 'false' (ie, "do not duplicate a malformed node").
I favor the #3 solution generally, because it is simplest. If we can detect the illegal operation (that is, trying to copy a set of nodes, that includes an uncopyable node) and then reject the entire copy operation as a result; we can prevent any further need to handle the complexities of copying some, but not all, the nodes and what that means.
I don't like the #2 solution that changes the node type, that is a strange semantic choice that doesn't follow from the concept of a 'copy request'.
I think, if we do allow the copy (which I prefer to reject the whole thing, if we can), then the #1 solution of filtering out the uncopyable nodes makes the most sense.
--
Take these comments with a disclaimer of me having only about 20mins of researching and thinking about this problem, first thing in the morning ... so I may be missing some nuance(s).
Solution №3 is implemented as a general one for all nodes, but I thought that it would be nice to implement №2 for Start node and to create CutomInput node if user deliberately copied Start node, maybe for some debug purposes. But it is not necessary to have this feature, we can either make it optional by enabling/disabling in FlowGraphSettings or completely remove it