Hi, I’m trying to create a new custom node in my plugin but I’m having a bit of a problem. I have this NodeFactory here:
struct FDialogGraphNodeFactory : public FGraphPanelNodeFactory
{
public:
virtual ~FDialogGraphNodeFactory() {}
virtual TSharedPtr<class SGraphNode> CreateNode(class UEdGraphNode* Node) const override
{
if (UDialogGraphNode* NodeAsDialogNode = Cast<UDialogGraphNode>(Node)){
return SNew(SDialogGraphNodeWidget, NodeAsDialogNode);
}
return nullptr;
}
};
In my class derived from SGraphNode I have this:
class SDialogGraphNodeWidget : public SGraphNode
{
public:
SLATE_BEGIN_ARGS(SDialogGraphNodeWidget)
{}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, UEdGraphNode* InNode)
{
SGraphNode::Construct(); // This constructor is actually in SPanel and not in SGraphNode. It's also empty
}
};
The problem is that in the factory when I try to return SNew(SDialogGraphNodeWidget, NodeAsDialogNode); I get an error saying that the Constructor takes no arguments. My question is: if the constructor takes no arguments, how am I supposed to use SNew()? SNew() can’t be empty, but you also can’t add anything to it?
Can someone help me make sense of this?
