UEditorLevelLibrary

Utility class to do most of the common functionalities in the World Editor.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

EditorScriptingUtilities

Header

/Engine/Plugins/Editor/EditorScriptingUtilities/Source/EditorScriptingUtilities/Public/EditorLevelLibrary.h

Include

#include "EditorLevelLibrary.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)()
class UEditorLevelLibrary : public UBlueprintFunctionLibrary

Remarks

Utility class to do most of the common functionalities in the World Editor. The editor should not be in play in editor mode.

Functions

Name Description

Public function Static UFunction BlueprintCallable, Category

void

 

ClearActorSelectionSet()

Remove all actors from the selection set.

Public function Static UFunction BlueprintCallable, Category, Meta

TArray< clas...

 

ConvertActors

(
    const TArray< class AActor* > ...,
    TSubclassOf< class AActor > ActorCl...,
    const FString& StaticMeshPackagePa...
)

Replace in the level all Actors provided with a new actor of type ActorClass.

Public function Static UFunction BlueprintCallable, Category

bool

 

CreateProxyMeshActor

(
    const TArray< class AStaticMeshActo...,
    const FEditorScriptingCreateProxyMe...,
    AStaticMeshActor*& OutMergedAc...
)

Build a proxy mesh actor that can replace a set of mesh actors.

Public function Static UFunction BlueprintCallable, Category

bool

 

DestroyActor

(
    AActor* ActorToDestroy
)

Destroy the actor from the world editor. Notify the Editor that the actor got destroyed.

Public function Static UFunction BlueprintCallable, Category, Meta

void

 

EditorInvalidateViewports()

Public function Static UFunction BlueprintCallable, Category, Meta

void

 

EditorPlaySimulate()

Public function Static UFunction BlueprintCallable, Category, Meta

void

 

EditorSetGameView

(
    bool bGameView
)

Public function Static UFunction BlueprintCallable, Category, Meta

void

 

EjectPilotLevelActor()

Public function Static UFunction BlueprintPure, Category

AActor *

 

GetActorReference

(
    FString PathToActor
)

Attempts to find the actor specified by PathToActor in the current editor world

Public function Static UFunction BlueprintCallable, Category

TArray< clas...

 

GetAllLevelActors()

Find all loaded Actors in the world editor.

Public function Static UFunction BlueprintCallable, Category

TArray< clas...

 

GetAllLevelActorsComponents()

Find all loaded ActorComponent own by an actor in the world editor.

Public function Static UFunction BlueprintCallable, Category

UWorld *

 

GetEditorWorld()

Find the World in the world editor.

Public function Static UFunction BlueprintCallable, Category

UWorld *

 

GetGameWorld()

Public function Static UFunction BlueprintPure, Category

bool

 

GetLevelViewportCameraInfo

(
    FVector& CameraLocation,
    FRotator& CameraRotation
)

Gets information about the camera position for the primary level editor viewport.

Public function Static UFunction BlueprintCallable, Category

TArray< clas...

 

GetSelectedLevelActors()

Find all loaded Actors that are selected in the world editor.

Public function Static UFunction BlueprintCallable, Category

AActor *

 

JoinStaticMeshActors

(
    const TArray< class AStaticMeshActo...,
    const FEditorScriptingJoinStaticMes...
)

Create a new Actor in the level that contains a duplicate of all the Actors Static Meshes Component.

Public function Static UFunction BlueprintCallable, Category

bool

 

LoadLevel

(
    const FString& AssetPath
)

Close the current Persistent Level (without saving it). Loads the specified level.

Public function Static UFunction BlueprintCallable, Category

bool

 

MergeStaticMeshActors

(
    const TArray< class AStaticMeshActo...,
    const FEditorScriptingMergeStaticMe...,
    AStaticMeshActor*& OutMergedAc...
)

Merge the meshes into a unique mesh with the provided StaticMeshActors.

Public function Static UFunction BlueprintCallable, Category

bool

 

NewLevel

(
    const FString& AssetPath
)

Close the current Persistent Level (without saving it).

Public function Static UFunction BlueprintCallable, Category

bool

 

NewLevelFromTemplate

(
    const FString& AssetPath,
    const FString& TemplateAssetPath
)

Close the current Persistent Level (without saving it).

Public function Static UFunction BlueprintCallable, Category, Meta

void

 

PilotLevelActor

(
    AActor* ActorToPilot
)

Public function Static UFunction BlueprintCallable, Category

void

 

ReplaceMeshComponentsMaterials

(
    const TArray< class UMeshComponent ...,
    UMaterialInterface* MaterialTo...,
    UMaterialInterface* NewMateria...
)

Find the references of the material MaterialToReplaced on all the MeshComponents provided and replace it by NewMaterial.

Public function Static UFunction BlueprintCallable, Category

void

 

ReplaceMeshComponentsMaterialsOnActors

(
    const TArray< class AActor* > ...,
    UMaterialInterface* MaterialTo...,
    UMaterialInterface* NewMateria...
)

Find the references of the material MaterialToReplaced on all the MeshComponents of all the Actors provided and replace it by NewMaterial.

Public function Static UFunction BlueprintCallable, Category

void

 

ReplaceMeshComponentsMeshes

(
    const TArray< class UStaticMeshComp...,
    UStaticMesh* MeshToBeReplaced,
    UStaticMesh* NewMesh
)

Find the references of the mesh MeshToBeReplaced on all the MeshComponents provided and replace it by NewMesh.

Public function Static UFunction BlueprintCallable, Category

void

 

ReplaceMeshComponentsMeshesOnActors

(
    const TArray< class AActor* > ...,
    UStaticMesh* MeshToBeReplaced,
    UStaticMesh* NewMesh
)

Find the references of the mesh MeshToBeReplaced on all the MeshComponents of all the Actors provided and replace it by NewMesh.

Public function Static UFunction BlueprintCallable, Category

bool

 

SaveAllDirtyLevels()

Saves all Level currently loaded by the World Editor.

Public function Static UFunction BlueprintCallable, Category

bool

 

SaveCurrentLevel()

Saves the specified Level. Must already be saved at lease once to have a valid path.

Public function Static UFunction BlueprintCallable, Category

void

 

SelectNothing()

Selects nothing in the editor (another way to clear the selection)

Public function Static UFunction BlueprintCallable, Category

void

 

SetActorSelectionState

(
    AActor* Actor,
    bool bShouldBeSelected
)

Set the selection state for the selected actor.

Public function Static UFunction BlueprintCallable, Category

bool

 

SetCurrentLevelByName

(
    FName LevelName
)

Set the current level used by the world editor.

Public function Static UFunction BlueprintCallable, Category

void

 

SetLevelViewportCameraInfo

(
    FVector CameraLocation,
    FRotator CameraRotation
)

Sets information about the camera position for the primary level editor viewport.

Public function Static UFunction BlueprintCallable, Category

void

 

SetSelectedLevelActors

(
    const TArray< class AActor* > ...
)

Clear the current world editor selection and select the provided actors.

Public function Static UFunction BlueprintCallable, Category, Meta

AActor *

 

SpawnActorFromClass

(
    TSubclassOf< class AActor > ActorCl...,
    FVector Location,
    FRotator Rotation
)

Create an actor and place it in the world editor.

Public function Static UFunction BlueprintCallable, Category

AActor *

 

SpawnActorFromObject

(
    UObject* ObjectToUse,
    FVector Location,
    FRotator Rotation
)

Create an actor and place it in the world editor.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss