I recently added an Editor-only module to my project, containing a custom anim node. The editor module contains the AnimGraphNode and the game module only the AnimNode runtime. This works well in the editor.
When starting the game in standalone (not cooked), it crashes complaining that the editor module cannot be found. The callstack looks like this:
UE4Editor-KismetCompiler.dll!FAnimBlueprintCompiler::ExpandGraphAndProcessNodes(UEdGraph * SourceGraph, UAnimGraphNode_Base * SourceRootNode, UAnimStateTransitionNode * TransitionNode, TArray<UEdGraphNode *,FDefaultAllocator> * ClonedNodes) Line 589 C++
....
UE4Editor-CoreUObject.dll!ULinkerLoad::RegenerateBlueprintClass(UClass * LoadClass, UObject * ExportObject) Line 39 C++
...
UE4Editor-CoreUObject.dll!ULinkerLoad::CreateExport(int Index) Line 3193 C++
UE4Editor-CoreUObject.dll!ULinkerLoad::LoadAllObjects(bool bForcePreload) Line 2505 C++
UE4Editor-CoreUObject.dll!LoadPackage(UPackage * InOuter, const wchar_t * InLongPackageName, unsigned int LoadFlags) Line 825 C++
UE4Editor-Engine.dll!UEngine::LoadMap(FWorldContext & WorldContext, FURL URL, UPendingNetGame * Pending, FString & Error) Line 8382 C++
Isn’t it a problem that ULinkerLoad::RegenerateBlueprintClass() gets called, when my blueprints are already compiled ?
I can’t see any obvious reason why it does by looking at the ULinkerLoad::CreateExport() function.
If it’s normal, what is the proper way to put editor functionality in a separate module ?
In my .uproject, I have this:
"Modules": [
{
"Name": "MyGame",
"Type": "Runtime",
"LoadingPhase": "Default"
},
{
"Name": "MyGameEditor",
"Type": "Editor",
"LoadingPhase": "Default"
}
],
If both are set to “Runtime”, it works fine, but then I have issues in non-editor builds.