Files
integration/Source/Integration/BlueprintExporter.h

46 lines
1.0 KiB
C++

#pragma once
#if WITH_EDITOR
#include "CoreMinimal.h"
class UBlueprint;
class UEdGraph;
class UEdGraphNode;
class FlxBlueprintExporter
{
public:
FlxBlueprintExporter(UEdGraph* InGraph);
const FString GetOutput() { return Output.ToString(); }
private:
void SortNodes();
void AssignNodeNames();
void EmitNodeList();
void EmitGraph();
void EmitNode(UEdGraphNode* Node);
void Traverse(UEdGraphNode* Node);
bool HasExecPin(UEdGraphNode* Node, EEdGraphPinDirection Direction);
UEdGraphPin* FindFirstPin(UEdGraphNode* Node, EEdGraphPinDirection Direction);
bool IsDefaultToSelf(UEdGraphPin* Pin);
FString SanitizeName(const FString& Title);
FString FormatPinType(UEdGraphPin* Pin);
FString FormatPinSource(UEdGraphPin* Pin);
UEdGraphPin* GetLinkedTo(UEdGraphPin *Pin);
FString GetPinDisplayName(UEdGraphPin *Pin);
UEdGraph* Graph;
// Data populated by passes.
TMap<UEdGraphNode*, FString> NodeNames;
TArray<UEdGraphNode*> SortedNodes;
TSet<UEdGraphNode*> Visited;
// Output buffer.
TStringBuilder<4096> Output;
};
#endif