Parameter renaming for handlers
This commit is contained in:
@@ -21,7 +21,7 @@ class UMCP_AnimBlueprint_ListSyncGroups : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to an Animation Blueprint, e.g. /Game/Foo/ABP_Character"))
|
UPROPERTY(meta=(Description="Path to an Animation Blueprint, e.g. /Game/Foo/ABP_Character"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UAnimBlueprint* AnimBP = F.Walk(Path).Cast<UAnimBlueprint>();
|
UAnimBlueprint* AnimBP = F.Walk(Blueprint).Cast<UAnimBlueprint>();
|
||||||
if (!AnimBP) return;
|
if (!AnimBP) return;
|
||||||
|
|
||||||
// Walk all anim nodes to collect sync group names
|
// Walk all anim nodes to collect sync group names
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_Asset_Backup : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Full package path of the asset (e.g. /Game/Widgets/WB_Hotkeys)"))
|
UPROPERTY(meta=(Description="Full package path of the asset (e.g. /Game/Widgets/WB_Hotkeys)"))
|
||||||
FString AssetPath;
|
FString Asset;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
FString Filename = FPaths::ConvertRelativePathToFull(
|
FString Filename = FPaths::ConvertRelativePathToFull(
|
||||||
FPackageName::LongPackageNameToFilename(AssetPath, FPackageName::GetAssetPackageExtension()));
|
FPackageName::LongPackageNameToFilename(Asset, FPackageName::GetAssetPackageExtension()));
|
||||||
|
|
||||||
if (!IFileManager::Get().FileExists(*Filename))
|
if (!IFileManager::Get().FileExists(*Filename))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class UMCP_Asset_Delete : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Package path of the asset to delete, e.g. /Game/Foo/Bar"))
|
UPROPERTY(meta=(Description="Package path of the asset to delete, e.g. /Game/Foo/Bar"))
|
||||||
FString AssetPath;
|
FString Asset;
|
||||||
|
|
||||||
UPROPERTY(meta=(Optional, Description="If true, skip reference check and force delete"))
|
UPROPERTY(meta=(Optional, Description="If true, skip reference check and force delete"))
|
||||||
bool Force = false;
|
bool Force = false;
|
||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Verify the asset file exists on disk
|
// Verify the asset file exists on disk
|
||||||
FString PackageFilename = FPackageName::LongPackageNameToFilename(
|
FString PackageFilename = FPackageName::LongPackageNameToFilename(
|
||||||
AssetPath, FPackageName::GetAssetPackageExtension());
|
Asset, FPackageName::GetAssetPackageExtension());
|
||||||
PackageFilename = FPaths::ConvertRelativePathToFull(PackageFilename);
|
PackageFilename = FPaths::ConvertRelativePathToFull(PackageFilename);
|
||||||
|
|
||||||
if (!IFileManager::Get().FileExists(*PackageFilename))
|
if (!IFileManager::Get().FileExists(*PackageFilename))
|
||||||
@@ -50,11 +50,11 @@ public:
|
|||||||
// Check references
|
// Check references
|
||||||
IAssetRegistry& Registry = *IAssetRegistry::Get();
|
IAssetRegistry& Registry = *IAssetRegistry::Get();
|
||||||
TArray<FName> Referencers;
|
TArray<FName> Referencers;
|
||||||
Registry.GetReferencers(FName(*AssetPath), Referencers);
|
Registry.GetReferencers(FName(*Asset), Referencers);
|
||||||
|
|
||||||
// Filter out self-references
|
// Filter out self-references
|
||||||
Referencers.RemoveAll([this](const FName& Ref) {
|
Referencers.RemoveAll([this](const FName& Ref) {
|
||||||
return Ref.ToString() == AssetPath;
|
return Ref.ToString() == Asset;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Referencers.Num() > 0 && !Force)
|
if (Referencers.Num() > 0 && !Force)
|
||||||
@@ -79,7 +79,7 @@ public:
|
|||||||
|
|
||||||
if (Force)
|
if (Force)
|
||||||
{
|
{
|
||||||
UPackage* Package = FindPackage(nullptr, *AssetPath);
|
UPackage* Package = FindPackage(nullptr, *Asset);
|
||||||
if (Package)
|
if (Package)
|
||||||
{
|
{
|
||||||
// Collect all objects in this package
|
// Collect all objects in this package
|
||||||
@@ -117,12 +117,12 @@ public:
|
|||||||
// Trigger an asset registry rescan so it notices the deletion
|
// Trigger an asset registry rescan so it notices the deletion
|
||||||
FString PackageDir;
|
FString PackageDir;
|
||||||
int32 LastSlash;
|
int32 LastSlash;
|
||||||
if (AssetPath.FindLastChar(TEXT('/'), LastSlash))
|
if (Asset.FindLastChar(TEXT('/'), LastSlash))
|
||||||
{
|
{
|
||||||
PackageDir = AssetPath.Left(LastSlash);
|
PackageDir = Asset.Left(LastSlash);
|
||||||
Registry.ScanPathsSynchronous({PackageDir}, true);
|
Registry.ScanPathsSynchronous({PackageDir}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
UMCPServer::Printf(TEXT("Deleted %s\n"), *AssetPath);
|
UMCPServer::Printf(TEXT("Deleted %s\n"), *Asset);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Asset_FindReferences : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Asset package path to find references for, e.g. /Game/Tangibles/TAN_Tree"))
|
UPROPERTY(meta=(Description="Asset package path to find references for, e.g. /Game/Tangibles/TAN_Tree"))
|
||||||
FString AssetPath;
|
FString Asset;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -32,15 +32,15 @@ public:
|
|||||||
IAssetRegistry& Registry = *IAssetRegistry::Get();
|
IAssetRegistry& Registry = *IAssetRegistry::Get();
|
||||||
|
|
||||||
// Verify the asset exists
|
// Verify the asset exists
|
||||||
FAssetData AssetData = Registry.GetAssetByObjectPath(FSoftObjectPath(AssetPath));
|
FAssetData AssetData = Registry.GetAssetByObjectPath(FSoftObjectPath(Asset));
|
||||||
if (!AssetData.IsValid())
|
if (!AssetData.IsValid())
|
||||||
{
|
{
|
||||||
UMCPServer::Printf(TEXT("ERROR: Asset not found: %s\n"), *AssetPath);
|
UMCPServer::Printf(TEXT("ERROR: Asset not found: %s\n"), *Asset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FName> Referencers;
|
TArray<FName> Referencers;
|
||||||
Registry.GetReferencers(FName(*AssetPath), Referencers);
|
Registry.GetReferencers(FName(*Asset), Referencers);
|
||||||
|
|
||||||
if (Referencers.Num() == 0)
|
if (Referencers.Num() == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_Asset_Rename : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Current package path of the asset, e.g. /Game/Widgets/WB_Hotkeys"))
|
UPROPERTY(meta=(Description="Current package path of the asset, e.g. /Game/Widgets/WB_Hotkeys"))
|
||||||
FString AssetPath;
|
FString Asset;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="New package path (e.g. /Game/Widgets/WB_NewName) or just a new asset name (e.g. WB_NewName)"))
|
UPROPERTY(meta=(Description="New package path (e.g. /Game/Widgets/WB_NewName) or just a new asset name (e.g. WB_NewName)"))
|
||||||
FString NewPath;
|
FString NewPath;
|
||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Load the asset
|
// Load the asset
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UObject* AssetObj = F.Asset(AssetPath).GetObj();
|
UObject* AssetObj = F.Asset(Asset).GetObj();
|
||||||
if (!AssetObj) return;
|
if (!AssetObj) return;
|
||||||
|
|
||||||
// Parse new path into package path and asset name
|
// Parse new path into package path and asset name
|
||||||
@@ -44,11 +44,11 @@ public:
|
|||||||
if (NewPackagePath.IsEmpty())
|
if (NewPackagePath.IsEmpty())
|
||||||
{
|
{
|
||||||
// No slash — just a new name, keep the same directory
|
// No slash — just a new name, keep the same directory
|
||||||
NewPackagePath = FPackageName::GetLongPackagePath(AssetPath);
|
NewPackagePath = FPackageName::GetLongPackagePath(Asset);
|
||||||
NewAssetName = NewPath;
|
NewAssetName = NewPath;
|
||||||
if (NewPackagePath.IsEmpty())
|
if (NewPackagePath.IsEmpty())
|
||||||
{
|
{
|
||||||
UMCPServer::Printf(TEXT("ERROR: Cannot determine directory from AssetPath '%s'\n"), *AssetPath);
|
UMCPServer::Printf(TEXT("ERROR: Cannot determine directory from Asset '%s'\n"), *Asset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class UMCP_Asset_Restore : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Full package path of the asset (e.g. /Game/Widgets/WB_Hotkeys)"))
|
UPROPERTY(meta=(Description="Full package path of the asset (e.g. /Game/Widgets/WB_Hotkeys)"))
|
||||||
FString AssetPath;
|
FString Asset;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
FString Filename = FPaths::ConvertRelativePathToFull(
|
FString Filename = FPaths::ConvertRelativePathToFull(
|
||||||
FPackageName::LongPackageNameToFilename(AssetPath, FPackageName::GetAssetPackageExtension()));
|
FPackageName::LongPackageNameToFilename(Asset, FPackageName::GetAssetPackageExtension()));
|
||||||
FString BackupFilename = Filename + TEXT(".bak");
|
FString BackupFilename = Filename + TEXT(".bak");
|
||||||
|
|
||||||
if (!IFileManager::Get().FileExists(*BackupFilename))
|
if (!IFileManager::Get().FileExists(*BackupFilename))
|
||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Release file handles if the package is loaded
|
// Release file handles if the package is loaded
|
||||||
UPackage* Package = FindPackage(nullptr, *AssetPath);
|
UPackage* Package = FindPackage(nullptr, *Asset);
|
||||||
if (Package)
|
if (Package)
|
||||||
{
|
{
|
||||||
ResetLoaders(Package);
|
ResetLoaders(Package);
|
||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
uint32 CopyResult = IFileManager::Get().Copy(*Filename, *BackupFilename, true);
|
uint32 CopyResult = IFileManager::Get().Copy(*Filename, *BackupFilename, true);
|
||||||
if (CopyResult != COPY_OK)
|
if (CopyResult != COPY_OK)
|
||||||
{
|
{
|
||||||
UMCPServer::Printf(TEXT("ERROR: Failed to copy backup over %s\n"), *AssetPath);
|
UMCPServer::Printf(TEXT("ERROR: Failed to copy backup over %s\n"), *Asset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,11 +65,11 @@ public:
|
|||||||
if (!bReloaded)
|
if (!bReloaded)
|
||||||
{
|
{
|
||||||
UMCPServer::Printf(TEXT("WARNING: Restored %s but reload failed: %s\n"),
|
UMCPServer::Printf(TEXT("WARNING: Restored %s but reload failed: %s\n"),
|
||||||
*AssetPath, *ErrorMessage.ToString());
|
*Asset, *ErrorMessage.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UMCPServer::Printf(TEXT("Restored %s from backup\n"), *AssetPath);
|
UMCPServer::Printf(TEXT("Restored %s from backup\n"), *Asset);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class UMCP_BlueprintGraph_Delete : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/Bar"))
|
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/Bar"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Name of the graph to delete"))
|
UPROPERTY(meta=(Description="Name of the graph to delete"))
|
||||||
FString Graph;
|
FString Graph;
|
||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
F.Walk(Path);
|
F.Walk(Blueprint);
|
||||||
if (!F.Ok()) return;
|
if (!F.Ok()) return;
|
||||||
|
|
||||||
UBlueprint* BP = F.Cast<UBlueprint>();
|
UBlueprint* BP = F.Cast<UBlueprint>();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class UMCP_Blueprint_AddEventDispatcher : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Name for the new event dispatcher"))
|
UPROPERTY(meta=(Description="Name for the new event dispatcher"))
|
||||||
FString DispatcherName;
|
FString DispatcherName;
|
||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UBlueprint* BP = F.Walk(Path).Cast<UBlueprint>();
|
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||||
if (!BP) return;
|
if (!BP) return;
|
||||||
|
|
||||||
FName DispatcherFName(*DispatcherName);
|
FName DispatcherFName(*DispatcherName);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_Blueprint_Compile : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Optional, Description="Path of the blueprint."))
|
UPROPERTY(meta=(Optional, Description="Path of the blueprint."))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UBlueprint *BP = F.Walk(Path).Cast<UBlueprint>();
|
UBlueprint *BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||||
|
|
||||||
EBlueprintCompileOptions CompileOpts =
|
EBlueprintCompileOptions CompileOpts =
|
||||||
EBlueprintCompileOptions::SkipSave |
|
EBlueprintCompileOptions::SkipSave |
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class UMCP_Blueprint_ListComponents : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Tangibles/TAN_Tree"))
|
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Tangibles/TAN_Tree"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
F.Walk(Path);
|
F.Walk(Blueprint);
|
||||||
if (!F.Ok()) return;
|
if (!F.Ok()) return;
|
||||||
|
|
||||||
UBlueprint* BP = F.Cast<UBlueprint>();
|
UBlueprint* BP = F.Cast<UBlueprint>();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class UMCP_Blueprint_ListEventDispatchers : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UBlueprint* BP = F.Walk(Path).Cast<UBlueprint>();
|
UBlueprint* BP = F.Walk(Blueprint).Cast<UBlueprint>();
|
||||||
if (!BP) return;
|
if (!BP) return;
|
||||||
|
|
||||||
TSet<FName> DelegateNameSet;
|
TSet<FName> DelegateNameSet;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Blueprint_ListInterfaces : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
UPROPERTY(meta=(Description="Path to a blueprint, e.g. /Game/Foo/MyBlueprint"))
|
||||||
FString Path;
|
FString Blueprint;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
F.Walk(Path);
|
F.Walk(Blueprint);
|
||||||
if (!F.Ok()) return;
|
if (!F.Ok()) return;
|
||||||
UBlueprint* BP = F.Cast<UBlueprint>();
|
UBlueprint* BP = F.Cast<UBlueprint>();
|
||||||
if (!BP) return;
|
if (!BP) return;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Editor_OpenAsset : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="MCPFetcher path to the asset to open (e.g. /Game/Materials/M_Gold)"))
|
UPROPERTY(meta=(Description="MCPFetcher path to the asset to open (e.g. /Game/Materials/M_Gold)"))
|
||||||
FString Path;
|
FString Asset;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UObject* Obj = F.Walk(Path).Cast<UObject>();
|
UObject* Obj = F.Walk(Asset).Cast<UObject>();
|
||||||
if (!Obj) return;
|
if (!Obj) return;
|
||||||
|
|
||||||
UAssetEditorSubsystem* Sub = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
|
UAssetEditorSubsystem* Sub = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class UMCP_Graph_Dump : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to a blueprint, material, or graph, e.g. /Game/Foo or /Game/Foo,graph:EventGraph"))
|
UPROPERTY(meta=(Description="Path to a blueprint, material, or graph, e.g. /Game/Foo or /Game/Foo,graph:EventGraph"))
|
||||||
FString Path;
|
FString Object;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
F.Walk(Path);
|
F.Walk(Object);
|
||||||
if (!F.Ok()) return;
|
if (!F.Ok()) return;
|
||||||
|
|
||||||
if (UEdGraph* Graph = Cast<UEdGraph>(F.GetObj()))
|
if (UEdGraph* Graph = Cast<UEdGraph>(F.GetObj()))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_MaterialInstance_ClearParameter : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Material Instance path"))
|
UPROPERTY(meta=(Description="Material Instance path"))
|
||||||
FString Path;
|
FString MaterialInstance;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Parameter name to clear"))
|
UPROPERTY(meta=(Description="Parameter name to clear"))
|
||||||
FString Parameter;
|
FString Parameter;
|
||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UMaterialInstanceConstant* MI = F.Asset(Path).Cast<UMaterialInstanceConstant>();
|
UMaterialInstanceConstant* MI = F.Asset(MaterialInstance).Cast<UMaterialInstanceConstant>();
|
||||||
if (!MI) return;
|
if (!MI) return;
|
||||||
|
|
||||||
// Parse the association string.
|
// Parse the association string.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_MaterialInstance_DumpParameters : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Material Instance path"))
|
UPROPERTY(meta=(Description="Material Instance path"))
|
||||||
FString Path;
|
FString MaterialInstance;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UMaterialInstanceConstant* MI = F.Asset(Path).Cast<UMaterialInstanceConstant>();
|
UMaterialInstanceConstant* MI = F.Asset(MaterialInstance).Cast<UMaterialInstanceConstant>();
|
||||||
if (!MI) return;
|
if (!MI) return;
|
||||||
|
|
||||||
auto AllParams = MCPUtils::GetMaterialParameters(MI);
|
auto AllParams = MCPUtils::GetMaterialParameters(MI);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class UMCP_MaterialInstance_SetParameter : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Material Instance path"))
|
UPROPERTY(meta=(Description="Material Instance path"))
|
||||||
FString Path;
|
FString MaterialInstance;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Parameter name to set"))
|
UPROPERTY(meta=(Description="Parameter name to set"))
|
||||||
FString Parameter;
|
FString Parameter;
|
||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UMaterialInstanceConstant* MI = F.Asset(Path).Cast<UMaterialInstanceConstant>();
|
UMaterialInstanceConstant* MI = F.Asset(MaterialInstance).Cast<UMaterialInstanceConstant>();
|
||||||
if (!MI) return;
|
if (!MI) return;
|
||||||
|
|
||||||
// Parse the association string.
|
// Parse the association string.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Material_DumpParameters : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Material path"))
|
UPROPERTY(meta=(Description="Material path"))
|
||||||
FString Path;
|
FString Material;
|
||||||
|
|
||||||
virtual FString GetDescription() const override
|
virtual FString GetDescription() const override
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UMaterial* Mat = F.Asset(Path).Cast<UMaterial>();
|
UMaterial* Mat = F.Asset(Material).Cast<UMaterial>();
|
||||||
if (!Mat) return;
|
if (!Mat) return;
|
||||||
|
|
||||||
auto AllParams = MCPUtils::GetMaterialParameters(Mat);
|
auto AllParams = MCPUtils::GetMaterialParameters(Mat);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class UMCP_Property_Dump : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
||||||
FString Path;
|
FString Object;
|
||||||
|
|
||||||
UPROPERTY(meta=(Optional, Description="Substring filter for property names"))
|
UPROPERTY(meta=(Optional, Description="Substring filter for property names"))
|
||||||
FString Query;
|
FString Query;
|
||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Resolve the path to an object and get its editable template.
|
// Resolve the path to an object and get its editable template.
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UObject* Template = F.Walk(Path).Cast<UObject>();
|
UObject* Template = F.Walk(Object).Cast<UObject>();
|
||||||
if (!Template) return;
|
if (!Template) return;
|
||||||
|
|
||||||
TArray<MCPProperty> Props = MCPProperty::GetAllSubstring(Template, CPF_Edit, Query);
|
TArray<MCPProperty> Props = MCPProperty::GetAllSubstring(Template, CPF_Edit, Query);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Property_Get : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
||||||
FString Path;
|
FString Object;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Property name"))
|
UPROPERTY(meta=(Description="Property name"))
|
||||||
FString Property;
|
FString Property;
|
||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
virtual void Handle() override
|
virtual void Handle() override
|
||||||
{
|
{
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UObject* Obj = F.Walk(Path).Cast<UObject>();
|
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||||
if (!Obj) return;
|
if (!Obj) return;
|
||||||
|
|
||||||
MCPProperty P = MCPProperty::GetOneExactMatch(Obj, CPF_Edit, Property);
|
MCPProperty P = MCPProperty::GetOneExactMatch(Obj, CPF_Edit, Property);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class UMCP_Property_Set : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
UPROPERTY(meta=(Description="MCPFetcher path to the object (e.g. /Game/Materials/M_Gold or /Game/Tangibles/TAN_Char,component:Mesh0)"))
|
||||||
FString Path;
|
FString Object;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Object mapping property names to new values in Unreal text format"))
|
UPROPERTY(meta=(Description="Object mapping property names to new values in Unreal text format"))
|
||||||
FMCPJsonObject Properties;
|
FMCPJsonObject Properties;
|
||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Resolve the path to an object and get its editable template.
|
// Resolve the path to an object and get its editable template.
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
UObject* Obj = F.Walk(Path).Cast<UObject>();
|
UObject* Obj = F.Walk(Object).Cast<UObject>();
|
||||||
if (!Obj) return;
|
if (!Obj) return;
|
||||||
|
|
||||||
if (!Properties.Json || Properties.Json->Values.Num() == 0)
|
if (!Properties.Json || Properties.Json->Values.Num() == 0)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class UMCP_StateMachine_RemoveState : public UObject, public IMCPHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UPROPERTY(meta=(Description="Path to the state machine graph, e.g. /Game/MyAnimBP,graph:StateMachine"))
|
UPROPERTY(meta=(Description="Path to the state machine graph, e.g. /Game/MyAnimBP,graph:StateMachine"))
|
||||||
FString Path;
|
FString Graph;
|
||||||
|
|
||||||
UPROPERTY(meta=(Description="Name of the state to remove"))
|
UPROPERTY(meta=(Description="Name of the state to remove"))
|
||||||
FString StateName;
|
FString StateName;
|
||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
{
|
{
|
||||||
// Fetch the state machine graph via MCPFetcher
|
// Fetch the state machine graph via MCPFetcher
|
||||||
MCPFetcher F;
|
MCPFetcher F;
|
||||||
F.Walk(Path);
|
F.Walk(Graph);
|
||||||
if (!F.Ok()) return;
|
if (!F.Ok()) return;
|
||||||
|
|
||||||
UAnimationStateMachineGraph* SMGraph = F.Cast<UAnimationStateMachineGraph>();
|
UAnimationStateMachineGraph* SMGraph = F.Cast<UAnimationStateMachineGraph>();
|
||||||
|
|||||||
Reference in New Issue
Block a user