This question was asked before here, but since it was never answered and I have been trying for a couple of days now with no success, I thought I’d ask again and also share what I have found out.
So after trying to build my own node so that it can have a drop down, without success of course, I literally copied the source code of the UK2Node_GetDataTableRow to my UK2Node_GetDataTableRow_2 and thats the result
At this point I’m not even sure if it is even possible, the node works exactly the same but without showing a drop down for the Row Name
If anyone as any suggestion, I’d really appreciate it.
Could you give me some more information on how to get started with using widgets for K2 nodes, I read about it once on the wiki, but since that’s gone now I’m a little lost.
And since there is no reference of any widget on the UK2Node_GetDataTableRow it must be declared somewhere else.
But thanks anyways, maybe I’ll figure it out myself.
Because of this comment in the UK2Node_GetDataTableRow source
// When the DataTable pin gets a new value assigned, we need to update the Slate UI so that SGraphNodeCallParameterCollectionFunction will update the ParameterName drop down
I started digging to find references of the UK2Node_GetDataTableRow node, because it wasn’t working for my copy and the comment suggest the drop down is generated somewhere else… and I found this in BlueprintGraphPanelPinFactory.cpp
else if (Outer->IsA(UK2Node_GetDataTableRow::StaticClass()))
{
const UK2Node_GetDataTableRow* GetDataTableRowNode = CastChecked<UK2Node_GetDataTableRow>(Outer);
DataTablePin = GetDataTableRowNode->GetDataTablePin();
}
if (DataTablePin)
{
if (DataTablePin->DefaultObject != nullptr && DataTablePin->LinkedTo.Num() == 0)
{
if (auto DataTable = Cast<UDataTable>(DataTablePin->DefaultObject))
{
return SNew(SGraphPinDataTableRowName, InPin, DataTable);
}
if (DataTablePin->DefaultObject->IsA(UCurveTable::StaticClass()))
{
UCurveTable* CurveTable = (UCurveTable*)DataTablePin->DefaultObject;
if (CurveTable)
{
TArray<TSharedPtr<FName>> RowNames;
/** Extract all the row names from the RowMap */
for (TMap<FName, FRealCurve*>::TConstIterator Iterator(CurveTable->GetRowMap()); Iterator; ++Iterator)
{
/** Create a simple array of the row names */
TSharedPtr<FName> RowNameItem = MakeShareable(new FName(Iterator.Key()));
RowNames.Add(RowNameItem);
}
return SNew(SGraphPinNameList, InPin, RowNames);
}
}
}
}
It looks very promising, I don’t have a lot of time rn, so I’ll look into it later, but I’ll post my findings here
Hi Qygon, I was trying to do something similar.
Probably you’re already figured it out, but I discovered that it’s possible to create custom FGraphPinPanelFactory and register them like this:
This code can put inside a module Startup function (for example an editor plugin). This seems what it need to be done in order to have custom pins for custom UK2Nodes.