Broad rearrangement of handlers
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include "K2Node_FunctionEntry.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "UMCPHandler_SearchTypeUsageInBlueprints.generated.h"
|
||||
#include "UMCPHandler_BlueprintSearchTypeUsage.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -31,8 +31,8 @@
|
||||
// HandleSearchByType — find all usages of a type across blueprints
|
||||
// ============================================================
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SearchTypeUsageInBlueprints : public UObject, public IMCPHandler
|
||||
UCLASS(meta=(Group="Blueprint"))
|
||||
class UMCPHandler_BlueprintSearchTypeUsage : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "Animation/AnimInstance.h"
|
||||
#include "Animation/Skeleton.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
#include "UMCPHandler_CreateAnimBlueprintAsset.generated.h"
|
||||
#include "AnimBlueprint_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateAnimBlueprintAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_AnimBlueprint_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Animation/AnimBlueprint.h"
|
||||
#include "AnimGraphNode_Base.h"
|
||||
#include "UMCPHandler_ListAnimSlotNames.generated.h"
|
||||
#include "AnimBlueprint_ListSlotNames.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListAnimSlotNames : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_AnimBlueprint_ListSlotNames : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Animation/AnimBlueprint.h"
|
||||
#include "AnimGraphNode_Base.h"
|
||||
#include "UMCPHandler_ListAnimSyncGroups.generated.h"
|
||||
#include "AnimBlueprint_ListSyncGroups.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListAnimSyncGroups : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_AnimBlueprint_ListSyncGroups : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Animation/AnimSequence.h"
|
||||
#include "Animation/BlendSpace.h"
|
||||
#include "UMCPHandler_SetBlendSpaceSamplePoints.generated.h"
|
||||
#include "AnimBlueprint_SetBlendSpaceSamples.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -29,8 +29,8 @@ struct FBlendSpaceSampleEntry
|
||||
float Y = 0.0f;
|
||||
};
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetBlendSpaceSamplePoints : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_AnimBlueprint_SetBlendSpaceSamples : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "Misc/Paths.h"
|
||||
#include "Misc/PackageName.h"
|
||||
#include "HAL/FileManager.h"
|
||||
#include "UMCPHandler_BackupAsset.generated.h"
|
||||
#include "Asset_Backup.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_BackupAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_Backup : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "AssetRegistry/AssetRegistryModule.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "HAL/FileManager.h"
|
||||
#include "UMCPHandler_DeleteAsset.generated.h"
|
||||
#include "Asset_Delete.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DeleteAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_Delete : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "UMCPHandler_FindAssetReferences.generated.h"
|
||||
#include "Asset_FindReferences.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_FindAssetReferences : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_FindReferences : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "UMCPHandler_RenameAsset.generated.h"
|
||||
#include "Asset_Rename.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RenameAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_Rename : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "Misc/PackageName.h"
|
||||
#include "FileHelpers.h"
|
||||
#include "HAL/FileManager.h"
|
||||
#include "UMCPHandler_RestoreAsset.generated.h"
|
||||
#include "Asset_Restore.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RestoreAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_Restore : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UMCPHandler_SearchAssets.generated.h"
|
||||
#include "Asset_Search.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SearchAssets : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Asset_Search : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Animation/Skeleton.h"
|
||||
#include "Animation/BlendSpace.h"
|
||||
#include "UMCPHandler_CreateBlendSpaceAsset.generated.h"
|
||||
#include "BlendSpace_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateBlendSpaceAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_BlendSpace_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_CreateBlueprintGraph.generated.h"
|
||||
#include "BlueprintGraph_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateBlueprintGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_BlueprintGraph_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_DeleteBlueprintGraph.generated.h"
|
||||
#include "BlueprintGraph_Delete.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DeleteBlueprintGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_BlueprintGraph_Delete : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RenameBlueprintGraph.generated.h"
|
||||
#include "BlueprintGraph_Rename.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RenameBlueprintGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_BlueprintGraph_Rename : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "Engine/SCS_Node.h"
|
||||
#include "Components/ActorComponent.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_AddBlueprintComponent.generated.h"
|
||||
#include "Blueprint_AddComponent.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddBlueprintComponent : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_AddComponent : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "K2Node_FunctionEntry.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_AddEventDispatcher.generated.h"
|
||||
#include "Blueprint_AddEventDispatcher.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -29,8 +29,8 @@ struct FDispatcherParamEntry
|
||||
FString Type;
|
||||
};
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddEventDispatcher : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_AddEventDispatcher : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_AddFunctionParameter.generated.h"
|
||||
#include "Blueprint_AddFunctionParameter.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddFunctionParameter : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_AddFunctionParameter : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "UMCPHandler_AddBlueprintInterface.generated.h"
|
||||
#include "Blueprint_AddInterface.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddBlueprintInterface : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_AddInterface : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_AddBlueprintVariable.generated.h"
|
||||
#include "Blueprint_AddVariable.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddBlueprintVariable : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_AddVariable : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ChangeFunctionParameterType.generated.h"
|
||||
#include "Blueprint_ChangeFunctionParameterType.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ChangeFunctionParameterType : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_ChangeFunctionParameterType : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
#include "K2Node_VariableGet.h"
|
||||
#include "K2Node_VariableSet.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ChangeBlueprintVariableType.generated.h"
|
||||
#include "Blueprint_ChangeVariableType.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ChangeBlueprintVariableType : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_ChangeVariableType : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
#include "UMCPHandler_CompileBlueprint.generated.h"
|
||||
#include "Blueprint_Compile.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CompileBlueprint : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Compile : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
#include "UMCPHandler_CreateBlueprintAsset.generated.h"
|
||||
#include "Blueprint_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateBlueprintAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "UMCPHandler_DiffTwoBlueprints.generated.h"
|
||||
#include "Blueprint_Diff.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DiffTwoBlueprints : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Diff : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "Animation/Skeleton.h"
|
||||
#include "Engine/SimpleConstructionScript.h"
|
||||
#include "Engine/SCS_Node.h"
|
||||
#include "UMCPHandler_DumpBlueprint.generated.h"
|
||||
#include "Blueprint_Dump.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DumpBlueprint : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Dump : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Engine/SimpleConstructionScript.h"
|
||||
#include "Engine/SCS_Node.h"
|
||||
#include "UMCPHandler_ListBlueprintComponents.generated.h"
|
||||
#include "Blueprint_ListComponents.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListBlueprintComponents : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_ListComponents : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
#include "K2Node_FunctionEntry.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ListEventDispatchers.generated.h"
|
||||
#include "Blueprint_ListEventDispatchers.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListEventDispatchers : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_ListEventDispatchers : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "UMCPHandler_ListBlueprintInterfaces.generated.h"
|
||||
#include "Blueprint_ListInterfaces.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListBlueprintInterfaces : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_ListInterfaces : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RefreshAllNodesInGraph.generated.h"
|
||||
#include "Blueprint_RefreshAllNodes.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RefreshAllNodesInGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_RefreshAllNodes : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "Engine/SimpleConstructionScript.h"
|
||||
#include "Engine/SCS_Node.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RemoveBlueprintComponent.generated.h"
|
||||
#include "Blueprint_RemoveComponent.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RemoveBlueprintComponent : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_RemoveComponent : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RemoveFunctionParameter.generated.h"
|
||||
#include "Blueprint_RemoveFunctionParameter.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RemoveFunctionParameter : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_RemoveFunctionParameter : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RemoveBlueprintInterface.generated.h"
|
||||
#include "Blueprint_RemoveInterface.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RemoveBlueprintInterface : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_RemoveInterface : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_RemoveBlueprintVariable.generated.h"
|
||||
#include "Blueprint_RemoveVariable.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RemoveBlueprintVariable : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_RemoveVariable : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
#include "UMCPHandler_ReparentBlueprint.generated.h"
|
||||
#include "Blueprint_Reparent.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ReparentBlueprint : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Reparent : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Engine/World.h"
|
||||
#include "UMCPHandler_ListBlueprintAssets.generated.h"
|
||||
#include "Blueprint_Search.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListBlueprintAssets : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_Search : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "K2Node_VariableGet.h"
|
||||
#include "K2Node_VariableSet.h"
|
||||
#include "UMCPHandler_SearchWithinBlueprints.generated.h"
|
||||
#include "Blueprint_SearchContents.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SearchWithinBlueprints : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_SearchContents : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_SetBlueprintVariableMetadata.generated.h"
|
||||
#include "Blueprint_SetVariableMetadata.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetBlueprintVariableMetadata : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Blueprint_SetVariableMetadata : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "UMCPHandler_SearchUnrealClasses.generated.h"
|
||||
#include "Class_Search.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -15,8 +15,8 @@
|
||||
// HandleListClasses — discover available UClasses
|
||||
// ============================================================
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SearchUnrealClasses : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Class_Search : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UMCPHandler_ListClassProperties.generated.h"
|
||||
#include "Class_ShowProperties.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListClassProperties : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Class_ShowProperties : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "Subsystems/AssetEditorSubsystem.h"
|
||||
#include "UMCPHandler_ListOpenAssetEditors.generated.h"
|
||||
#include "Editor_ListOpenAssets.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ListOpenAssetEditors : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Editor_ListOpenAssets : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "Subsystems/AssetEditorSubsystem.h"
|
||||
#include "UMCPHandler_OpenAssetEditor.generated.h"
|
||||
#include "Editor_OpenAsset.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_OpenAssetEditor : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Editor_OpenAsset : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "Factories/EnumFactory.h"
|
||||
#include "UMCPHandler_CreateEnumAsset.generated.h"
|
||||
#include "Enum_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateEnumAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Enum_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphSchema.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_SpawnNodes.generated.h"
|
||||
#include "GraphNode_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -32,8 +32,8 @@ struct FSpawnNodeEntry
|
||||
};
|
||||
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SpawnNodes : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -41,14 +41,14 @@ public:
|
||||
UPROPERTY(meta=(Description="Path to a graph, e.g. /Game/Foo,graph:EventGraph"))
|
||||
FString Graph;
|
||||
|
||||
UPROPERTY(meta=(Description="Array of {actionName, posX, posY} objects. Use SearchSpawnableNodeTypes to find action names."))
|
||||
UPROPERTY(meta=(Description="Array of {actionName, posX, posY} objects. Use GraphNodeSearchTypes to find action names."))
|
||||
FMCPJsonArray Nodes;
|
||||
|
||||
virtual FString GetDescription() const override
|
||||
{
|
||||
return TEXT("Create nodes in any graph (Blueprint, Material, etc.) using the editor's action database. "
|
||||
"Can create ANY node type that appears in the editor's right-click menu. "
|
||||
"Use SearchSpawnableNodeTypes first to find the exact action name.");
|
||||
"Use GraphNodeSearchTypes first to find the exact action name.");
|
||||
}
|
||||
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
TArray<TSharedPtr<FEdGraphSchemaAction>> Matches = MCPUtils::SearchGraphActions(TargetGraph, Entry.ActionName, 0, /*ExactMatch=*/true);
|
||||
if (Matches.Num() == 0)
|
||||
{
|
||||
Result.Appendf(TEXT("ERROR: No action found matching '%s'. Use SearchSpawnableNodeTypes to find available actions.\n"),
|
||||
Result.Appendf(TEXT("ERROR: No action found matching '%s'. Use GraphNodeSearchTypes to find available actions.\n"),
|
||||
*Entry.ActionName);
|
||||
continue;
|
||||
}
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "K2Node_CustomEvent.h"
|
||||
#include "K2Node_FunctionEntry.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_DeleteNodeFromGraph.generated.h"
|
||||
#include "GraphNode_Delete.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DeleteNodeFromGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_Delete : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_DuplicateNodesInGraph.generated.h"
|
||||
#include "GraphNode_Duplicate.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DuplicateNodesInGraph : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_Duplicate : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "UMCPHandler_GetNodeComment.generated.h"
|
||||
#include "GraphNode_GetComment.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_GetNodeComment : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_GetComment : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "EdGraph/EdGraphSchema.h"
|
||||
#include "UMCPHandler_SearchSpawnableNodeTypes.generated.h"
|
||||
#include "GraphNode_SearchTypes.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SearchSpawnableNodeTypes : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_SearchTypes : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
{
|
||||
return TEXT("Search the action database for node types that can be spawned in a graph. "
|
||||
"Works with any graph type (Blueprint, Material, etc.). "
|
||||
"Returns full action names for use with SpawnNodesInGraph.");
|
||||
"Returns full action names for use with GraphNodeCreate.");
|
||||
}
|
||||
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_SetNodeComment.generated.h"
|
||||
#include "GraphNode_SetComment.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetNodeComment : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_SetComment : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_SetNodePositions.generated.h"
|
||||
#include "GraphNode_SetPositions.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -30,8 +30,8 @@ struct FMoveNodeEntry
|
||||
};
|
||||
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetNodePositions : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphNode_SetPositions : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ConnectPins.generated.h"
|
||||
#include "GraphPin_Connect.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -26,8 +26,8 @@ struct FConnectPinsEntry
|
||||
};
|
||||
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ConnectPins : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphPin_Connect : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_DisconnectPins.generated.h"
|
||||
#include "GraphPin_Disconnect.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -26,8 +26,8 @@ struct FDisconnectPinEntry
|
||||
};
|
||||
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DisconnectPins : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphPin_Disconnect : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "UMCPHandler_GetPinDetails.generated.h"
|
||||
#include "GraphPin_GetDetails.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -16,8 +16,8 @@
|
||||
// HandleGetPinInfo — detailed information about a specific pin
|
||||
// ============================================================
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_GetPinDetails : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphPin_GetDetails : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_SetPinDefaultValues.generated.h"
|
||||
#include "GraphPin_SetDefault.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -26,8 +26,8 @@ struct FSetPinDefaultEntry
|
||||
};
|
||||
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetPinDefaultValues : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_GraphPin_SetDefault : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "MaterialGraph/MaterialGraph.h"
|
||||
#include "UMCPHandler_DumpGraphs.generated.h"
|
||||
#include "Graph_Dump.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DumpGraphs : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Graph_Dump : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "Factories/MaterialFunctionFactoryNew.h"
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "UMCPHandler_CreateMaterialFunctionAsset.generated.h"
|
||||
#include "MaterialFunction_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateMaterialFunctionAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_MaterialFunction_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
#include "Factories/MaterialInstanceConstantFactoryNew.h"
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "UMCPHandler_CreateMaterialInstanceAsset.generated.h"
|
||||
#include "MaterialInstance_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateMaterialInstanceAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_MaterialInstance_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "MaterialDomain.h"
|
||||
#include "UMCPHandler_CompileMaterial.generated.h"
|
||||
#include "Material_Compile.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CompileMaterial : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_Compile : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "Factories/MaterialFactoryNew.h"
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "UMCPHandler_CreateMaterialAsset.generated.h"
|
||||
#include "Material_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateMaterialAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
#include "Materials/MaterialExpressionTextureSampleParameter2D.h"
|
||||
#include "Materials/MaterialExpressionStaticSwitchParameter.h"
|
||||
#include "Engine/Texture.h"
|
||||
#include "UMCPHandler_DumpMaterialInstanceParameters.generated.h"
|
||||
#include "Material_DumpInstanceParameters.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DumpMaterialInstanceParameters : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_DumpInstanceParameters : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "Materials/Material.h"
|
||||
#include "Materials/MaterialInterface.h"
|
||||
#include "Materials/MaterialInstanceConstant.h"
|
||||
#include "UMCPHandler_ReparentMaterialInstance.generated.h"
|
||||
#include "Material_ReparentInstance.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ReparentMaterialInstance : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_ReparentInstance : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
#include "Materials/MaterialExpressionTextureSampleParameter2D.h"
|
||||
#include "Materials/MaterialExpressionStaticSwitchParameter.h"
|
||||
#include "Engine/Texture.h"
|
||||
#include "UMCPHandler_SetMaterialInstanceParameter.generated.h"
|
||||
#include "Material_SetInstanceParameter.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetMaterialInstanceParameter : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_SetInstanceParameter : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
#include "MCPUtils.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "MaterialDomain.h"
|
||||
#include "UMCPHandler_SetMaterialProperty.generated.h"
|
||||
#include "Material_SetProperty.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetMaterialProperty : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Material_SetProperty : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UMCPHandler_DumpProperties.generated.h"
|
||||
#include "Property_Dump.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_DumpProperties : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Property_Dump : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UMCPHandler_SetProperties.generated.h"
|
||||
#include "Property_Set.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetProperties : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Property_Set : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "UMCPHandler_ShowCommands.generated.h"
|
||||
#include "ShowCommands.generated.h"
|
||||
|
||||
UCLASS(meta=(Group="Documentation"))
|
||||
class UMCPHandler_ShowCommands : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_ShowCommands : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -23,17 +23,32 @@ public:
|
||||
return TEXT("List all available commands with their descriptions.");
|
||||
}
|
||||
|
||||
void EmitGroup(const FString& GroupName, const TArray<UClass*>& Classes, FStringBuilderBase& Result)
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
{
|
||||
Result.Appendf(TEXT("\n=== %s ===\n\n"), *GroupName);
|
||||
for (UClass* Class : Classes)
|
||||
FString QueryLower = Query.ToLower();
|
||||
FString PrevGroup;
|
||||
|
||||
for (UClass* Class : MCPUtils::CollectHandlerClasses())
|
||||
{
|
||||
FString ToolName = MCPUtils::GetToolName(Class);
|
||||
if (!ToolName.ToLower().Contains(QueryLower))
|
||||
continue;
|
||||
|
||||
// Blank line between groups
|
||||
FString Group = MCPUtils::GetToolGroup(Class);
|
||||
if (Group != PrevGroup)
|
||||
{
|
||||
if (!PrevGroup.IsEmpty())
|
||||
Result.Append(TEXT("\n"));
|
||||
PrevGroup = Group;
|
||||
}
|
||||
|
||||
if (Verbose)
|
||||
{
|
||||
MCPUtils::FormatCommandHelp(Class, Result);
|
||||
continue;
|
||||
}
|
||||
Result.Append(MCPUtils::GetToolName(Class));
|
||||
Result.Append(ToolName);
|
||||
Result.Append(TEXT("("));
|
||||
bool bFirst = true;
|
||||
for (TFieldIterator<FProperty> PropIt(Class, EFieldIterationFlags::None); PropIt; ++PropIt)
|
||||
@@ -47,36 +62,6 @@ public:
|
||||
}
|
||||
Result.Append(TEXT(")\n"));
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
{
|
||||
FString QueryLower = Query.ToLower();
|
||||
|
||||
// Group handlers by their Group metadata.
|
||||
TMap<FString, TArray<UClass*>> Groups;
|
||||
for (UClass* Class : MCPUtils::CollectHandlerClasses())
|
||||
{
|
||||
FString ToolName = MCPUtils::GetToolName(Class);
|
||||
if (!ToolName.ToLower().Contains(QueryLower))
|
||||
continue;
|
||||
FString Group = Class->GetMetaData(TEXT("Group"));
|
||||
if (Group.IsEmpty()) Group = TEXT("Unclassified");
|
||||
Groups.FindOrAdd(Group).Add(Class);
|
||||
}
|
||||
|
||||
// Emit high-priority groups first, in order.
|
||||
static const TCHAR* HighPriority[] = { TEXT("Documentation") };
|
||||
for (const TCHAR* HP : HighPriority)
|
||||
{
|
||||
TArray<UClass*> Classes;
|
||||
if (Groups.RemoveAndCopyValue(HP, Classes))
|
||||
EmitGroup(HP, Classes, Result);
|
||||
}
|
||||
|
||||
// Emit remaining groups.
|
||||
for (const auto& Pair : Groups)
|
||||
EmitGroup(Pair.Key, Pair.Value, Result);
|
||||
|
||||
// Append Path documentation.
|
||||
Result.Append(TEXT("\n"));
|
||||
@@ -12,15 +12,15 @@
|
||||
#include "AnimGraphNode_SequencePlayer.h"
|
||||
#include "AnimStateNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "UMCPHandler_AddAnimStateToMachine.generated.h"
|
||||
#include "StateMachine_AddState.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddAnimStateToMachine : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_AddState : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "AnimStateNode.h"
|
||||
#include "AnimStateTransitionNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "UMCPHandler_AddAnimStateTransition.generated.h"
|
||||
#include "StateMachine_AddTransition.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_AddAnimStateTransition : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_AddTransition : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
#include "AnimStateNode.h"
|
||||
#include "AnimStateTransitionNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "UMCPHandler_RemoveAnimStateFromMachine.generated.h"
|
||||
#include "StateMachine_RemoveState.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_RemoveAnimStateFromMachine : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_RemoveState : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
#include "AnimGraphNode_SequencePlayer.h"
|
||||
#include "AnimStateNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "UMCPHandler_SetAnimStateAnimation.generated.h"
|
||||
#include "StateMachine_SetAnimation.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetAnimStateAnimation : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_SetAnimation : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
#include "AnimStateNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "K2Node_VariableGet.h"
|
||||
#include "UMCPHandler_SetAnimStateBlendSpace.generated.h"
|
||||
#include "StateMachine_SetBlendSpace.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetAnimStateBlendSpace : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_SetBlendSpace : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
#include "Animation/AnimBlueprint.h"
|
||||
#include "AnimStateTransitionNode.h"
|
||||
#include "AnimationStateMachineGraph.h"
|
||||
#include "UMCPHandler_SetAnimTransitionRule.generated.h"
|
||||
#include "StateMachine_SetTransitionRule.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetAnimTransitionRule : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_StateMachine_SetTransitionRule : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "AssetToolsModule.h"
|
||||
#include "IAssetTools.h"
|
||||
#include "Factories/StructureFactory.h"
|
||||
#include "UMCPHandler_CreateStructAsset.generated.h"
|
||||
#include "Struct_Create.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -29,8 +29,8 @@ struct FStructPropertyEntry
|
||||
FString Type;
|
||||
};
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CreateStructAsset : public UObject, public IMCPHandler
|
||||
UCLASS()
|
||||
class UMCP_Struct_Create : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
@@ -40,11 +40,6 @@ is actually fine — but it's a one-way door.
|
||||
lookup failure instead of silently inserting a blank sample.
|
||||
Probably better behavior, but different.
|
||||
|
||||
## Static Function Violation
|
||||
|
||||
- **CompileBlueprint** — has a `static` `CompileAndReport`
|
||||
method, violating the no-static-functions rule.
|
||||
|
||||
## Minor Concerns
|
||||
|
||||
- **SetNodePositions** — node search across all graphs could
|
||||
@@ -1,207 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "K2Node_BreakStruct.h"
|
||||
#include "K2Node_MakeStruct.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ChangeStructNodeType.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ChangeStructNodeType : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(meta=(Description="Path to the node, e.g. /Game/Foo,graph:EventGraph,node:BreakVector"))
|
||||
FString Node;
|
||||
|
||||
UPROPERTY(meta=(Description="New struct type name (e.g. 'Vector', 'FVector', 'Rotator')"))
|
||||
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, FStringBuilderBase& Result) override
|
||||
{
|
||||
MCPFetcher F(Result);
|
||||
UEdGraphNode* FoundNode = F.Walk(Node).Cast<UEdGraphNode>();
|
||||
if (!FoundNode) return;
|
||||
|
||||
// Determine what kind of struct node this is
|
||||
UK2Node_BreakStruct* BreakNode = Cast<UK2Node_BreakStruct>(FoundNode);
|
||||
UK2Node_MakeStruct* MakeNode = Cast<UK2Node_MakeStruct>(FoundNode);
|
||||
if (!BreakNode && !MakeNode)
|
||||
{
|
||||
MCPErrorCallback(Result).SetError(FString::Printf(
|
||||
TEXT("Node %s is not a BreakStruct or MakeStruct (class: %s)"),
|
||||
*MCPUtils::FormatName(FoundNode), *MCPUtils::FormatName(FoundNode->GetClass())));
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the new struct type
|
||||
UScriptStruct* NewStruct = FindStructByName(NewType);
|
||||
if (!NewStruct)
|
||||
{
|
||||
MCPErrorCallback(Result).SetError(FString::Printf(TEXT("Struct type '%s' not found"), *NewType));
|
||||
return;
|
||||
}
|
||||
|
||||
UEdGraph* Graph = FoundNode->GetGraph();
|
||||
const UEdGraphSchema* Schema = Graph ? Graph->GetSchema() : nullptr;
|
||||
if (!Schema)
|
||||
{
|
||||
MCPErrorCallback(Result).SetError(TEXT("Graph schema not found"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Remember existing connections keyed by property base name
|
||||
struct FPinConnection
|
||||
{
|
||||
EEdGraphPinDirection Direction;
|
||||
TArray<UEdGraphPin*> LinkedPins;
|
||||
};
|
||||
TMap<FString, FPinConnection> ConnectionsByBaseName;
|
||||
|
||||
for (UEdGraphPin* Pin : FoundNode->Pins)
|
||||
{
|
||||
if (!Pin || Pin->LinkedTo.Num() == 0) continue;
|
||||
if (Pin->PinType.PinCategory == UEdGraphSchema_K2::PC_Exec) continue;
|
||||
|
||||
FString BaseName = ExtractPropertyBaseName(Pin->PinName.ToString());
|
||||
FPinConnection& Conn = ConnectionsByBaseName.FindOrAdd(BaseName);
|
||||
Conn.Direction = Pin->Direction;
|
||||
Conn.LinkedPins = Pin->LinkedTo;
|
||||
}
|
||||
|
||||
// Change the struct type and reconstruct
|
||||
if (BreakNode) BreakNode->StructType = NewStruct;
|
||||
else MakeNode->StructType = NewStruct;
|
||||
|
||||
FoundNode->BreakAllNodeLinks();
|
||||
Schema->ReconstructNode(*FoundNode);
|
||||
|
||||
// Reconnect pins by matching property base names
|
||||
int32 Reconnected = 0;
|
||||
int32 Failed = 0;
|
||||
|
||||
for (auto& Pair : ConnectionsByBaseName)
|
||||
{
|
||||
const FString& BaseName = Pair.Key;
|
||||
const FPinConnection& OldConn = Pair.Value;
|
||||
|
||||
UEdGraphPin* NewPin = FindMatchingPin(FoundNode, BaseName, OldConn.Direction, NewStruct);
|
||||
if (NewPin)
|
||||
{
|
||||
for (UEdGraphPin* Target : OldConn.LinkedPins)
|
||||
{
|
||||
if (Schema->TryCreateConnection(NewPin, Target))
|
||||
Reconnected++;
|
||||
else
|
||||
Failed++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Failed += OldConn.LinkedPins.Num();
|
||||
}
|
||||
}
|
||||
|
||||
// Get the owning blueprint and mark modified
|
||||
UBlueprint* BP = FBlueprintEditorUtils::FindBlueprintForGraph(Graph);
|
||||
if (BP) FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(BP);
|
||||
|
||||
// Output
|
||||
Result.Appendf(TEXT("Changed to %s\n"), *MCPUtils::FormatName(NewStruct));
|
||||
Result.Appendf(TEXT("Reconnected: %d\n"), Reconnected);
|
||||
if (Failed > 0)
|
||||
Result.Appendf(TEXT("Failed: %d\n"), Failed);
|
||||
}
|
||||
|
||||
private:
|
||||
// Find a UScriptStruct by name, trying with and without F prefix.
|
||||
static UScriptStruct* FindStructByName(const FString& TypeName)
|
||||
{
|
||||
// Try stripping F prefix first (Unreal stores structs without it)
|
||||
FString InternalName = TypeName;
|
||||
if (TypeName.StartsWith(TEXT("F")))
|
||||
InternalName = TypeName.Mid(1);
|
||||
|
||||
UScriptStruct* Found = FindFirstObject<UScriptStruct>(*InternalName);
|
||||
if (Found) return Found;
|
||||
|
||||
// Try the original name
|
||||
Found = FindFirstObject<UScriptStruct>(*TypeName);
|
||||
if (Found) return Found;
|
||||
|
||||
// Fallback: iterate all UScriptStructs and use Identifies
|
||||
for (TObjectIterator<UScriptStruct> It; It; ++It)
|
||||
{
|
||||
if (MCPUtils::Identifies(TypeName, *It))
|
||||
return *It;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Extract the property base name from a pin name, stripping the GUID
|
||||
// and numeric index suffixes that Unreal appends.
|
||||
static FString ExtractPropertyBaseName(const FString& PinName)
|
||||
{
|
||||
int32 LastUnderscore;
|
||||
if (!PinName.FindLastChar(TEXT('_'), LastUnderscore) || LastUnderscore <= 0)
|
||||
return PinName;
|
||||
|
||||
FString Suffix = PinName.Mid(LastUnderscore + 1);
|
||||
if (Suffix.Len() != 32)
|
||||
return PinName;
|
||||
|
||||
FString WithoutGuid = PinName.Left(LastUnderscore);
|
||||
int32 SecondUnderscore;
|
||||
if (!WithoutGuid.FindLastChar(TEXT('_'), SecondUnderscore) || SecondUnderscore <= 0)
|
||||
return WithoutGuid;
|
||||
|
||||
FString IndexStr = WithoutGuid.Mid(SecondUnderscore + 1);
|
||||
if (IndexStr.IsNumeric())
|
||||
return WithoutGuid.Left(SecondUnderscore);
|
||||
return WithoutGuid;
|
||||
}
|
||||
|
||||
// Find a pin on the node matching the given base name and direction.
|
||||
// Falls back to matching the struct-typed pin if no name match is found.
|
||||
static UEdGraphPin* FindMatchingPin(UEdGraphNode* Node, const FString& BaseName,
|
||||
EEdGraphPinDirection Direction, UScriptStruct* NewStruct)
|
||||
{
|
||||
for (UEdGraphPin* Pin : Node->Pins)
|
||||
{
|
||||
if (!Pin || Pin->Direction != Direction) continue;
|
||||
FString NewBaseName = ExtractPropertyBaseName(Pin->PinName.ToString());
|
||||
if (NewBaseName.Equals(BaseName, ESearchCase::IgnoreCase))
|
||||
return Pin;
|
||||
}
|
||||
|
||||
// Fallback: match the single struct-typed pin
|
||||
for (UEdGraphPin* Pin : Node->Pins)
|
||||
{
|
||||
if (!Pin || Pin->Direction != Direction) continue;
|
||||
if (Pin->PinType.PinCategory == UEdGraphSchema_K2::PC_Struct &&
|
||||
Pin->PinType.PinSubCategoryObject == NewStruct)
|
||||
return Pin;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
@@ -1,84 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "UMCPHandler_CheckPinConnectionCompatibility.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Pre-flight check: can two pins be connected?
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_CheckPinConnectionCompatibility : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(meta=(Description="Path to the source pin, e.g. /Game/Foo,graph:EventGraph,node:MyNode,pin:Output"))
|
||||
FString SourcePin;
|
||||
|
||||
UPROPERTY(meta=(Description="Path to the target pin, e.g. /Game/Foo,graph:EventGraph,node:OtherNode,pin:Input"))
|
||||
FString TargetPin;
|
||||
|
||||
virtual FString GetDescription() const override
|
||||
{
|
||||
return TEXT("Check whether two pins can be connected, and what kind of connection would result.");
|
||||
}
|
||||
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
{
|
||||
MCPFetcher FS(Result);
|
||||
UEdGraphPin* SrcPin = FS.Walk(SourcePin).Cast<UEdGraphPin>();
|
||||
if (!SrcPin) return;
|
||||
|
||||
MCPFetcher FT(Result);
|
||||
UEdGraphPin* TgtPin = FT.Walk(TargetPin).Cast<UEdGraphPin>();
|
||||
if (!TgtPin) return;
|
||||
|
||||
const UEdGraphSchema* Schema = SrcPin->GetOwningNode()->GetGraph()->GetSchema();
|
||||
const FPinConnectionResponse Response = Schema->CanCreateConnection(SrcPin, TgtPin);
|
||||
|
||||
bool bCompatible = (Response.Response != ECanCreateConnectionResponse::CONNECT_RESPONSE_DISALLOW);
|
||||
|
||||
// Decode the response type
|
||||
const TCHAR* ResponseType;
|
||||
switch (Response.Response)
|
||||
{
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_MAKE:
|
||||
ResponseType = TEXT("direct");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_BREAK_OTHERS_A:
|
||||
ResponseType = TEXT("break-source-connections");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_BREAK_OTHERS_B:
|
||||
ResponseType = TEXT("break-target-connections");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_BREAK_OTHERS_AB:
|
||||
ResponseType = TEXT("break-both-connections");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_MAKE_WITH_CONVERSION_NODE:
|
||||
ResponseType = TEXT("requires-conversion");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_MAKE_WITH_PROMOTION:
|
||||
ResponseType = TEXT("requires-promotion");
|
||||
break;
|
||||
case ECanCreateConnectionResponse::CONNECT_RESPONSE_DISALLOW:
|
||||
default:
|
||||
ResponseType = TEXT("disallowed");
|
||||
break;
|
||||
}
|
||||
|
||||
Result.Appendf(TEXT("Compatible: %s\n"), bCompatible ? TEXT("yes") : TEXT("no"));
|
||||
Result.Appendf(TEXT("ConnectionType: %s\n"), ResponseType);
|
||||
if (!Response.Message.IsEmpty())
|
||||
Result.Appendf(TEXT("Message: %s\n"), *Response.Message.ToString());
|
||||
Result.Appendf(TEXT("SourcePinType: %s\n"), *MCPUtils::FormatPinType(SrcPin));
|
||||
Result.Appendf(TEXT("TargetPinType: %s\n"), *MCPUtils::FormatPinType(TgtPin));
|
||||
}
|
||||
};
|
||||
@@ -1,71 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "Materials/Material.h"
|
||||
#include "Materials/MaterialInstanceConstant.h"
|
||||
#include "AssetRegistry/IAssetRegistry.h"
|
||||
#include "UMCPHandler_FindMaterialReferences.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_FindMaterialReferences : public UObject, public IMCPHandler
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(meta=(Description="Material or MaterialInstance name or package path"))
|
||||
FString Material;
|
||||
|
||||
virtual FString GetDescription() const override
|
||||
{
|
||||
return TEXT("Find all assets that reference a given material or material instance.");
|
||||
}
|
||||
|
||||
virtual void Handle(const FJsonObject* Json, FStringBuilderBase& Result) override
|
||||
{
|
||||
// Find the material asset (searching both Material and MaterialInstance)
|
||||
MCPAssets<UMaterial> Assets;
|
||||
Assets.Scan<UMaterial>().Scan<UMaterialInstanceConstant>();
|
||||
if (!Assets.Exact(Material).Errors(Result).ENone().ETwo().Info()) return;
|
||||
FString PackagePath = Assets.OneData().PackageName.ToString();
|
||||
|
||||
IAssetRegistry& Registry = *IAssetRegistry::Get();
|
||||
|
||||
TArray<FName> Referencers;
|
||||
Registry.GetReferencers(FName(*PackagePath), Referencers);
|
||||
|
||||
// Filter out self-references and classify each referencer
|
||||
int32 Count = 0;
|
||||
for (const FName& Ref : Referencers)
|
||||
{
|
||||
FString RefStr = Ref.ToString();
|
||||
if (RefStr == PackagePath) continue;
|
||||
|
||||
TArray<FAssetData> RefAssets;
|
||||
Registry.GetAssetsByPackageName(Ref, RefAssets);
|
||||
if (RefAssets.Num() > 0)
|
||||
{
|
||||
Result.Appendf(TEXT("%s %s\n"),
|
||||
*MCPUtils::FormatName(RefAssets[0].GetClass()),
|
||||
*RefStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
Result.Appendf(TEXT("Unknown %s\n"), *RefStr);
|
||||
}
|
||||
Count++;
|
||||
}
|
||||
|
||||
if (Count == 0)
|
||||
{
|
||||
Result.Append(TEXT("No referencers found.\n"));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,162 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "K2Node_CallFunction.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "UMCPHandler_ReplaceFunctionCallsInBlueprint.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_ReplaceFunctionCallsInBlueprint : public UObject, public IMCPHandler
|
||||
{
|
||||
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, FStringBuilderBase& Result) override
|
||||
{
|
||||
// Load Blueprint
|
||||
MCPAssets<UBlueprint> Assets;
|
||||
if (!Assets.Exact(Blueprint).Errors(Result).ENone().ETwo().Load()) return;
|
||||
UBlueprint* BP = Assets.Object();
|
||||
|
||||
// Find the new class
|
||||
UClass* NewClassPtr = MCPUtils::FindClassByName(NewClass);
|
||||
if (!NewClassPtr)
|
||||
{
|
||||
Result.Appendf(TEXT("ERROR: Could not find class '%s'\n"), *NewClass);
|
||||
return;
|
||||
}
|
||||
|
||||
int32 ReplacedCount = 0;
|
||||
|
||||
for (UK2Node_CallFunction* CallNode : MCPUtils::AllNodes<UK2Node_CallFunction>(BP))
|
||||
{
|
||||
UClass* ParentClass = CallNode->FunctionReference.GetMemberParentClass();
|
||||
if (!ParentClass) continue;
|
||||
if (!MCPUtils::Identifies(OldClass, ParentClass)) continue;
|
||||
|
||||
FName FuncName = CallNode->FunctionReference.GetMemberName();
|
||||
|
||||
// Find the matching function in the new class
|
||||
UFunction* NewFunc = NewClassPtr->FindFunctionByName(FuncName);
|
||||
if (!NewFunc)
|
||||
{
|
||||
Result.Appendf(TEXT("WARNING: Function '%s' not found in %s, skipping %s\n"),
|
||||
*FuncName.ToString(), *MCPUtils::FormatName(NewClassPtr), *MCPUtils::FormatName(CallNode));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (DryRun)
|
||||
{
|
||||
ReplacedCount++;
|
||||
// Check which connected pins might not exist in the new function
|
||||
for (UEdGraphPin* Pin : CallNode->Pins)
|
||||
{
|
||||
if (!Pin || Pin->LinkedTo.Num() == 0) continue;
|
||||
|
||||
bool bPinExistsInNew = false;
|
||||
if (Pin->PinName == UEdGraphSchema_K2::PN_Execute ||
|
||||
Pin->PinName == UEdGraphSchema_K2::PN_Then ||
|
||||
Pin->PinName == UEdGraphSchema_K2::PN_Self ||
|
||||
Pin->PinName == UEdGraphSchema_K2::PN_ReturnValue)
|
||||
{
|
||||
bPinExistsInNew = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (TFieldIterator<FProperty> PropIt(NewFunc); PropIt; ++PropIt)
|
||||
{
|
||||
if (PropIt->GetFName() == Pin->PinName)
|
||||
{
|
||||
bPinExistsInNew = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bPinExistsInNew)
|
||||
{
|
||||
Result.Appendf(TEXT("AT RISK: %s pin %s -> %s\n"),
|
||||
*MCPUtils::FormatName(CallNode), *MCPUtils::FormatName(Pin),
|
||||
*MCPUtils::FormatName(Pin->LinkedTo[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Record existing pin connections before replacement
|
||||
TMap<FName, TArray<UEdGraphPin*>> OldPinConnections;
|
||||
for (UEdGraphPin* Pin : CallNode->Pins)
|
||||
{
|
||||
if (Pin->LinkedTo.Num() > 0)
|
||||
{
|
||||
OldPinConnections.Add(Pin->PinName, Pin->LinkedTo);
|
||||
}
|
||||
}
|
||||
|
||||
// Replace the function reference
|
||||
CallNode->SetFromFunction(NewFunc);
|
||||
ReplacedCount++;
|
||||
|
||||
// Report lost connections
|
||||
for (auto& Pair : OldPinConnections)
|
||||
{
|
||||
UEdGraphPin* NewPin = CallNode->FindPin(Pair.Key);
|
||||
for (UEdGraphPin* OldLinked : Pair.Value)
|
||||
{
|
||||
if (!OldLinked || !OldLinked->GetOwningNode()) continue;
|
||||
bool bStillConnected = NewPin && NewPin->LinkedTo.Contains(OldLinked);
|
||||
if (!bStillConnected)
|
||||
{
|
||||
Result.Appendf(TEXT("LOST: %s pin %s was connected to %s\n"),
|
||||
*MCPUtils::FormatName(CallNode), *Pair.Key.ToString(),
|
||||
*MCPUtils::FormatName(OldLinked));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DryRun)
|
||||
{
|
||||
Result.Appendf(TEXT("Dry run: %d node(s) would be replaced\n"), ReplacedCount);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReplacedCount > 0)
|
||||
{
|
||||
FBlueprintEditorUtils::MarkBlueprintAsModified(BP);
|
||||
}
|
||||
Result.Appendf(TEXT("Replaced %d node(s)\n"), ReplacedCount);
|
||||
}
|
||||
};
|
||||
@@ -1,162 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "MCPHandler.h"
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "MCPFetcher.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
#include "UObject/UObjectIterator.h"
|
||||
#include "UMCPHandler_SetClassDefaultValue.generated.h"
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta=(Group="Unclassified"))
|
||||
class UMCPHandler_SetClassDefaultValue : public UObject, public IMCPHandler
|
||||
{
|
||||
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, FStringBuilderBase& Result) override
|
||||
{
|
||||
// Load Blueprint
|
||||
MCPAssets<UBlueprint> Assets;
|
||||
if (!Assets.Exact(Blueprint).Errors(Result).ENone().ETwo().Load()) return;
|
||||
UBlueprint* BP = Assets.Object();
|
||||
|
||||
if (!BP->GeneratedClass)
|
||||
{
|
||||
Result.Append(TEXT("Error: Blueprint has no GeneratedClass\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
UObject* CDO = BP->GeneratedClass->GetDefaultObject();
|
||||
if (!CDO)
|
||||
{
|
||||
Result.Append(TEXT("Error: Could not get Class Default Object\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
FProperty* Prop = BP->GeneratedClass->FindPropertyByName(*Property);
|
||||
if (!Prop)
|
||||
{
|
||||
Result.Appendf(TEXT("Error: Property '%s' not found on %s\n"), *Property, *MCPUtils::FormatName(BP));
|
||||
return;
|
||||
}
|
||||
|
||||
FString OldValue;
|
||||
Prop->ExportTextItem_Direct(OldValue, Prop->ContainerPtrToValuePtr<void>(CDO), nullptr, CDO, PPF_None);
|
||||
|
||||
FString ActualNewValue;
|
||||
|
||||
// Handle class/soft-class properties (TSubclassOf, TSoftClassPtr)
|
||||
FClassProperty* ClassProp = CastField<FClassProperty>(Prop);
|
||||
FSoftClassProperty* SoftClassProp = CastField<FSoftClassProperty>(Prop);
|
||||
|
||||
if (ClassProp || SoftClassProp)
|
||||
{
|
||||
UClass* ResolvedClass = ResolveClass(Value, Result);
|
||||
if (!ResolvedClass) return;
|
||||
|
||||
// Validate meta class compatibility
|
||||
if (ClassProp)
|
||||
{
|
||||
UClass* MetaClass = ClassProp->MetaClass;
|
||||
if (MetaClass && !ResolvedClass->IsChildOf(MetaClass))
|
||||
{
|
||||
Result.Appendf(TEXT("Error: %s is not a subclass of %s (required by property '%s')\n"),
|
||||
*MCPUtils::FormatName(ResolvedClass), *MCPUtils::FormatName(MetaClass), *Property);
|
||||
return;
|
||||
}
|
||||
ClassProp->SetPropertyValue_InContainer(CDO, ResolvedClass);
|
||||
}
|
||||
else
|
||||
{
|
||||
FSoftObjectPtr SoftPtr(ResolvedClass);
|
||||
SoftClassProp->SetPropertyValue_InContainer(CDO, SoftPtr);
|
||||
}
|
||||
ActualNewValue = MCPUtils::FormatName(ResolvedClass);
|
||||
}
|
||||
// Handle object properties (TObjectPtr, UObject*)
|
||||
else if (FObjectProperty* ObjProp = CastField<FObjectProperty>(Prop))
|
||||
{
|
||||
MCPAssets<UBlueprint> ValueAssets;
|
||||
if (!ValueAssets.Exact(Value).AllContent().Errors(Result).ENone().ETwo().Load()) return;
|
||||
UObject* ResolvedObj = nullptr;
|
||||
if (ValueAssets.Object()->GeneratedClass)
|
||||
ResolvedObj = ValueAssets.Object()->GeneratedClass->GetDefaultObject();
|
||||
|
||||
if (!ResolvedObj)
|
||||
{
|
||||
Result.Appendf(TEXT("Error: Could not resolve '%s' to an object\n"), *Value);
|
||||
return;
|
||||
}
|
||||
|
||||
ObjProp->SetPropertyValue_InContainer(CDO, ResolvedObj);
|
||||
ActualNewValue = MCPUtils::FormatName(ValueAssets.Object());
|
||||
}
|
||||
// Handle simple types via ImportText
|
||||
else
|
||||
{
|
||||
const TCHAR* ImportResult = Prop->ImportText_Direct(*Value, Prop->ContainerPtrToValuePtr<void>(CDO), CDO, PPF_None);
|
||||
if (!ImportResult)
|
||||
{
|
||||
Result.Appendf(TEXT("Error: Failed to parse '%s' as %s for property '%s'\n"),
|
||||
*Value, *Prop->GetCPPType(), *Property);
|
||||
return;
|
||||
}
|
||||
Prop->ExportTextItem_Direct(ActualNewValue, Prop->ContainerPtrToValuePtr<void>(CDO), nullptr, CDO, PPF_None);
|
||||
}
|
||||
|
||||
// Mark modified and save
|
||||
CDO->MarkPackageDirty();
|
||||
BP->Modify();
|
||||
|
||||
FKismetEditorUtilities::CompileBlueprint(BP);
|
||||
bool bSaved = MCPUtils::SaveBlueprintPackage(BP);
|
||||
|
||||
Result.Appendf(TEXT("%s %s: %s -> %s\n"), *Prop->GetCPPType(), *Property, *OldValue, *ActualNewValue);
|
||||
if (!bSaved)
|
||||
Result.Append(TEXT("Warning: Save failed\n"));
|
||||
}
|
||||
|
||||
private:
|
||||
// Try to resolve a string to a UClass: first as a C++ class name, then as a Blueprint asset.
|
||||
UClass* ResolveClass(const FString& ClassName, FStringBuilderBase& Result)
|
||||
{
|
||||
// Try as a C++ class name
|
||||
for (TObjectIterator<UClass> It; It; ++It)
|
||||
{
|
||||
if (It->GetName() == ClassName || It->GetName() == ClassName + TEXT("_C"))
|
||||
return *It;
|
||||
}
|
||||
|
||||
// Try loading as a Blueprint asset
|
||||
MCPAssets<UBlueprint> ValueAssets;
|
||||
if (!ValueAssets.Exact(ClassName).AllContent().Errors(Result).ETwo().Load()) return nullptr;
|
||||
if (!ValueAssets.Objects().IsEmpty() && ValueAssets.Object()->GeneratedClass)
|
||||
return ValueAssets.Object()->GeneratedClass;
|
||||
|
||||
Result.Appendf(TEXT("Error: Could not resolve '%s' to a class\n"), *ClassName);
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "Handlers/UMCPHandler_AddAnimStateToMachine.h"
|
||||
#include "Handlers/UMCPHandler_AddAnimStateTransition.h"
|
||||
#include "Handlers/UMCPHandler_AddBlueprintComponent.h"
|
||||
#include "Handlers/UMCPHandler_AddBlueprintInterface.h"
|
||||
#include "Handlers/UMCPHandler_AddBlueprintVariable.h"
|
||||
#include "Handlers/UMCPHandler_AddEventDispatcher.h"
|
||||
#include "Handlers/UMCPHandler_AddFunctionParameter.h"
|
||||
#include "Handlers/UMCPHandler_AddStructField.h"
|
||||
#include "Handlers/UMCPHandler_BackupAsset.h"
|
||||
#include "Handlers/UMCPHandler_ChangeBlueprintVariableType.h"
|
||||
#include "Handlers/UMCPHandler_ChangeFunctionParameterType.h"
|
||||
#include "Handlers/UMCPHandler_ChangeStructNodeType.h"
|
||||
#include "Handlers/UMCPHandler_CheckPinConnectionCompatibility.h"
|
||||
#include "Handlers/UMCPHandler_CompileBlueprint.h"
|
||||
#include "Handlers/UMCPHandler_CompileMaterial.h"
|
||||
#include "Handlers/UMCPHandler_ConnectPins.h"
|
||||
#include "Handlers/UMCPHandler_CreateAnimBlueprintAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateBlendSpaceAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateBlueprintAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateBlueprintGraph.h"
|
||||
#include "Handlers/UMCPHandler_CreateEnumAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateMaterialAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateMaterialFunctionAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateMaterialInstanceAsset.h"
|
||||
#include "Handlers/UMCPHandler_CreateStructAsset.h"
|
||||
#include "Handlers/UMCPHandler_DeleteAsset.h"
|
||||
#include "Handlers/UMCPHandler_DeleteBlueprintGraph.h"
|
||||
#include "Handlers/UMCPHandler_DeleteNodeFromGraph.h"
|
||||
#include "Handlers/UMCPHandler_DiffTwoBlueprints.h"
|
||||
#include "Handlers/UMCPHandler_DisconnectPins.h"
|
||||
#include "Handlers/UMCPHandler_DumpBlueprint.h"
|
||||
#include "Handlers/UMCPHandler_DumpProperties.h"
|
||||
#include "Handlers/UMCPHandler_DumpGraphs.h"
|
||||
#include "Handlers/UMCPHandler_DumpMaterialInstanceParameters.h"
|
||||
#include "Handlers/UMCPHandler_DuplicateNodesInGraph.h"
|
||||
#include "Handlers/UMCPHandler_FindAssetReferences.h"
|
||||
#include "Handlers/UMCPHandler_FindMaterialReferences.h"
|
||||
#include "Handlers/UMCPHandler_GetNodeComment.h"
|
||||
#include "Handlers/UMCPHandler_GetPinDetails.h"
|
||||
#include "Handlers/UMCPHandler_ListAnimSlotNames.h"
|
||||
#include "Handlers/UMCPHandler_ListAnimSyncGroups.h"
|
||||
#include "Handlers/UMCPHandler_ListBlueprintAssets.h"
|
||||
#include "Handlers/UMCPHandler_ListOpenAssetEditors.h"
|
||||
#include "Handlers/UMCPHandler_ListBlueprintComponents.h"
|
||||
#include "Handlers/UMCPHandler_ListBlueprintInterfaces.h"
|
||||
#include "Handlers/UMCPHandler_ListClassProperties.h"
|
||||
#include "Handlers/UMCPHandler_ListEventDispatchers.h"
|
||||
#include "Handlers/UMCPHandler_OpenAssetEditor.h"
|
||||
#include "Handlers/UMCPHandler_RefreshAllNodesInGraph.h"
|
||||
#include "Handlers/UMCPHandler_RemoveAnimStateFromMachine.h"
|
||||
#include "Handlers/UMCPHandler_RemoveBlueprintComponent.h"
|
||||
#include "Handlers/UMCPHandler_RemoveBlueprintInterface.h"
|
||||
#include "Handlers/UMCPHandler_RemoveBlueprintVariable.h"
|
||||
#include "Handlers/UMCPHandler_RemoveFunctionParameter.h"
|
||||
#include "Handlers/UMCPHandler_RemoveStructField.h"
|
||||
#include "Handlers/UMCPHandler_RenameAsset.h"
|
||||
#include "Handlers/UMCPHandler_RenameBlueprintGraph.h"
|
||||
#include "Handlers/UMCPHandler_ReparentBlueprint.h"
|
||||
#include "Handlers/UMCPHandler_ReparentMaterialInstance.h"
|
||||
#include "Handlers/UMCPHandler_ReplaceFunctionCallsInBlueprint.h"
|
||||
#include "Handlers/UMCPHandler_RestoreAsset.h"
|
||||
#include "Handlers/UMCPHandler_SearchAssets.h"
|
||||
#include "Handlers/UMCPHandler_SearchSpawnableNodeTypes.h"
|
||||
#include "Handlers/UMCPHandler_SearchTypeUsageInBlueprints.h"
|
||||
#include "Handlers/UMCPHandler_SearchUnrealClasses.h"
|
||||
#include "Handlers/UMCPHandler_SearchWithinBlueprints.h"
|
||||
#include "Handlers/UMCPHandler_SetAnimStateAnimation.h"
|
||||
#include "Handlers/UMCPHandler_SetAnimStateBlendSpace.h"
|
||||
#include "Handlers/UMCPHandler_SetAnimTransitionRule.h"
|
||||
#include "Handlers/UMCPHandler_SetBlendSpaceSamplePoints.h"
|
||||
#include "Handlers/UMCPHandler_SetBlueprintVariableMetadata.h"
|
||||
#include "Handlers/UMCPHandler_SetClassDefaultValue.h"
|
||||
#include "Handlers/UMCPHandler_SetMaterialInstanceParameter.h"
|
||||
#include "Handlers/UMCPHandler_SetMaterialProperty.h"
|
||||
#include "Handlers/UMCPHandler_SetNodeComment.h"
|
||||
#include "Handlers/UMCPHandler_SetProperties.h"
|
||||
#include "Handlers/UMCPHandler_SetNodePositions.h"
|
||||
#include "Handlers/UMCPHandler_SetPinDefaultValues.h"
|
||||
#include "Handlers/UMCPHandler_ShowCommands.h"
|
||||
#include "Handlers/UMCPHandler_SpawnNodes.h"
|
||||
@@ -1659,11 +1659,30 @@ TArray<UClass*> MCPUtils::CollectHandlerClasses()
|
||||
FString MCPUtils::GetToolName(UClass* HandlerClass)
|
||||
{
|
||||
FString Name = HandlerClass->GetName();
|
||||
// Strip "MCP_" prefix
|
||||
if (Name.StartsWith(TEXT("MCP_")))
|
||||
Name = Name.Mid(4);
|
||||
// Strip the remaining underscore between group and action (e.g. "Blueprint_Create" -> "BlueprintCreate")
|
||||
int32 UnderscoreIdx;
|
||||
if (Name.FindChar(TEXT('_'), UnderscoreIdx))
|
||||
{
|
||||
return Name.Mid(UnderscoreIdx + 1);
|
||||
}
|
||||
Name = Name.Left(UnderscoreIdx) + Name.Mid(UnderscoreIdx + 1);
|
||||
return Name;
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// GetToolGroup — derive group name from handler class name
|
||||
// ============================================================
|
||||
|
||||
FString MCPUtils::GetToolGroup(UClass* HandlerClass)
|
||||
{
|
||||
FString Name = HandlerClass->GetName();
|
||||
// Strip "MCP_" prefix
|
||||
if (Name.StartsWith(TEXT("MCP_")))
|
||||
Name = Name.Mid(4);
|
||||
// Everything before the underscore is the group
|
||||
int32 UnderscoreIdx;
|
||||
if (Name.FindChar(TEXT('_'), UnderscoreIdx))
|
||||
return Name.Left(UnderscoreIdx);
|
||||
return Name;
|
||||
}
|
||||
|
||||
|
||||
@@ -300,6 +300,7 @@ public:
|
||||
// ----- Command help -----
|
||||
// Derive tool name from handler class name: "MCPHandler_FooBar" → "FooBar"
|
||||
static FString GetToolName(UClass* HandlerClass);
|
||||
static FString GetToolGroup(UClass* HandlerClass);
|
||||
static FString FormatPropertyType(FProperty* Prop);
|
||||
static void FormatCommandHelp(UClass* HandlerClass, FStringBuilderBase& Result);
|
||||
|
||||
|
||||
@@ -128,8 +128,12 @@ def handle_message(msg):
|
||||
params = msg.get("params", {})
|
||||
arguments = params.get("arguments", {})
|
||||
result = forward_to_editor(arguments)
|
||||
if isinstance(result, dict) and "error" in result:
|
||||
text = result["error"]
|
||||
else:
|
||||
text = result
|
||||
return make_jsonrpc(msg_id, {
|
||||
"content": [{"type": "text", "text": result}],
|
||||
"content": [{"type": "text", "text": text}],
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user