FAssetEditorToolkit

Base class for toolkits that are used for asset editing (abstract)

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/Toolkits/AssetEditorToolkit.h

Include

#include "Toolkits/AssetEditorToolkit.h"

Syntax

class FAssetEditorToolkit :
    public IAssetEditorInstance,
    public FBaseToolkit,
    public TSharedFromThis< FAssetEditorToolkit >

Remarks

Base class for toolkits that are used for asset editing (abstract)

Variables

Name Description

Protected variable

TSharedPtr< FWo...

 

AssetEditorTabsCategory

The base category that tabs are registered to, allows for child classes to register to the same point.

Protected variable

bool

 

bCheckDirtyOnAssetSave

Whether only dirty assets should be prompted about on save - otherwise all edited assets will be prompted to the user for save/check-out

Protected variable

TSharedPtr< FEd...

 

EditorModeManager

The editor mode manager

Protected variable

TArray< TShared...

 

LayoutExtenders

Array of layout extenders

Protected variable

TWeakPtr< ITool...

 

PreviousWorldCentricToolkitHost

For standalone asset editing tool-kits that were switched from world-centric mode on the fly, this stores the toolkit host (level editor) that hosted this toolkit last.

Protected variable

TSharedPtr< FTa...

 

TabManager

Controls our internal layout

Constructors

Name Description

Public function

FAssetEditorToolkit()

Default constructor

Public function

FAssetEditorToolkit

(
    const FAssetEditorToolkit&
)

Destructors

Name Description

Public function Virtual

~FAssetEditorToolkit()

Virtual destructor, so that we can clean up our app when destroyed

Functions

Name Description

Protected function Virtual

void

 

AddEditingObject

(
    UObject* Object
)

Adds an item to the Editing Objects list

Public function Virtual Const

void

 

AddGraphEditorPinActionsToContextMenu

(
    FToolMenuSection& InSection
)

Public function

void

 

AddMenuExtender

(
    TSharedPtr< FExtender > Extender
)

Adds or removes extenders to the default menu or the toolbar menu this asset editor

Public function

void

 

AddToolbarExtender

(
    TSharedPtr< FExtender > Extender
)

Public function

void

 

AddToolbarWidget

(
    TSharedRef< SWidget > Widget
)

Adds or removes widgets from the default toolbar in this asset editor

Public function Virtual

void

 

AddViewportOverlayWidget

(
    TSharedRef< SWidget > InViewportOve...
)

Called when a toolkit requests an overlay widget to be added to the viewport.

Protected function Virtual Const

void

 

BrowseDocumentation_Execute()

Called when "Browse Documentation" is clicked for this asset

Protected function Virtual Const

bool

 

CanFindInContentBrowser()

Called to test if "Find in Content Browser" should be enabled for this asset

Protected function Virtual Const

bool

 

CanReimport

(
    UObject* EditingObject
)

Called to check to see if there's an asset capable of being reimported

Protected function Virtual Const

bool

 

CanReimport()

Called to check to see if there's an asset capable of being reimported

Protected function Virtual Const

bool

 

CanSaveAsset()

Called to test if "Save" should be enabled for this asset

Protected function Virtual Const

bool

 

CanSaveAssetAs()

Called to test if "Save As" should be enabled for this asset

Public function

void

 

FillDefaultAssetMenuCommands

(
    FToolMenuSection& InSection
)

Fills in the supplied menu with commands for modifying this asset that are generally common to most asset editors

Public function

void

 

FillDefaultFileMenuCommands

(
    FToolMenuSection& InSection
)

Fills in the supplied menu with commands for working with this asset file

Public function

void

 

FillDefaultHelpMenuCommands

(
    FToolMenuSection& InSection
)

Fills in the supplied menu with commands for the help menu

Protected function Virtual

void

 

FindInContentBrowser_Execute()

Called when "Find in Content Browser" is clicked for this asset

Public function

void

 

GenerateToolbar()

Makes a default asset editing toolbar

Protected function Virtual Const

FLinearColor

 

GetDefaultTabColor()

Protected function Virtual Const

const FSlate...

 

GetDefaultTabIcon()

Protected function Virtual Const

FString

 

GetDocumentationLink()

Protected function Const

UObject *...

 

GetEditingObject()

Returns the single object currently being edited.

Protected function Const

const TArray...

 

GetEditingObjects()

Returns an array of all the objects currently being edited. Asserts if editing no objects

Public function Static

FText

 

GetLabelForObject

(
    const UObject* InObject
)

Gets the text to display in a toolkit titlebar for an object

Public function

TSharedPtr< ...

 

GetPreviousWorldCentricToolkitHost()

Protected function Virtual Const

void

 

GetSaveableObjects

(
    TArray< UObject* >& OutObject...
)

Get the collection of edited objects that can be saved.

Public function Static

TSharedPtr< ...

 

GetSharedMenuExtensibilityManager()

Returns the default extensibility managers, these are applied for all asset types

Public function Static

TSharedPtr< ...

 

GetSharedToolBarExtensibilityManager()

Public function

TSharedPtr< ...

 

GetTabManager()

Public function Const

FName

 

GetToolMenuAppName()

Public function Const

FName

 

GetToolMenuName()

Public function Virtual Const

FName

 

GetToolMenuToolbarName

(
    FName& OutParentName
)

Get name used by tool menu

Public function Const

FName

 

GetToolMenuToolbarName()

Public function Static

FText

 

GetToolTipTextForObject

(
    const UObject* InObject
)

Gets the text to display in a toolkit tooltip for an object

Protected function Const

bool

 

HasEditingObject()

Returns true if this toolkit has any objects being edited

Public function

void

 

InitAssetEditor

(
    const EToolkitMode::Type Mode,
    const TSharedPtr< IToolkitHost >& ...,
    const FName AppIdentifier,
    const TSharedRef< FTabManager::FLay...,
    const bool bCreateDefaultStandalone...,
    const bool bCreateDefaultToolbar,
    const TArray< UObject* >& Obj...,
    const bool bInIsToolbarFocusable,
    const bool bInUseSmallToolbarIcons
)

Initializes this asset editor.

Public function

void

 

InitAssetEditor

(
    const EToolkitMode::Type Mode,
    const TSharedPtr< IToolkitHost >& ...,
    const FName AppIdentifier,
    const TSharedRef< FTabManager::FLay...,
    const bool bCreateDefaultStandalone...,
    const bool bCreateDefaultToolbar,
    UObject* ObjectToEdit,
    const bool bInIsToolbarFocusable,
    const bool bInUseSmallToolbarIcons
)

Initializes this asset editor.

Public function Virtual

void

 

InitToolMenuContext

(
    FToolMenuContext& MenuContext
)

Public function Virtual

void

 

InvokeTab

(
    const FTabId& TabId
)

Public function Const

bool

 

IsActuallyAnAsset()

True if this actually is editing an asset

Protected function Virtual

void

 

OnClose()

Called when this toolkit is being closed

Protected function Virtual

bool

 

OnRequestClose()

Called when this toolkit is requested to close. Returns false if closing should be prevented.

Public function Virtual

void

 

OnToolkitHostingFinished

(
    const TSharedRef< IToolkit >& Tool...
)

Called when another toolkit (such as a ed mode toolkit) is no longer being hosted in this asset editor toolkit.

Public function Virtual

void

 

OnToolkitHostingStarted

(
    const TSharedRef< IToolkit >& Tool...
)

Called when another toolkit (such as a ed mode toolkit) is being hosted in this asset editor toolkit.

Protected function Virtual

void

 

PostInitAssetEditor()

Perform any initialization that should happen after the basic toolkit needs are created for the asset editor.

Public function Virtual

void

 

PostRegenerateMenusAndToolbars()

Called at the end of RegenerateMenusAndToolbars()

Public function

void

 

RegenerateMenusAndToolbars()

Regenerates the menubar and toolbar widgets

Public function Static

void

 

RegisterDefaultToolBar()

Registers default tool bar

Public function

void

 

RegisterDrawer

(
    FStatusBarDrawer&& Drawer,
    int32 SlotIndex
)

Registers a drawer for the asset editor status bar

Protected function Virtual

void

 

Reimport_Execute()

Called when "Reimport" is clicked for this asset

Protected function Virtual

void

 

Reimport_Execute

(
    UObject* EditingObject
)

Called when "Reimport" is clicked for this asset

Public function

void

 

RemoveAllToolbarWidgets()

Protected function Virtual

void

 

RemoveEditingObject

(
    UObject* Object
)

Removes an item from the Editing Objects list

Public function

void

 

RemoveMenuExtender

(
    TSharedPtr< FExtender > Extender
)

Public function

void

 

RemoveToolbarExtender

(
    TSharedPtr< FExtender > Extender
)

Public function Virtual

void

 

RemoveViewportOverlayWidget

(
    TSharedRef< SWidget > InViewportOve...
)

Called when a toolkit requests the overlay widget to be removed.

Public function

void

 

RestoreFromLayout

(
    const TSharedRef< FTabManager::FLay...
)

Applies the passed in layout (or the saved user-modified version if available).

Protected function Virtual

void

 

SaveAsset_Execute()

Called when "Save" is clicked for this asset

Protected function Virtual

void

 

SaveAssetAs_Execute()

Called when "Save As" is clicked for this asset

Public function

void

 

SetMenuOverlay

(
    TSharedRef< SWidget > Widget
)

Allows the caller to set a menu overlay, displayed to the far right of the editor's menu bar

Public function Static

void

 

SetPreviousWorldCentricToolkitHostForNewAssetEditor

(
    TSharedRef< IToolkitHost > ToolkitH...
)

Static: Used internally to set the world-centric toolkit host for a newly-created standalone asset editing toolkit

Protected function Virtual Const

bool

 

ShouldPromptForNewFilesOnReload

(
    const UObject& object
)

Called to determine if the user should be prompted for a new file if one is missing during an asset reload

Protected function Static

void

 

SwitchToStandaloneEditor_Execute

(
    TWeakPtr< FAssetEditorToolkit > Thi...
)

Static: Called when "Switch to Standalone Editor" is clicked for the asset editor

Protected function Static

void

 

SwitchToWorldCentricEditor_Execute

(
    TWeakPtr< FAssetEditorToolkit > Thi...
)

Static: Called when "Switch to World-Centric Editor" is clicked for the asset editor

Overridden from IAssetEditorInstance

Overridden from FBaseToolkit

Name Description

Protected function Virtual

void

 

CreateEditorModeManager()

Creates the Editor mode manager for your class. Default is to create none, for legacy reasons.

Overridden from IToolkit

Name Description

Public function Const

FText

 

GetBaseToolkitName()

Returns the localized name of this toolkit type (typically just " editor")

Public function Virtual Const

FEditorModeT...

 

GetEditorModeManager()

Gets the mode manager for this toolkit

Public function Virtual Const

const TArray...

 

GetObjectsCurrentlyBeingEdited()

For asset editor toolkits, returns the UObjects for the assets currently being edited

Public function Virtual Const

FText

 

GetTabSuffix()

Returns the localized tab suffix

Public function Const

FName

 

GetToolkitFName()

Returns the invariant name of this toolkit type

Public function Virtual Const

FText

 

GetToolkitName()

Returns the localized name of this toolkit

Public function Virtual Const

FText

 

GetToolkitToolTipText()

Returns the localized tooltip text of this toolkit

Public function Const

FString

 

GetWorldCentricTabPrefix()

Returns the localize prefix string to use for tab labels in world-centric mode.

Public function Virtual Const

bool

 

IsAssetEditor()

Returns true if this toolkit is used to edit assets (even if it's not necessarily editing one right now.)

Public function Virtual

void

 

RegisterTabSpawners

(
    const TSharedRef< FTabManager >& T...
)

IToolkit interface

Public function Virtual

void

 

UnregisterTabSpawners

(
    const TSharedRef< FTabManager >& T...
)

Unregister tabs that this toolkit can spawn

Operators

Name Description

Public function

FAssetEditor...

 

operator=

(
    const FAssetEditorToolkit&
)

Constants

Name

Description

DefaultAssetEditorToolBarName

PreviousWorldCentricToolkitHostForNewAssetEditor

Static: World centric toolkit host to use for the next created asset editing toolkit

SharedMenuExtensibilityManager

The extensibility managers shared by all asset types

SharedToolBarExtensibilityManager

Deprecated Variables

Name Description

Protected variable

FAssetEditorMod...

 

AssetEditorModeManager

Use EditorModeManager instead.

Deprecated Functions

Name Description

Public function Const

FAssetEditor...

 

GetAssetEditorModeManager()

Use GetEditorModeManager instead.

Public function

void

 

SetAssetEditorModeManager

(
    FAssetEditorModeManager* InMod...
)

Override CreateEditorModeManager on the toolkit class instead.

This API reference document refers to UE 5.1 or earlier. API docs for 5.2 or later are currently being finalized and will be available at a later date.