Keywords: UE4, Editor Extention and Programming


UE4 - Easy example of How to create menus in the editor

UE4 Level Editor

Creating an Editor Module

Customizing the editor’s toolbar buttons menu via custom plugin

UE4 Editor Toolbar Extention

batch operations with editor utility blueprints in UE4

How to set display index / order of property in Editor


UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (DisplayPriority = "1"))
    int32 Value1 = -1;

UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (DisplayPriority = "2"))
    int32 Value1 = -1;

Metadata Specifiers

Editor Event

Properties changed event

virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;

Actor moved event

/** Called after an actor has been moved in the editor */
virtual void PostEditMove(bool bFinished);
How to customize Transform of Actor in Editor

Header: Add VisibleAnywhere on properties.

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = CameraEvent)
    UBoxComponent* BoxComp;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = CameraEvent)
    UArrowComponent* DirectionComp;


BoxComp = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxComp"));

DirectionComp = CreateDefaultSubobject<UArrowComponent>(TEXT("TriggerDirectionComp"));

In Bluerpint Editor:

In Level Editor:

In Bluerpint Editor, you can’t modify Location and Rotation of RootComponent, but you can modify them in Level Editor.

How to spawn actor in Editor (Level Editor)


AActor* newActor = GEditor->AddActor(
    GEditor->GetLevelViewportClients()[0]->GetWorld()->GetCurrentLevel(), AMyActorClass, MyTransform);
// modify properties on newActor

How to limit the lenght of array in Actor Blueprint editor.

Add EditFixedSize in the property:

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config", EditFixedSize)
TArray<int32> IdList;

Then initilize array in constructor.

    IdList.Init(0, 5);
How to creat editor widget using C++

UE4 – C++ Editor Utility Widgets (4.22)

Blueprint EditorUtilityWidget Can’t inherit custom cpp class.
Modify MyPlugin.uplugin.

"Modules": [
        "Name": "MyExtender",
        "Type": "Runtime",
        "LoadingPhase": "Default"


"Modules": [
        "Name": "CppEditorWidget",
        "Type": "Editor",
        "LoadingPhase": "PostEngineInit"

Then delete all intermediate files and re-generate project files.

How to open the Windows file explorer (open directory dialog) to select the file


void UMyUserWidget::OnTestBtnClicked()
    TSharedPtr<SWindow> ParentWindow = FSlateApplication::Get().FindWidgetWindow(TakeWidget());
    void* ParentWindowHandle = (ParentWindow.IsValid() && ParentWindow->GetNativeWindow().IsValid()) ? ParentWindow->GetNativeWindow()->GetOSWindowHandle() : nullptr;
    IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
    if (DesktopPlatform)
        const FString ContentDireAbsolute = FPaths::ConvertRelativePathToFull(FPaths::ProjectConfigDir());
        FString OutDire;
        DesktopPlatform->OpenDirectoryDialog(ParentWindowHandle, TEXT("Choose Folder"), ContentDireAbsolute, OutDire);
        GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Cyan, OutDire);

Select files dialog:

 * Opens a file dialog for the specified data. Leave FileTypes empty to be able to select any files.
 * Filetypes must be in the format of: <File type Description>|*.<actual extension>
 * You can combine multiple extensions by placing ";" between them
 * For example: Text Files|*.txt|Excel files|*.csv|Image Files|*.png;*.jpg;*.bmp will display 3 lines for 3 different type of files.

TArray<FString> OutFileNames;

//Opening the file picker!
uint32 SelectionFlag = 0; //A value of 0 represents single file selection while a value of 1 represents multiple file selection
DesktopPlatform->OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, FString(""), FileTypes, SelectionFlag, OutFileNames);


How to add customized tips bar in editor

Quoted from Engine\Source\Runtime\Engine\Private\ShaderCompiler\ShaderCompiler.cpp

FText StatusUpdate;
    if ( MaterialName != NULL )
        FFormatNamedArguments Args;
        Args.Add( TEXT("MaterialName"), FText::FromString( MaterialName ) );
        StatusUpdate = FText::Format( NSLOCTEXT("ShaderCompilingManager", "CompilingShadersForMaterialStatus", "Compiling shaders: {MaterialName}..."), Args );
        StatusUpdate = NSLOCTEXT("ShaderCompilingManager", "CompilingShadersStatus", "Compiling shaders...");

    FScopedSlowTask SlowTask(1, StatusUpdate, GIsEditor && !IsRunningCommandlet());
How to add customized progress bar in editor


FText Description = NSLOCTEXT("UnrealEd", "PerformingCSGOperation", "Performing CSG operation");
GWarn->BeginSlowTask( Description, true );



References: UHCsgUtils::ComposeBrushCSG in HoudiniEngine

Testing & Optimization

Testing Automation

Automation System Overview, Overview of the automation system used for unit testing, feature testing, and content stress testing.

静水流深(Still Water Runs Deep) ---拉丁谚语