Merge of the two project copies into one self-contained plugin (the superset: variable_op + variables.py, full pcg_op runtime/declarative/preset ops, the CreateWidgetFloatAnimation widget tool, and full Voxel graph authoring). Made fully project- and machine-agnostic — no hardcoded paths: - New src/projectPaths.js auto-detects the host .uproject (walk-up), project name, Editor build target, log file, and engine install (EngineAssociation via launcher manifest/registry, else installed-engine scan). All overridable via UE_* env vars. - Rewired buildOrchestrator/insights/launcher/insightsExporter/server.js and the Python workers (cpp_scaffold, live_coding, apply_graph, console) off the old C:/Github/ihy, IHY*, E:/UE_Versions and UE_5.7 literals onto the resolver. - Voxel made optional: Build.cs auto-detects the Voxel plugin (env UE_MCP_WITH_VOXEL override) and the C++ compiles to stubs under WITH_MCP_VOXEL, so the module builds in projects without Voxel; .uplugin marks Voxel optional. - De-branded the agent-gateway and docs; scrubbed a leaked API key; excluded node_modules/Binaries/Intermediate/__pycache__/secrets from the repo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
3.6 KiB
C++
70 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
|
#include "MCPVoxelGraphLibrary.generated.h"
|
|
|
|
class UEdGraph;
|
|
|
|
UCLASS()
|
|
class UEBLUEPRINTMCPEDITOR_API UMCPVoxelGraphLibrary : public UBlueprintFunctionLibrary
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static bool IsVoxelGraphAsset(UObject* Asset);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString ListTerminalGraphsJson(UObject* Asset);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static UEdGraph* FindTerminalEdGraph(UObject* Asset, const FString& Terminal);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString DumpTerminalGraphJson(UObject* Asset, const FString& Terminal);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString GetSelectedNodesJson(UObject* Asset, const FString& Terminal);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString SpawnCommentNode(UEdGraph* Graph, FVector2D Position, FVector2D Size, const FString& Comment, FLinearColor Color);
|
|
|
|
// Returns a JSON catalogue of every spawnable Voxel node (struct nodes + function-library nodes).
|
|
// Filter is an optional case-insensitive substring matched against id / display name / category.
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString ListNodeTypesJson(const FString& Filter, int32 Limit);
|
|
|
|
// Spawns a functional Voxel node (UVoxelGraphNode_Struct) identified by NodeId
|
|
// (struct name, struct path, display name, or "Library.Function" for function nodes).
|
|
// Returns the new node GUID as string, or empty on failure.
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString SpawnStructNode(UEdGraph* Graph, const FString& NodeId, FVector2D Position);
|
|
|
|
// Registers a graph property and returns its new GUID as JSON {ok, guid, name, type}.
|
|
// Kind: "parameter" (graph parameter), "input"/"output" (function in/out), "local" (local variable).
|
|
// TypeStr: float|double|int|bool|vector2d|vector|color|name (defaults to float).
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString AddGraphPropertyJson(UObject* Asset, const FString& Terminal, const FString& Kind, const FString& Name, const FString& TypeStr, const FString& Category);
|
|
|
|
// Lists graph properties of the given Kind as JSON {ok, properties:[{guid,name,type,category}]}.
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString ListGraphPropertiesJson(UObject* Asset, const FString& Terminal, const FString& Kind);
|
|
|
|
// Spawns a usage node for an existing property (Ref = guid or name). bDeclaration only matters
|
|
// for Kind "local" (declaration vs usage). Returns the new node GUID, or empty on failure.
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString SpawnPropertyNode(UEdGraph* Graph, const FString& Kind, const FString& Ref, FVector2D Position, bool bDeclaration);
|
|
|
|
// Spawns a "Call Function" node for a function terminal graph (FunctionRef = terminal guid or name).
|
|
// Returns the new node GUID, or empty on failure.
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static FString SpawnCallFunctionNode(UEdGraph* Graph, const FString& FunctionRef, FVector2D Position);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static bool NotifyGraphChanged(UEdGraph* Graph, bool bCompile);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|VoxelGraph")
|
|
static bool OpenVoxelGraphAsset(UObject* Asset);
|
|
};
|