Is it possible to generate blueprints outside of Unreal?

I’m working on a tool that isn’t necessarily unique to Unreal. So, far I’ve gotten it to generate code based on documentation, and compile that code. The only thing is there are a few blueprints it uses, and I would prefer to generate them rather than distributing the uassets with the project.

The specific uassets I need to generate are Slate Widget Styles, and Widget blueprints. Kismet2 looks like what implements all of the blueprint functionality. Is using something like the UBT capable of generating the uassets needed using system calls?

As far as I know, UBT is not capable of generating any assets. It is merely a tool that generates C++ code used by the Unreal Reflection system so you don’t have to write it manually. Generating assets is possible but there’s no “easy” way to do it. You would have to look at the implementation of UBlueprint class and figure out how to build the asset automatically. Also note that any tool capable of creating and saving Blueprint assets will likely contain portions of the code from the Unreal Engine and according to EULA this would make your tool an Unreal-based product which is presumably not what you want given that you said it’s not necessarily unique to the engine. If I were you I would create a Commandlet that would generate those assets and then launch the editor running that commandlet from the external tool.

Alright, so the commandlet would basically feed arguments to UBlueprint, and generate the files in the appropriate directories? I’d be safe from falling under the EULA if I have the commandlet arguments saved as a string, and launch the whole thing with CreateProcess?

Actually, the whole idea looks a lot like what I’m doing for loading the base classes as modules. GitHub - ue4plugins/CommandletPlugin: Unreal Engine 4 plug-in that demonstrates how to implement a commandlet.

Think of Commandlet as a command-line utility that runs within the engine and that can be invoked by external tools. In your case you would want to create UWidgetBlueprint for Widget Blueprint assets and one of these classes for Widget Style assets and then save them with UPackage::SavePackage.

Is there anyway to run the commandlet from within a module at engine startup?

Hmm, looks like I have to compile both the game and game editor target since I’m using slate.