Created
August 5, 2021 08:37
-
-
Save FilipSivak/f888cf03b803e75d6f17e0c819d5f8f9 to your computer and use it in GitHub Desktop.
Unreal engine open editor widget in asset editor with a button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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