I post this for someone who will experience something similar to me. I had to take some time to investigate this.
I also sended the pull request about it : https://github.com/EpicGames/UnrealEngine/pull/11202
Summary
BP pins unrelated to the ControlRig are generated through the ControlRig Module, since 5.3.
By this, the additional FGraphPanelPinFactory derived class items can not get the chance to work and are bypassed.
Steps to Reproduce
-
In IDE, add a breakpoint here. We will call this breakpoint “Trigger Breakpoint”:
- In 5.3 branch: https://github.com/EpicGames/UnrealEngine/blob/eb41a3744aef0390c43e3da9e013a4e1a6f3b999/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp#L36
- In ue5-main branch: https://github.com/EpicGames/UnrealEngine/blob/82618a9ffdbc94efaf452368c3380e9d8a63c53c/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp#L37
-
In IDE, add a breakpoint here. And set the condition of this to be triggered when the Trigger Breakpoint above hits.
- In 5.3 branch: https://github.com/EpicGames/UnrealEngine/blob/eb41a3744aef0390c43e3da9e013a4e1a6f3b999/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp#L107
- In ue5-main branch: https://github.com/EpicGames/UnrealEngine/blob/82618a9ffdbc94efaf452368c3380e9d8a63c53c/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp#L108
-
In IDE, add a breakpoint here, again. And set the condition of this to be triggered when the Trigger Breakpoint above hits.
- In 5.3 branch:
https://github.com/EpicGames/UnrealEngine/blob/eb41a3744aef0390c43e3da9e013a4e1a6f3b999/Engine/Source/Editor/GraphEditor/Private/NodeFactory.cpp#L251C28-L251C28 - In ue5-main branch:
https://github.com/EpicGames/UnrealEngine/blob/82618a9ffdbc94efaf452368c3380e9d8a63c53c/Engine/Source/Editor/GraphEditor/Private/NodeFactory.cpp#L228C28-L228C28
- In 5.3 branch:
-
Run the editor, create a new Blueprint asset with a parent as AActor, open it, and open the event graph.
- or, It’s ok if you open any Blueprint asset with nodes that with pins come from the FNodeFactory::CreateK2PinWidget() can create. But It must not be the ControlRig Blueprint.
Results
You can see that the valid widget is returned, if CreateK2PinWidget() can create a widget, even if that pin, its node, graph, and asset are not related to ControlRig.
Expected
If the Blueprint asset is not the ControlRig Asset, FControlRigGraphPanelPinFactory::CreatePin() must return nullptr.
Description
This behavior has the problems below:
- In FEdGraphUtilities::VisualPinFactories, if there are items after FControlRigGraphPanelPinFactory, those can not get to chance to work.
- The codes after iterating FGraphPanelPinFactory, in the FNodeFactory::CreatePinWidget(), are being bypassed now. So if there comes some modification in there in the future, that modification will not work. https://github.com/EpicGames/UnrealEngine/blob/eb41a3744aef0390c43e3da9e013a4e1a6f3b999/Engine/Source/Editor/GraphEditor/Private/NodeFactory.cpp#L256-L266
- In the opposite case, if there comes some modification of codes to create pins in the ControlRig Module, that will be applied to the entire engine.
I think this is some mistake in the change,
from the this https://github.com/EpicGames/UnrealEngine/blob/8f7d295198e3f05f1fd4933b2b7eb4bf9329292c/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp ( https://github.com/EpicGames/UnrealEngine/commit/8f7d295198e3f05f1fd4933b2b7eb4bf9329292c )
to this https://github.com/EpicGames/UnrealEngine/blob/39e888f8e843496fe97366c9d61dca25903c3857/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Graph/ControlRigGraphPanelPinFactory.cpp ( https://github.com/EpicGames/UnrealEngine/commit/39e888f8e843496fe97366c9d61dca25903c3857 )
Note: In the default setting, the instance of these factory classes below is added to the FEdGraphUtilities::VisualPinFactories, when the editor starts.
- FUMGGraphPanelPinFactory
- FAssetManagerGraphPanelPinFactory
- FNiagaraScriptGraphPanelPinFactory
- FMetasoundGraphPanelPinFactory
- FBlueprintGraphPanelPinFactory
- FAnimationGraphPinFactory
- FMotionControllerPinFactory
- FGameplayTagsGraphPanelPinFactory
- FControlRigGraphPanelPinFactory
- FRigVMEdGraphPanelPinFactory
FControlRigGraphPanelPinFactory and FRigVMEdGraphPanelPinFactory were making the problem above. So I fixed them in the pull request.
In addition, these factory classes had the same problems. So, if you use the plugins or modules related to those, a similar problem would happen.
In the pull request, I fixed them, too.
- FDMXGraphPanelPinFactory
- FDMXPixelMappingPinFactory
- FDMXProtocolGraphPanelPinFactory
Affects Versions
5.3