Creating AnimNodes - Module Dependencies

Hi,

I’m currently trying to add a custom AnimNode to our game project and am having difficulty identifying the correct module locations for them.

Our Project has 2 main modules:

  • “Atlas” - the main game module
  • “AtlasEditorTools” - an editor only module where we define editor only things, such as details customizations etc.

My understanding was that my FAnimNode struct should be part of the “Atlas” module, as it is part of the final game, but the UAnimGraphNode class should be part of the “AtlasEditorTools” as a editor-only thing.

When I set it up this way, my node compiles and works correctly in editor, but if I restart the editor, I get the following issue:

116676-poserecorder.png

The node is removed as it is unable to find the definition.

Can you please point me in the right direction for getting my module dependencies correct.

Thanks!

Hi Richard, apologies for the delay.

Where abouts are your modules setup at the moment? The editor module for instance should be in YourGameEditor.Build.cs so that it can be loaded on start up.

All modules load and run as intended.

I’m unsure about your question though. With “YourGame” = “Atlas”, we do not have any AtlasEditor.Build.cs in the Atlas Module. There is a AtlasEditor.Target.cs, but I don’t think that is relevant to this?

Our current project directory structure is as follows:

116677-atlasdirectorystructure.png

Descriptions of modules:

  • Atlas - our main game module
  • AtlasEditorTools - an Editor-Only module (as a plugin) used for Vizualizers, Details Customizations, etc.
  • AtlasEditorModule - An Editor-Only module, just contains our UUnrealEdEngine derived class
  • AtlasLoadingScreen - just contains the loading screen
  • TarsierUtilities - a module containing utilities we share across projects

My question is what is the correct module / module dependencies to get the Animation Node loading correctly.

Currently the FAnimNode is in Atlas and the UAnimGraphNode is in AtlasEditorTools.

Ah it is a plugin, is it set to load in your uproject file?

It was not, although it did seem to be loading (all of our other editor tools function correctly).

I tried adding

"Plugins": [
        {
            "Name": "AtlasEditorTools",
            "Enabled": true,
        }
],

But there was no difference. Would I be better of moving this class to the AtlasEditorModule, so it’s no longer in a plugin?

I tried moving the AnimGraphNode to the editor module and still get the same issue.

Hmmm this is odd, adding to the plugin list should have worked.

Earlier you said

“When I set it up this way, my node compiles and works correctly in editor, but if I restart the editor, I get the following issue:”

Is that during editor load time then (during the restart itself)? Or is it after the editor has loaded again and you are opening an asset from the content browser? Or is it possibly a different case altogether?

If you add a node to an asset, save the asset, restart, add the node to a different asset (there by guaranteeing that your node is loaded) and then open the asset you previously saved, is the node then found?

The Message log pops up when the Editor is restarting, before opening any assets.

I tried the test that you suggested and the node is gone in the first anim BP. i.e.

  • Add node to AnimBP_A
  • restart editor
  • see error
  • Add node to AnimBP_B
  • Open AnimBP_A - node is gone.

A bit more information:

If I add the node to a new / blank AnimBP, then it can load correctly after a restart.

The original AnimBP, that I want to use the node in, is always marked as edited when you open it. Could it be that something is happening on engine load, that opens and modifies that BP and this is happening before my Editor Module has loaded?

The original AnimBP, that I want to
use the node in, is always marked as
edited when you open it. Could it be
that something is happening on engine
load, that opens and modifies that BP
and this is happening before my Editor
Module has loaded?

Yeah I am thinking that is the problem here. Trying to break that link so that the blueprint isn’t being loaded in during engine/editor boot would probably fix it. Is it possible that you have a CDO (Class Default Object) that references the AnimBP in question? This would explain why the second anim bp you made worked. If nothing referenced it then it wouldn’t be loaded during engine boot.

This helped, kind of!

The Anim BP was referenced by 2 maps and 1 BP. I tried removing the references in the defaults panel, but that didn’t fix anything and the references still showed up in the reference viewer.

After deleting all three referencing assets, I can reboot the editor and the anim node remains.

But then the game is unplayable as I need to reference the Anim BP in my player BP (and have a player BP) in order to do anything.

Is there any way I can force the module to load earlier, or reference the Anim BP in a different way?

The map references should be fine. It is only the CDO references that cause the problem. These are caused when the type itself references it by default. You can fix your player bp by not referencing the anim bp in the player bp itself, but setting it on the player instance when it is created. This means the CDO can be created by the engine during startup without having to load the anim bp.