How to set up Editor Module that includes AnimGraphNode

I have a game module that has an AnimNode. I created a corresponding AnimGraphNode but that has to go into a separate Editor only module.

My editor starts up correctly after I configured it this way, and packaging is able to run because I split off the AnimGraphNode into an editor only module.

the .uprojectFile:

{
	"FileVersion": 3,
	"EngineAssociation": "{331638DA-407F-82D5-E82C-BAB789D02694}",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "AEFramework",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		},
		{
			"Name": "AEFrameworkEditor",
			"Type": "Editor",
			"LoadingPhase": "Default"
		},
		{
			"Name": "Wraith",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	]
}

However I can’t run play standalone. It closes the window immediately and I see these errors in the logs under /Saved. I haven’t actually tried running the packaged version either due to some temporary blueprint compiler errors preventing the process from finishing, but another project that uses my framework was able to package to completion a while ago. I didn’t have errors because that other project was brand new and wasn’t actually using anything yet.

The errors seem to be happening because I’m using the AnimNode and it’s failing to load the AnimGraphNode due to that being in an editor only module. However, Unreal Engine itself is set up this way and it doesn’t fail normally, so not sure why it wants to load the AnimGraphNode in a game only configuration.

[2017.01.18-10.00.42:715][  0]LogLinker:Warning: Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:715][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:716][  0]LogLinker:Warning: Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:716][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:754][  0]LogLinker:Warning: Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:754][  0]LoadErrors: Info Failed to load /Game/Characters/Human/Animations/CH_WRHuman_AnimBlueprint.CH_WRHuman_AnimBlueprint_C Referenced by AnimGraph
[2017.01.18-10.00.42:754][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:754][  0]LogLinker:Warning: Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:754][  0]LoadErrors: Info Failed to load /Game/Characters/Human/Animations/CH_WRHuman_AnimBlueprint.CH_WRHuman_AnimBlueprint_C Referenced by AnimGraph
[2017.01.18-10.00.42:754][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:754][  0]LogLinker:Warning: Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:755][  0]LoadErrors: Info Failed to load /Script/AEFrameworkEditor.AEAnimGraphNode_CopyBoneFromSceneComponent Referenced by AnimGraph
[2017.01.18-10.00.42:755][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:755][  0]LogLinker:Warning: Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:755][  0]LoadErrors: Info Failed to load /Script/AEFrameworkEditor.AEAnimGraphNode_CopyBoneFromSceneComponent Referenced by AnimGraph
[2017.01.18-10.00.42:755][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:779][  0]LogLinker:Warning: Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:779][  0]LoadErrors: Info Failed to load /Game/Characters/Human/Animations/CH_WRHuman_AnimBlueprint.CH_WRHuman_AnimBlueprint_C Referenced by AnimGraphNode_TwoBoneIK_0
[2017.01.18-10.00.42:779][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:779][  0]LogLinker:Warning: Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:779][  0]LoadErrors: Info Failed to load /Game/Characters/Human/Animations/CH_WRHuman_AnimBlueprint.CH_WRHuman_AnimBlueprint_C Referenced by AnimGraphNode_TwoBoneIK_0
[2017.01.18-10.00.42:779][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:780][  0]LogLinker:Warning: Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:780][  0]LoadErrors: Info Failed to load /Script/AEFrameworkEditor.AEAnimGraphNode_CopyBoneFromSceneComponent Referenced by AnimGraphNode_TwoBoneIK_0
[2017.01.18-10.00.42:780][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file '/Script/AEFrameworkEditor'
[2017.01.18-10.00.42:780][  0]LogLinker:Warning: Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:780][  0]LoadErrors: Info Failed to load /Script/AEFrameworkEditor.AEAnimGraphNode_CopyBoneFromSceneComponent Referenced by AnimGraphNode_TwoBoneIK_0
[2017.01.18-10.00.42:780][  0]LogUObjectGlobals:Warning: Failed to load '/Script/AEFrameworkEditor': Can't find file for asset '/Script/AEFrameworkEditor' while loading NULL.
[2017.01.18-10.00.42:787][  0]LogWindows: Windows GetLastError: The operation completed successfully. (0)
[2017.01.18-10.00.42:787][  0]LogWindows:Error: === Critical error: ===
[2017.01.18-10.00.42:787][  0]LogWindows:Error: 
[2017.01.18-10.00.42:787][  0]LogWindows:Error: Assertion failed: LocalOwningNode [File:F:\Code\UnrealEngine\Engine\Source\Runtime\Engine\Private\EdGraph\EdGraphPin.cpp] [Line: 1505] 
[2017.01.18-10.00.42:787][  0]LogWindows:Error: 
[2017.01.18-10.00.42:787][  0]LogWindows:Error: 
[2017.01.18-10.00.42:787][  0]LogWindows:Error: 
[2017.01.18-10.00.42:787][  0]LogWindows:Error:

Well, I have the workaround now after doing more research. Looks like I’m not the only one.

This code should go in the .cpp of the game module that has the corresponding editor module:

#include "AEFramework.h"

/**
Workaround for running standalone game from editor.
https://answers.unrealengine.com/questions/550647/how-to-set-up-editor-module-that-includes-animgrap.html
https://answers.unrealengine.com/questions/149470/adding-custom-anim-node-causes-editor-with-game-to.html
*/
class FAEFrameworkGameModule
	: public FDefaultGameModuleImpl
{
#if WITH_EDITOR
	virtual void StartupModule() override
	{
		FModuleManager::Get().LoadModule(TEXT("AEFrameworkEditor"));
	}
#endif // WITH_EDITOR
};

IMPLEMENT_GAME_MODULE(FAEFrameworkGameModule, AEFramework);

What the hell is this spam? That website advertises a service for cheating on essays, has spelling errors, and is in no way related to UE4.

Sorry for hijacking your (answered) question, but I am rather desperate and since you seem to have a working custom animgraph node in your editor module, I thought I may as well ask you.

How did you set it up? Everything I have found regarding making one only leads to me getting linking errors; specifically when I set up the FMyAnimNode Node part in the AnimGraphNode (this throws a unrecognized symbol error). I know it’s not a problem with the node, as it only started happening when I attempted to move the node into the editor module (since having the animgraph nodes in the main module just caused me to be unable to package it).

I believe I have set up the editor module correctly (since I have one working editor customization; a data asset with a custom layout), but despite that, I am still getting nothing.

Do you have just the game and the game editor module or is it subdivided into multiple modules?

Have you looked at Build.cs files? A linker error usually happens from a module not being included in the list of dependency modules in there.

For example, my Game module .Build.cs file has this:

PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "AnimGraphRuntime"} );

And my Editor module.build.cs file has this:

PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "<<<GameModuleNameGoesHere>>>", "AnimGraph", "UnrealEd", "BlueprintGraph" } );

I might not need UnrealEd or BlueprintGraph, not sure. Try removing them, and adding them back until it compiles again. It’s been a while so I don’t remember some of these.

The module name that you need to include corresponds to the root folder of some source files. Like if it’s under Source/Runtime/AIModule/Classes/AIController.h then you need to add “AIModule”.

Another reason a linker error is happening is you’re trying to use a class or function in C++ that’s not exported. If you look at things in the Engine module, it usually says ENGINE_API or something. That means that class is visible to outside C++ modules. If not, it’ll not link. I’ve had to modify some unreal source files to expose some things before because I honestly saw no reason some things shouldn’t be exposed, like ADetourCrowdAIController.

Jup, it was the last part. Turns out that the AnimNodes I was referring to in the AnimGraphNodes didn’t have the MYGAME_API for some inexplicable reason (it’s been a while since I first made those, I have no idea why I thought it necessary to not include that). Thanks, you have saved me from potentially hurling my notebook if I saw another unresolved symbol error!

in .uplugin file, change the module LoadingPhase to “PreDefault”

I remember trying different permutations of this. I could try again now in 4.18 and see how it goes. These used to not even be plugins, but were sub modules in my game code.

I had a chance to finally try this again years later.

I no longer get crashes if I just leave things as it is, but my character is always in a T Pose in standalone. Setting to PreDefault didn’t help.

I still have to use the workaround in 4.24 with my project updated to use the latest build settings.