FGraphNodeFactory::CreatePinWidget() is not called anywhere from the engine.

I found that the function FGraphNodeFactory::CreatePinWidget() is not called anywhere from the engine.
So I think it will be better if there is some comment in the header indicating that it is not being used, or delete this function.

The FGraphNodeFactory class is set in the SGraphPanel of the graph editor through SGraphPanel::SetNodeFactory.
It appears to be a class for customizing the behavior of the graph editor, by calling virtual functions from a derived class.

However, while FGraphNodeFactory::CreateNodeWidget() and FGraphNodeFactory::CreateConnectionPolicy() are looks to be used properly,
FGraphNodeFactory::CreatePinWidget() is not used anywhere.

I was working on inheriting FGraphNodeFactory and customizing it to give additional functionality to the pins, only in certain situations. But I failed. And after debugging, I found out that the CreatePinWidget() function was not used.
I succeeded in solving my problem by using FGraphPanelPinFactory.

However, I felt strongly that I wanted to prevent others other than myself from having the same experience.

I thought this might be some mistake, so I tried to fix it by applying FGraphNodeFactory::CreatePinWidget().
However, a variable of FGraphNodeFactory does not exist in SGraphNode, which creates the pin.
I considered accessing SGraphPanel’s NodeFactory through TWeakPtr OwnerGraphPanelPtr, in SGraphNode. But, that variable is a private member, and there are no public functions that can access it.

I had to spend some time to know this. I think there is a possibility that someone else who sees this code will have a similar experience.
So I want to fix this somehow, but I don’t know how.

I thought about adding a pointer to FGraphNodeFactory to SGraphNode, but I thought it would be too big a modification.

What do you think?

While sleeping, I thought of some options:

a. Create a pull request by adding just the comment: “This function is not called from anywhere at now”

  • I know that this could sound ridiculous.
    But I learned that sometimes just only comment is needed.

b. Create a pull request by deleting that function:

  • I know this could be overkill. But that function was a very good trap to step on.

c. Create a pull request by adding below:

  1. Add a variable of the FGraphNodeFactory in SGraphNode.
    (Maybe like “TSharedPtr<FGraphNodeFactory> NodeFactory”)
  2. In SGraphPanel::AddNode(), if SGraphPanel of SGraphNode is valid,
    write that to the variable above inside the node in adding.
  3. When SGraphNode makes pins through the SGraphNode::CreatePinWidget(),
    if the variable of the FGraphNodeFactory is valid,
    SGraphNode will try to use the FGraphNodeFactory::CreatePinWidget() at first.
    If failed, then call FNodeFactory::CreatePinWidget() as same as past.
  • I am not sure that it is wise to add the variable of FGraphNodeFactory to SGraphNode.

d. Forget it all.

  • The easiest way, but uncomfortable to me. But there is no way to know the intent of the Epic on these codes for me. Maybe they have some schedule or plan to modify those codes. So it could be most safe.

What will be the best?

I made the pull request: https://github.com/EpicGames/UnrealEngine/pull/11203

Giving up is not an easy option for me.