More MCP work
This commit is contained in:
@@ -189,6 +189,38 @@ FString MCPUtils::UrlDecode(const FString& EncodedString)
|
||||
// Blueprint helpers
|
||||
// ============================================================
|
||||
|
||||
TArray<UEdGraph*> MCPUtils::AllGraphs(UBlueprint* BP)
|
||||
{
|
||||
TArray<UEdGraph*> Graphs;
|
||||
BP->GetAllGraphs(Graphs);
|
||||
return Graphs;
|
||||
}
|
||||
|
||||
TArray<UEdGraph*> MCPUtils::AllGraphsNamed(UBlueprint* BP, const FString& Name)
|
||||
{
|
||||
TArray<UEdGraph*> Result;
|
||||
for (UEdGraph* Graph : AllGraphs(BP))
|
||||
if (Graph->GetName().Equals(Name, ESearchCase::IgnoreCase))
|
||||
Result.Add(Graph);
|
||||
return Result;
|
||||
}
|
||||
|
||||
TArray<UEdGraphNode*> MCPUtils::AllNodes(UBlueprint* BP)
|
||||
{
|
||||
TArray<UEdGraphNode*> Nodes;
|
||||
for (UEdGraph* Graph : AllGraphs(BP))
|
||||
Nodes.Append(Graph->Nodes);
|
||||
return Nodes;
|
||||
}
|
||||
|
||||
TArray<TSharedPtr<FJsonValue>> MCPUtils::AllGraphNamesJson(UBlueprint* BP)
|
||||
{
|
||||
TArray<TSharedPtr<FJsonValue>> Result;
|
||||
for (UEdGraph* Graph : AllGraphs(BP))
|
||||
Result.Add(MakeShared<FJsonValueString>(Graph->GetName()));
|
||||
return Result;
|
||||
}
|
||||
|
||||
UEdGraphNode* MCPUtils::FindNodeByGuid(
|
||||
UBlueprint* BP, const FString& GuidString, UEdGraph** OutGraph)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user