More work on graph editing
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "MaterialGraph/MaterialGraph.h"
|
||||
#include "MaterialGraph/MaterialGraphNode.h"
|
||||
#include "Engine/LevelScriptBlueprint.h"
|
||||
#include "Subsystems/AssetEditorSubsystem.h"
|
||||
|
||||
MCPFetcher& MCPFetcher::SetError(const FString& Msg)
|
||||
{
|
||||
@@ -86,7 +87,18 @@ MCPFetcher& MCPFetcher::Asset(const FString& PackagePath)
|
||||
{
|
||||
SetObj(LoadObject<UObject>(nullptr, *PackagePath));
|
||||
if (!Obj)
|
||||
SetError(FString::Printf(TEXT("Could not load asset '%s'"), *PackagePath));
|
||||
return SetError(FString::Printf(TEXT("Could not load asset '%s'"), *PackagePath));
|
||||
|
||||
OriginalAsset = Obj;
|
||||
|
||||
// Open the editor for this asset (or bring it to front if already open).
|
||||
UAssetEditorSubsystem* Sub = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
|
||||
if (!Sub || !Sub->OpenEditorForAsset(Obj))
|
||||
return SetError(FString::Printf(TEXT("Could not open editor for '%s'"), *PackagePath));
|
||||
|
||||
Editor = Sub->FindEditorForAsset(OriginalAsset, false);
|
||||
if (!Editor)
|
||||
return SetError(FString::Printf(TEXT("Could not find editor instance for '%s'"), *PackagePath));
|
||||
|
||||
// If this is a material open in the editor, use the editor's transient copy.
|
||||
if (UMaterial* Mat = ::Cast<UMaterial>(Obj))
|
||||
|
||||
Reference in New Issue
Block a user