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>
43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
// Vision-loop helper for the UEBlueprintMCP plugin.
|
|
// Renders a UMG WidgetBlueprint to a PNG file so external agents can SEE
|
|
// what they just authored. Called from Python via unreal.MCPWidgetRenderLibrary.
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
|
#include "MCPWidgetRenderLibrary.generated.h"
|
|
|
|
class UUserWidget;
|
|
|
|
UCLASS()
|
|
class UEBLUEPRINTMCPEDITOR_API UMCPWidgetRenderLibrary : public UBlueprintFunctionLibrary
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
/**
|
|
* Render a UserWidget class to a PNG file on disk.
|
|
* Returns true on success and fills OutFullPath with the absolute file path.
|
|
*
|
|
* @param WidgetClass A UUserWidget subclass (e.g. GeneratedClass of a WidgetBlueprint).
|
|
* @param OutputAbsPath Absolute directory path where the PNG should be written.
|
|
* The folder is created if missing.
|
|
* @param FileNameNoExt File name WITHOUT extension. ".png" is appended automatically.
|
|
* @param Width Texture width in pixels (clamped to [16, 8192]).
|
|
* @param Height Texture height in pixels (clamped to [16, 8192]).
|
|
* @param OutFullPath On success, the absolute path of the written PNG.
|
|
* @param OutError On failure, a short description of what went wrong.
|
|
*/
|
|
UFUNCTION(BlueprintCallable, Category = "MCP|UI",
|
|
meta = (DisplayName = "Render Widget To PNG"))
|
|
static bool RenderWidgetToPNG(
|
|
TSubclassOf<UUserWidget> WidgetClass,
|
|
const FString& OutputAbsPath,
|
|
const FString& FileNameNoExt,
|
|
int32 Width,
|
|
int32 Height,
|
|
FString& OutFullPath,
|
|
FString& OutError
|
|
);
|
|
};
|