Don't store the editor in the WingFetcher.
This commit is contained in:
@@ -490,6 +490,30 @@ UObject *WingUtils::GetGeneratedCDO(UBlueprint *BP)
|
||||
return BP->GeneratedClass->GetDefaultObject();
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Editor helpers
|
||||
// ============================================================
|
||||
|
||||
IAssetEditorInstance* WingUtils::CheckOpenEditorForAsset(UObject* Asset, WingOut Errors)
|
||||
{
|
||||
const FString AssetPath = Asset ? Asset->GetPathName() : TEXT("null");
|
||||
UAssetEditorSubsystem* Sub = GEditor ? GEditor->GetEditorSubsystem<UAssetEditorSubsystem>() : nullptr;
|
||||
if (!Sub || !Sub->OpenEditorForAsset(Asset))
|
||||
{
|
||||
Errors.Printf(TEXT("ERROR: Could not open editor for '%s'\n"), *AssetPath);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IAssetEditorInstance* Editor = Sub->FindEditorForAsset(Asset, false);
|
||||
if (!Editor)
|
||||
{
|
||||
Errors.Printf(TEXT("ERROR: Could not find editor instance for '%s'\n"), *AssetPath);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return Editor;
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Material helpers
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user