Creating a custom animation node in the correct module

Hello,

I have been following the unreal documentation about creating custom animation nodes, found here. There is a quick note about which module should contains which class, but I would appreciate a bit more clarification on that subject.

We are currently putting the Anim Graph class in the Editor module and the Anim class in the Game module, as suggested in the documentation. But with this configuration, when using the node in the animation graph, we get a warning : The node ‘NODE_NAME’ is from an Editor Only module, but is placed in a runtime blueprint! K2 Nodes should only be defined in a Developer or UncookedOnly module.

When searching for a solution, we came upon this forum post describing our exact issue. The most liked response is suggesting to override the Editor package type to GameUncookedOnly

Is this a valid approach or would you suggest a better solution to this issue.

Thank you for your help

Steps to Reproduce
I followed the steps found in this forum post

Hi Anthony,

Sorry about the delay. I’m looking into this now and should get back to you soon.

Best regards,

Vitor

Hi Anthony,

In earlier engine versions, the implementation of animation blueprint graph nodes was supposed to be placed in “Editor” modules. On more recent versions, though, this changed and now they should be placed in “UncookedOnly” modules. If their implementation is kept in “Editor” modules, they will not function properly when playing in “Standalone Game” mode from within the editor or when running the editor with the “-game” command line switch (although they should still work without issues while using the Editor, during PIE, and when running a cooked/packaged game).

To fixup your project or plugin, it should be enough to edit the “uproject” or “uplugin” file, locate the declaration of the module that contains the implementation of the graph nodes, and change its “Type” from “Editor” to “UncookedOnly”. Then, as mentioned in the forum post you linked, make sure to clean/rebuild your project. If you already had the affected nodes in some of your animation blueprints, you might also need to recreate them and resave the assets to recover from an “invalid outer when loading” error in the message log.

To clarify which module should contain each class:

  • For each node, a “Runtime” module should contain a USTRUCT derived from FAnimNode_Base (or maybe “FAnimNode_SkeletalControlBase”), marked with “BlueprintInternalUseOnly” and implementing the appropriate virtual methods.
  • For each node, an “UncookedOnly” module should contain a UCLASS derived from “UAnimGraphNode_Base” (or maybe “UAnimGraphNode_SkeletalControlBase”)

An an extra tip, consider using “SkeletalControlBase” when you need to work mainly in component space (bone transforms relative to skeletal mesh component), and “Base” when mainly in local space (each bone transform relative to its parent). See examples of each by dragging from “Local to Component” or “Component to Local” animation graph nodes to get an idea of the use cases).

Let me know if this helps!

Best regards,

Vitor

Hi Victor,

Thank you for your thorough anwser. This was exactly the info I was looking for and implementing your suggestion worked without hickups.