55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "WingHandler.h"
|
|
#include "WingServer.h"
|
|
#include "WingFetcher.h"
|
|
#include "WingUtils.h"
|
|
#include "WingGraphExport.h"
|
|
#include "Engine/Blueprint.h"
|
|
#include "EdGraph/EdGraph.h"
|
|
#include "Materials/Material.h"
|
|
#include "MaterialGraph/MaterialGraph.h"
|
|
#include "Graph_Dump.generated.h"
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------------
|
|
|
|
UCLASS()
|
|
class UWing_Graph_Dump : public UObject, public IWingHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Path to graph"))
|
|
FString Graph;
|
|
|
|
UPROPERTY(meta=(Optional, Description="True to include less-significant details"))
|
|
bool IncludeDetails;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Dump blueprint or material graphs as readable text. ");
|
|
}
|
|
|
|
virtual void Handle() override
|
|
{
|
|
WingFetcher F;
|
|
UEdGraph *G = F.Walk(Graph).Cast<UEdGraph>();
|
|
if (!G) return;
|
|
|
|
WingGraphExport Exporter(G);
|
|
UWingServer::Print(*Exporter.GetOutput());
|
|
if (IncludeDetails)
|
|
{
|
|
UWingServer::Print(Exporter.GetDetails());
|
|
}
|
|
else
|
|
{
|
|
UWingServer::Printf(TEXT("\nNote: use bDetails=true to see suppressed details."));
|
|
}
|
|
}
|
|
};
|