This is my function in my BlueprintFunctionLibrary class named InputGraph_BlueprintNodes. It is Blueprintcallable:
**static bool CheckMyDubs(int32 n);**
Now for the custom node. In AllocateDefaultPins I define these pins:
//This is the input int pin
** UEdGraphPin *NPin = CreatePin(EGPD_Input, K2Schema->PC_Int, TEXT(""), NULL, false, false, TEXT("n"));
SetPinToolTip(*NPin, LOCTEXT("NPinTooltip", "Number to check"));**
//This is the return boolean pin
** UEdGraphPin *ResultPin = CreatePin(EGPD_Output, K2Schema->PC_Boolean, TEXT(""), NULL, false, false, TEXT("checked"));
SetPinToolTip(*ResultPin, LOCTEXT("ResultPinDescription", "Are there any dubs checked?"));**
This is where, in Expand Node I assign my function to the new CallFunction intermediate node:
//Call to super's Expand Node
**UFunction* function = UInputGraph_BlueprintNodes::StaticClass()->FindFunctionByName(TEXT("CheckMyDubs")); // As you can see, the spelling is the same.**
//Same "if" as yours here
//I spawn the intermediate node just like you do
**CallFunction->SetFromFunction(function); // The function is set here.**
//I call Allocate Default Pins and notify about the intermediate object creation just as you do
//Finally, I move the pins just as you do
** CompilerContext.MovePinLinksToIntermediate(*FindPin(TEXT("n")), *CallFunction->FindPin(TEXT("n")));
CompilerContext.MovePinLinksToIntermediate(*FindPin(TEXT("checked")), *CallFunction->GetReturnValuePin());**
//And I break all self-links just as you do
Any ideas?