Working on editing MG
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user