I’m interested in procedurally generating a control rig blueprint from my own file format, but I’m stuck on the process of attaching a custom UControlRigGraph to my blueprint.
My UControlRigBlueprint is being generated by a standard UFactory:
virtual UObject* FactoryCreateNew(...) override
{
...
UControlRigBlueprint* ControlRigBlueprint = CastChecked<UControlRigBlueprint>(FKismetEditorUtilities::CreateBlueprint(ParentClass, InParent, Name, BTYPE_Normal, UControlRigBlueprint::StaticClass(), CallingContext;
UControlRigGraph* RigGraph = NewObject<UControlRigGraph>();
// Populate the graph with nodes, e.g.
// RigGraph->AddNode(NewNode);
...
// then somehow attach the RigGraph to the blueprint
...
// profit!
return ControlRigBlueprint;
}
There are methods to get existing rig graphs from a blueprint:
TArray<UEdGraph*> Graphs;
ControlRigBlueprint->GetAllGraphs(Graphs);
but when I first create the blueprint it’s treated as data only and thus has no embedded graphs.
So my question is: can I generate a control rig graph myself and attach it to a control rig blueprint?