More MCP refactors, including creation of MCPAssetFinder.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "MCPAssetFinder.h"
|
||||
#include "BlueprintMCPServer.h"
|
||||
#include "MCPUtils.h"
|
||||
#include "Engine/Blueprint.h"
|
||||
@@ -268,7 +269,7 @@ void FBlueprintMCPServer::HandleSnapshotGraph(const FJsonObject* Json, FJsonObje
|
||||
|
||||
// Load Blueprint
|
||||
FString LoadError;
|
||||
UBlueprint* BP = LoadBlueprintByName(BlueprintName, LoadError);
|
||||
UBlueprint* BP = UMCPAssetFinder::LoadBlueprintByName(BlueprintName, LoadError);
|
||||
if (!BP)
|
||||
{
|
||||
return MCPUtils::MakeErrorJson(Result, LoadError);
|
||||
@@ -368,7 +369,7 @@ void FBlueprintMCPServer::HandleDiffGraph(const FJsonObject* Json, FJsonObject*
|
||||
|
||||
// Load the current blueprint
|
||||
FString LoadError;
|
||||
UBlueprint* BP = LoadBlueprintByName(BlueprintName, LoadError);
|
||||
UBlueprint* BP = UMCPAssetFinder::LoadBlueprintByName(BlueprintName, LoadError);
|
||||
if (!BP)
|
||||
{
|
||||
return MCPUtils::MakeErrorJson(Result, LoadError);
|
||||
@@ -587,7 +588,7 @@ void FBlueprintMCPServer::HandleRestoreGraph(const FJsonObject* Json, FJsonObjec
|
||||
|
||||
// Load the current blueprint
|
||||
FString LoadError;
|
||||
UBlueprint* BP = LoadBlueprintByName(BlueprintName, LoadError);
|
||||
UBlueprint* BP = UMCPAssetFinder::LoadBlueprintByName(BlueprintName, LoadError);
|
||||
if (!BP)
|
||||
{
|
||||
return MCPUtils::MakeErrorJson(Result, LoadError);
|
||||
@@ -820,7 +821,7 @@ void FBlueprintMCPServer::HandleFindDisconnectedPins(const FJsonObject* Json, FJ
|
||||
}
|
||||
else if (!PathFilter.IsEmpty())
|
||||
{
|
||||
for (const FAssetData& Asset : AllBlueprintAssets)
|
||||
for (const FAssetData& Asset : UMCPAssetFinder::GetBlueprintAssets())
|
||||
{
|
||||
if (Asset.PackageName.ToString().Contains(PathFilter) || Asset.AssetName.ToString().Contains(PathFilter))
|
||||
{
|
||||
@@ -844,7 +845,7 @@ void FBlueprintMCPServer::HandleFindDisconnectedPins(const FJsonObject* Json, FJ
|
||||
for (const FString& BPName : BlueprintsToScan)
|
||||
{
|
||||
FString LoadError;
|
||||
UBlueprint* BP = LoadBlueprintByName(BPName, LoadError);
|
||||
UBlueprint* BP = UMCPAssetFinder::LoadBlueprintByName(BPName, LoadError);
|
||||
if (!BP) continue;
|
||||
BlueprintsScanned++;
|
||||
|
||||
@@ -1205,10 +1206,10 @@ void FBlueprintMCPServer::HandleAnalyzeRebuildImpact(const FJsonObject* Json, FJ
|
||||
int32 TotalBreakMakeNodes = 0;
|
||||
int32 TotalConnectionsAtRisk = 0;
|
||||
|
||||
for (const FAssetData& Asset : AllBlueprintAssets)
|
||||
for (const FAssetData& Asset : UMCPAssetFinder::GetBlueprintAssets())
|
||||
{
|
||||
FString LoadError;
|
||||
UBlueprint* BP = LoadBlueprintByName(Asset.AssetName.ToString(), LoadError);
|
||||
UBlueprint* BP = UMCPAssetFinder::LoadBlueprintByName(Asset.AssetName.ToString(), LoadError);
|
||||
if (!BP) continue;
|
||||
|
||||
FBlueprintImpact Impact;
|
||||
|
||||
Reference in New Issue
Block a user