How to generate a Blueprint / BlueprintGraph using C++?

Hi folks,

I would like to generate a blueprint using C++. Not just a blueprint node, or expose a C++ function for blueprints. But an entire graph with nodes, connections, pins, comments, etc created.

The reason I would like to do this is that I would like to have blueprints for things like their visual debugging. And am in a scenario where I believe 90% of the blueprint creation work could be done programmatically. But would like to have actual blueprints so that other members of my team could edit / reference the blueprint for that last 10%.

After looking around I could not find much info on how to do this other than that the class: BlueprintGraph | Unreal Engine Documentation must be used. To give some context, I am interested in generating animation blueprints. So I believe the specific class I need is: AnimGraph | Unreal Engine Documentation.

I haven’t found any examples of people doing this before. Does anyone have references or tutorials on how to do this? (So I don’t have to trial-and-error the classes above). Particularly concerned about how to connect nodes, as from the link above it is not immediately obvious.

Note: Asking this question a bit prematurely in case anyone has a tutorial or know-how handy. I am in the process of trying this out. Once I figured it out I’ll try to post my solution since it’s been hard to find one on the web. That being said any hints in the right direction are appreciated.

Thanks!

Just a slight update. For those looking into working with animations in C++. Rama’s tutorial (the first that pops up when googling the topic) is a good start: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

Still looking for how to generate a blueprint in C++ though. I found the code-side where blueprints get parsed in the engine, But still not sure how to create one.