Custom UK2Node doesn't compile in development mode

I have a custom UK2Node ( UK2Node_Switch ) and my code doesn’t compile in Development mode while it does compile in Development Editor mode.

In the build.cs file the following dependencies are added (a lot of them to be safe) :

PublicDependencyModuleNames.AddRange(new string[] {
        "Core",
        "CoreUObject",
        "Engine",
        "InputCore",
        "UnrealEd",
        "BlueprintGraph",
        "GraphEditor",
        "Kismet",
        "KismetCompiler",
        "PropertyEditor",
        "SlateCore",
        "Slate",
        "EditorStyle",
    });
	PrivateDependencyModuleNames.AddRange(new string[] {
       "Core",
       "CoreUObject",
       "InputCore",
       "Slate",
       "Engine",
       "AssetTools",
       "UnrealEd",
       "KismetWidgets",
       "KismetCompiler",
       "BlueprintGraph",
       "GraphEditor",
       "Kismet",
       "PropertyEditor",
       "EditorStyle",
       "Slate",
       "SlateCore",
       //"MovieSceneCore",
       "Sequencer",
       "DetailCustomizations",
       "Settings",
       "RenderCore"
    });

The error is the following :

Cannot open include file: 'K2Node.generated.h': No such file or directory

UPDATE: I found an answer on the forums that might help, I haven’t tried it out myself yet, but perhaps someone else can try it out: What is the proper method for extending the Editor Engine? - C++ - Epic Developer Community Forums

Thanks for any useful input that may help in order to solve this issue!

My current solution, which isn’t really a solution, was to not use this functionality.

If anyone figures out how to extend K2Node for editor augmentation and be able to generate the code from this augmentation in a development or shipping build, please provide an answer :slight_smile:

V.

We seems to have the same problem, I’d really like to have some answer from an Epic staff. Noone really found a solution about this error.

Hi,

I ran in the same issue few days ago. Looking at some Engine plugins that create custom K2Nodes, for example the OnlineSubsystemUtils, you can see that the plugin is split in two modules. One has type Runtime, the other, named OnlineBlueprintSupport, has type Developer.

So I created a plugin which has 3 different modules, let’s call it SparkPlugin. SparkPlugin is composed by:

Spark-> Runtime Module

SparkBlueprintSupport → Developer Module

SparkEditor → Editor Module

Spark module contains runtime classes, such as Actors, Components and UObjects. SparkBlueprintSupport contains custom UK2Node classes. Finally SparkEditor module contains editor classes, such as Slate widget classes, DetailCustomization classes and so on.

I don’t know why, but it seems that Developer modules are loaded both in Development builds (and standalone instances created inside the Editor) and in Shipping builds, so I was able to call custom K2Nodes outside the Editor. Or at least the custom UK2Node classes in Developer modules are translated by the Blueprint compiler during the build phase.

I hope this helps you.

Please, read my answer below.