Don't store the editor in the WingFetcher.

This commit is contained in:
2026-04-07 18:43:58 -04:00
parent 1586ec9268
commit 9dd4031847
5 changed files with 45 additions and 34 deletions

View File

@@ -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
// ============================================================