Created
May 9, 2021 07:53
-
-
Save FilipSivak/c03f724a34da59a9463eba7248868047 to your computer and use it in GitHub Desktop.
Unreal - open editor utility widget by C++
This file contains hidden or 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 "EditorUtilityWidgetBlueprint.h" | |
#include "EditorUtilitySubsystem.h" | |
UObject * Blueprint = UEditorAssetLibrary::LoadAsset(FString(TEXT("EditorUtilityWidgetBlueprint'/Game/EditorUtilities/MyWidget.MyWidget'"))); | |
if(IsValid(Blueprint)) { | |
UEditorUtilityWidgetBlueprint* EditorWidget = Cast<UEditorUtilityWidgetBlueprint>(Blueprint); | |
if (IsValid(EditorWidget)) { | |
UEditorUtilitySubsystem* EditorUtilitySubsystem = GEditor->GetEditorSubsystem<UEditorUtilitySubsystem>(); | |
EditorUtilitySubsystem->SpawnAndRegisterTab(EditorWidget); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you accept paid work?