443 lines
10 KiB
C++
443 lines
10 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "MCPHandler.h"
|
|
#include "BlueprintMCPHandlers_Mutation.generated.h"
|
|
|
|
USTRUCT()
|
|
struct FSetPinDefaultEntry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY()
|
|
FString Blueprint;
|
|
|
|
UPROPERTY()
|
|
FString NodeId;
|
|
|
|
UPROPERTY()
|
|
FString PinName;
|
|
|
|
UPROPERTY()
|
|
FString Value;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="set_pin_default"))
|
|
class UMCPHandler_SetPinDefault : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Array of {blueprint, nodeId, pinName, value} objects"))
|
|
FMCPJsonArray Pins;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Set the default value of input pins on nodes.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
USTRUCT()
|
|
struct FMoveNodeEntry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY()
|
|
FString NodeId;
|
|
|
|
UPROPERTY()
|
|
int32 X = 0;
|
|
|
|
UPROPERTY()
|
|
int32 Y = 0;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="move_node"))
|
|
class UMCPHandler_MoveNode : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Array of {nodeId, x, y} objects"))
|
|
FMCPJsonArray Nodes;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Reposition one or more nodes in a Blueprint graph.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="duplicate_nodes"))
|
|
class UMCPHandler_DuplicateNodes : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Graph name"))
|
|
FString Graph;
|
|
|
|
UPROPERTY(meta=(Description="Array of node GUIDs to duplicate"))
|
|
FMCPJsonArray NodeIds;
|
|
|
|
UPROPERTY(meta=(Optional, Description="X offset for duplicated nodes"))
|
|
int32 OffsetX = 50;
|
|
|
|
UPROPERTY(meta=(Optional, Description="Y offset for duplicated nodes"))
|
|
int32 OffsetY = 50;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Duplicate one or more nodes in a Blueprint graph. "
|
|
"Creates copies offset from the originals with new GUIDs. "
|
|
"Connections are not preserved on the duplicates.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
USTRUCT()
|
|
struct FSpawnNodeEntry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY()
|
|
FString ActionName;
|
|
|
|
UPROPERTY()
|
|
int32 PosX = 0;
|
|
|
|
UPROPERTY()
|
|
int32 PosY = 0;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="spawn_node"))
|
|
class UMCPHandler_SpawnNode : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Graph name (e.g. 'EventGraph')"))
|
|
FString Graph;
|
|
|
|
UPROPERTY(meta=(Description="Array of {actionName, posX, posY} objects. Use search_node_actions to find action names."))
|
|
FMCPJsonArray Nodes;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Create nodes in a Blueprint graph using the editor's action database. "
|
|
"Can create ANY node type that appears in the editor's right-click menu, including custom K2 nodes. "
|
|
"Use search_node_actions first to find the exact action name.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="get_node_comment"))
|
|
class UMCPHandler_GetNodeComment : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Node GUID"))
|
|
FString NodeId;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Get the comment text and bubble visibility of a node.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="set_node_comment"))
|
|
class UMCPHandler_SetNodeComment : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Node GUID"))
|
|
FString NodeId;
|
|
|
|
UPROPERTY(meta=(Description="Comment text to set"))
|
|
FString Comment;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Set a node's comment text. Makes the comment bubble visible if non-empty.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="delete_node"))
|
|
class UMCPHandler_DeleteNode : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Node GUID"))
|
|
FString NodeId;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Delete a node from a Blueprint graph. "
|
|
"Cannot delete entry nodes (FunctionEntry, Event, CustomEvent).");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
USTRUCT()
|
|
struct FConnectPinsEntry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY()
|
|
FString SourceNodeId;
|
|
|
|
UPROPERTY()
|
|
FString SourcePinName;
|
|
|
|
UPROPERTY()
|
|
FString TargetNodeId;
|
|
|
|
UPROPERTY()
|
|
FString TargetPinName;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="connect_pins"))
|
|
class UMCPHandler_ConnectPins : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Array of {sourceNodeId, sourcePinName, targetNodeId, targetPinName} objects"))
|
|
FMCPJsonArray Connections;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Connect pins between nodes in a Blueprint graph.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
USTRUCT()
|
|
struct FDisconnectPinEntry
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY()
|
|
FString NodeId;
|
|
|
|
UPROPERTY()
|
|
FString PinName;
|
|
|
|
UPROPERTY(meta=(Optional))
|
|
FString TargetNodeId;
|
|
|
|
UPROPERTY(meta=(Optional))
|
|
FString TargetPinName;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="disconnect_pin"))
|
|
class UMCPHandler_DisconnectPin : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Array of {nodeId, pinName, targetNodeId?, targetPinName?} objects. If target is omitted, all connections on the pin are broken."))
|
|
FMCPJsonArray Disconnections;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Disconnect pins in a Blueprint graph. "
|
|
"Can disconnect a specific link or all links on a pin.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="replace_function_calls"))
|
|
class UMCPHandler_ReplaceFunctionCalls : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Old class name to match"))
|
|
FString OldClass;
|
|
|
|
UPROPERTY(meta=(Description="New class name to redirect to"))
|
|
FString NewClass;
|
|
|
|
UPROPERTY(meta=(Optional, Description="If true, report what would change without modifying"))
|
|
bool DryRun = false;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Redirect function call nodes from one class to another. "
|
|
"Supports dry-run to preview impact before applying.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="delete_asset"))
|
|
class UMCPHandler_DeleteAsset : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Package path of the asset to delete"))
|
|
FString AssetPath;
|
|
|
|
UPROPERTY(meta=(Optional, Description="If true, skip reference check and force delete"))
|
|
bool Force = false;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Delete a .uasset after verifying no references. "
|
|
"Use force=true to skip the reference check.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="refresh_all_nodes"))
|
|
class UMCPHandler_RefreshAllNodes : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Refresh all nodes in a Blueprint, removing orphaned pins. "
|
|
"Reports compiler warnings and errors.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="change_struct_node_type"))
|
|
class UMCPHandler_ChangeStructNodeType : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Node GUID of the BreakStruct or MakeStruct node"))
|
|
FString NodeId;
|
|
|
|
UPROPERTY(meta=(Description="New struct type name (e.g. 'FVector', 'Vector')"))
|
|
FString NewType;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Change the struct type on a BreakStruct or MakeStruct node. "
|
|
"Attempts to reconnect matching pins after the type change.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="rename_asset"))
|
|
class UMCPHandler_RenameAsset : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Current package path of the asset"))
|
|
FString AssetPath;
|
|
|
|
UPROPERTY(meta=(Description="New package path or new asset name"))
|
|
FString NewPath;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Rename or move an asset with reference fixup.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="set_blueprint_default"))
|
|
class UMCPHandler_SetBlueprintDefault : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Blueprint name or package path"))
|
|
FString Blueprint;
|
|
|
|
UPROPERTY(meta=(Description="Property name on the Class Default Object"))
|
|
FString Property;
|
|
|
|
UPROPERTY(meta=(Description="New value (parsed according to property type)"))
|
|
FString Value;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Set a default property value on a Blueprint's Class Default Object. "
|
|
"Handles class references, object references, and simple types.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|
|
|
|
UCLASS(meta=(ToolName="search_node_actions"))
|
|
class UMCPHandler_SearchNodeActions : public UMCPHandler
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(meta=(Description="Search query string"))
|
|
FString Query;
|
|
|
|
UPROPERTY(meta=(Optional, Description="Maximum number of results (default 50, max 500)"))
|
|
int32 MaxResults = 50;
|
|
|
|
virtual FString GetDescription() const override
|
|
{
|
|
return TEXT("Search the Blueprint action database for node spawners matching a query. "
|
|
"Returns full action names for use with spawn_node.");
|
|
}
|
|
|
|
virtual void Handle(const FJsonObject* Json, FJsonObject* Result) override;
|
|
};
|