Download

Why can't I delete or duplicate my custom EdGraphNode

Here is my code. I am inheriting from CanUserDeleteNode() and CanUserDuplicateNode() and setting both to true. I also added a context menu. So confusing.

Custom Node Class

void UFluidArchitectEditorEdGraphNode::AllocateDefaultPins()
{;
	Pins.Empty();
	if (GraphNodeEvent != nullptr)
	{
		if (GraphNodeEvent->PinMode() == 1)
			CreatePin(EGPD_Input,FName(), FName(), FName());
		CreatePin(EGPD_Output, FName(), FName(), FName());
	}
}

FLinearColor UFluidArchitectEditorEdGraphNode::GetNodeTitleColor() const
{
	if (GraphNodeEvent == nullptr)
			return FLinearColor::Black;
	return  GraphNodeEvent->GetColor();
}

FText UFluidArchitectEditorEdGraphNode::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	if (GraphNodeEvent == nullptr)
		return FText::FromString("NULL");
	return GraphNodeEvent->GetTitle();
}

FText UFluidArchitectEditorEdGraphNode::GetTooltipText() const
{
	return FText::FromString("");
}

bool UFluidArchitectEditorEdGraphNode::CanUserDeleteNode() const
{
	return true;
}

bool UFluidArchitectEditorEdGraphNode::CanDuplicateNode() const
{
	return true;
}

Context Menu Actions

void UFluidArchitectEditorEdGraphSchema::GetContextMenuActions(UToolMenu* Menu, UGraphNodeContextMenuContext* Context) const
{
	//Node Actions
	if (Context->Node)
	{
		FToolMenuSection& Section = Menu->AddSection("Node Actions", FText::FromString("Node Actions"));
		Section.AddMenuEntry(FGenericCommands::Get().Delete);
		Section.AddMenuEntry(FGenericCommands::Get().Duplicate);
		Section.AddMenuEntry(FGraphEditorCommands::Get().BreakNodeLinks);
	}
}

Creating Node

UFluidArchitectEditorEdGraphNode* UFluidArchitectEditorEdGraph::CreateTemplateEdGraphNode(UEdGraph* EdGraph)
{
	UFluidArchitectEditorEdGraphNode* Node = NewObject<UFluidArchitectEditorEdGraphNode>(EdGraph);
	Node->SetFlags(RF_Transactional);
	Node->Rename(NULL, EdGraph);
	Node->CreateNewGuid();
	Node->SnapToGrid(10);
	Node->AllocateDefaultPins();
	Node->NodeWidth = 150;
	Node->NodeHeight = 50;
	return Node;
}

Bump