Files
unreal-engine-mcp-system-pl…/Source/UEBlueprintMCPEditor/Public/MCPNiagaraLibrary.h
Bonchellon eba71c4ca8 Unified, portable Unreal Engine MCP system plugin
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>
2026-06-24 01:07:24 +03:00

70 lines
3.2 KiB
C++

#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MCPNiagaraLibrary.generated.h"
class UNiagaraSystem;
class UNiagaraEmitter;
class UNiagaraScript;
class UNiagaraRendererProperties;
/**
* Editor-only helpers wrapping Niagara authoring APIs for the MCP server.
* All methods are no-ops/return defaults outside the editor.
*/
UCLASS()
class UMCPNiagaraLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Create an empty UNiagaraSystem asset at the given /Game/... path. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static bool CreateNiagaraSystem(const FString& PackagePath);
/** List emitter handle names on the system. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static TArray<FString> GetEmitterHandleNames(UNiagaraSystem* System);
/** Add an emitter (asset) to the system. Returns the new handle name or empty on failure. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static FString AddEmitterToSystem(UNiagaraSystem* System, UNiagaraEmitter* SourceEmitter, const FString& EmitterName);
/** Remove an emitter handle (by handle name) from the system. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static bool RemoveEmitterFromSystem(UNiagaraSystem* System, const FString& EmitterName);
/**
* List module nodes (function-call nodes) in a stack group.
* GroupName: EmitterSpawn | EmitterUpdate | ParticleSpawn | ParticleUpdate | SystemSpawn | SystemUpdate
* EmitterName ignored for SystemSpawn/SystemUpdate.
* Returns module names in evaluation order.
*/
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static TArray<FString> ListModules(UNiagaraSystem* System, const FString& EmitterName, const FString& GroupName);
/**
* Insert a module script into the stack group. Index = -1 appends.
* Returns the spawned module's function name (used as ModuleName for subsequent ops), or empty on failure.
*/
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static FString AddModuleToStack(UNiagaraSystem* System, const FString& EmitterName, const FString& GroupName, UNiagaraScript* ModuleScript, int32 Index);
/** Remove a module node from the stack group by name. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static bool RemoveModuleFromStack(UNiagaraSystem* System, const FString& EmitterName, const FString& GroupName, const FString& ModuleName);
/** Add a renderer (UNiagaraRendererProperties subclass) to an emitter. Returns the renderer class name or empty. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static FString AddRendererToEmitter(UNiagaraSystem* System, const FString& EmitterName, UClass* RendererClass);
/** Remove all renderers of a given class from an emitter. Returns count removed. */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static int32 RemoveRenderersFromEmitter(UNiagaraSystem* System, const FString& EmitterName, UClass* RendererClass);
/** Recompile the Niagara system (and its emitters). */
UFUNCTION(BlueprintCallable, Category = "MCP|Niagara")
static bool RequestCompile(UNiagaraSystem* System);
};