Skip to content

Instantly share code, notes, and snippets.

@FilipSivak
Created August 5, 2021 08:37
Show Gist options
  • Save FilipSivak/f888cf03b803e75d6f17e0c819d5f8f9 to your computer and use it in GitHub Desktop.
Save FilipSivak/f888cf03b803e75d6f17e0c819d5f8f9 to your computer and use it in GitHub Desktop.
Unreal engine open editor widget in asset editor with a button
#include "Editor/EditorEngine.h"
#include "Subsystems/AssetEditorSubsystem.h"
void UMyBlueprintLibrary::OpenWidgetInAssetEditor(UWidget * SelfWidget) {
if(IsValid(SelfWidget))
{
UObject * GeneratedBy = SelfWidget->WidgetGeneratedBy.Get();
if(IsValid(GeneratedBy))
{
UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
AssetEditorSubsystem->OpenEditorForAsset(GeneratedBy);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment