Working on editing MG

This commit is contained in:
2026-03-12 21:31:41 -04:00
parent 9f90c14aa4
commit 8715cd25b0
9 changed files with 121 additions and 39 deletions

View File

@@ -267,6 +267,42 @@ MCPFetcher& MCPFetcher::Template()
return *this;
}
MCPFetcher& MCPFetcher::ToBlueprint()
{
if (bError) return *this;
if (::Cast<UBlueprint>(Obj)) return *this;
if (UWorld* World = ::Cast<UWorld>(Obj))
{
if (!World->PersistentLevel)
return SetError(TEXT("ToBlueprint: World has no PersistentLevel"));
ULevelScriptBlueprint* LevelBP = World->PersistentLevel->GetLevelScriptBlueprint(true);
if (!LevelBP)
return SetError(TEXT("ToBlueprint: World has no level blueprint"));
SetObj(LevelBP);
return *this;
}
return TypeMismatch(TEXT("ToBlueprint"), TEXT("Blueprint or World"));
}
MCPFetcher& MCPFetcher::ToGraph()
{
if (bError) return *this;
if (::Cast<UEdGraph>(Obj)) return *this;
if (UMaterial* Mat = ::Cast<UMaterial>(Obj))
{
MCPUtils::EnsureMaterialGraph(Mat);
if (!Mat->MaterialGraph)
return SetError(FString::Printf(TEXT("ToGraph: Material '%s' has no material graph"), *Mat->GetName()));
SetObj(Mat->MaterialGraph);
return *this;
}
return TypeMismatch(TEXT("ToGraph"), TEXT("Graph or Material"));
}
MCPFetcher& MCPFetcher::MatExp(const FString& Value)
{
if (bError) return *this;