UContentBrowserAliasDataSource

A companion to the ContentBrowserAssetDataSource which can display assets in folders other than their actual folder.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ContentBrowserAliasDataSource

Header

/Engine/Plugins/Editor/ContentBrowser/ContentBrowserAliasDataSoure/Source/ContentBrowserAliasDataSource/Public/ContentBrowserAliasDataSource.h

Include

#include "ContentBrowserAliasDataSource.h"

Syntax

UCLASS()
class UContentBrowserAliasDataSource : public UContentBrowserDataSource

Remarks

A companion to the ContentBrowserAssetDataSource which can display assets in folders other than their actual folder. Aliases mimic their source asset as closely as possible, including editing, saving, thumbnails, and more. Some behavior is restricted such as moving or deleting an alias item.

Aliases can either be created automatically by tagging the asset with the value defined by AliasTagName and giving it a comma-separated list of aliases, or manually managed by calling AddAlias and RemoveAlias. ReconcileAliasesForAsset is provided as a helper function to automatically update new/removed aliases for an existing asset.

Functions

Name Description

Public function

void

 

AddAlias

(
    const FAssetData& Asset,
    const FName Alias,
    bool bInIsFromMetaData
)

Add an alias for a given asset.

Public function

void

 

AddAliases

(
    const FAssetData& Asset,
    const TArray< FName >& Aliases,
    bool bInIsFromMetaData
)

Add a list of aliases for a given asset.

Public function

void

 

Initialize

(
    const bool InAutoRegister
)

Public function

void

 

ReconcileAliasesForAsset

(
    const FAssetData& Asset,
    const TArray< FName >& NewAliases
)

Calls AddAlias or RemoveAlias for every alias that doesn't match the stored data for the given asset.

Public function

void

 

ReconcileAliasesFromMetaData

(
    const FAssetData& Asset
)

Get all aliases from metadata for the given asset, then calls AddAlias or RemoveAlias for every alias that doesn't match the stored data.

Public function

void

 

RemoveAlias

(
    const FName ObjectPath,
    const FName Alias
)

Remove the given alias from the data source

Public function

void

 

RemoveAliases

(
    const FName ObjectPath
)

Remove all aliases for the given object

Public function

void

 

RemoveAliases

(
    const FAssetData& Asset
)

Remove all aliases for the given asset

Overridden from UContentBrowserDataSource

Name Description

Public function Virtual

bool

 

AppendItemReference

(
    const FContentBrowserItemData& InI...,
    FString& InOutStr
)

Attempt to append any path references for the given item to the given string.

Protected function Virtual

void

 

BuildRootPathVirtualTree()

Rebuilds the tree of virtual paths that ends with internal roots

Public function Virtual

bool

 

BulkEditItems

(
    TArrayView< const FContentBrowserIt...
)

Attempt to open the given item for editing.

Public function Virtual

bool

 

BulkPreviewItems

(
    TArrayView< const FContentBrowserIt...
)

Attempt to preview the given items.

Public function Virtual

bool

 

BulkSaveItems

(
    TArrayView< const FContentBrowserIt...,
    const EContentBrowserItemSaveFlags ...
)

Attempt to save the given items.

Public function Virtual

bool

 

CanEditItem

(
    const FContentBrowserItemData& InI...,
    FText* OutErrorMsg
)

Query whether the given item is can be edited, optionally providing error information if it cannot.

Public function Virtual

bool

 

CanPreviewItem

(
    const FContentBrowserItemData& InI...,
    FText* OutErrorMsg
)

Query whether the given item is can be previewed, optionally providing error information if it cannot.

Public function Virtual

bool

 

CanSaveItem

(
    const FContentBrowserItemData& InI...,
    const EContentBrowserItemSaveFlags ...,
    FText* OutErrorMsg
)

Query whether the given item is can be saved, optionally providing error information if it cannot.

Public function Virtual

void

 

CompileFilter

(
    const FName InPath,
    const FContentBrowserDataFilter& I...,
    FContentBrowserDataCompiledFilter&...
)

Given a path and a data filter, produce an optimized filter that can be used to efficiently enumerate items that match it, and also query whether an item would pass it.

Public function Virtual

bool

 

DoesItemPassFilter

(
    const FContentBrowserItemData& InI...,
    const FContentBrowserDataCompiledFi...
)

Query whether the given item passes the given compiled filter.

Public function Virtual

bool

 

EditItem

(
    const FContentBrowserItemData& InI...
)

Attempt to open the given item for editing.

Public function Virtual

void

 

EnumerateItemsAtPath

(
    const FName InPath,
    const EContentBrowserItemTypeFilter...,
    TFunctionRef< bool...
)

Enumerate items that have the given virtual path, optionally filtering by type, and invoking the callback for each matching item.

Public function Virtual

void

 

EnumerateItemsMatchingFilter

(
    const FContentBrowserDataCompiledFi...,
    TFunctionRef< bool...
)

Enumerate items that match the given compiled filter, invoking the callback for each matching item.

Public function Virtual

bool

 

GetItemAttribute

(
    const FContentBrowserItemData& InI...,
    const bool InIncludeMetaData,
    const FName InAttributeKey,
    FContentBrowserItemDataAttributeVal...
)

Query the value of the given attribute on the given item.

Public function Virtual

bool

 

GetItemAttributes

(
    const FContentBrowserItemData& InI...,
    const bool InIncludeMetaData,
    FContentBrowserItemDataAttributeVal...
)

Query the values of all attributes on the given item.

Public function Virtual

bool

 

GetItemPhysicalPath

(
    const FContentBrowserItemData& InI...,
    FString& OutDiskPath
)

Query the physical (on-disk) path of the given item.

Public function Virtual

bool

 

IsItemDirty

(
    const FContentBrowserItemData& InI...
)

Query whether the given item is considered dirty (ie, has unsaved changes).

Public function Virtual

bool

 

Legacy_TryConvertAssetDataToVirtualPath

(
    const FAssetData& InAssetData,
    const bool InUseFolderPaths,
    FName& OutPath
)

Attempt to convert the given asset data to a virtual path associated with this data source.

Public function Virtual

bool

 

Legacy_TryConvertPackagePathToVirtualPath

(
    const FName InPackagePath,
    FName& OutPath
)

Attempt to convert the given package path to a virtual path associated with this data source.

Public function Virtual

bool

 

Legacy_TryGetAssetData

(
    const FContentBrowserItemData& InI...,
    FAssetData& OutAssetData
)

Attempt to retrieve the asset data associated with the given item.

Public function Virtual

bool

 

Legacy_TryGetPackagePath

(
    const FContentBrowserItemData& InI...,
    FName& OutPackagePath
)

Legacy functions seem necessary for FrontendFilters to work.

Public function Virtual

bool

 

PreviewItem

(
    const FContentBrowserItemData& InI...
)

Attempt to preview the given item.

Public function Virtual

bool

 

SaveItem

(
    const FContentBrowserItemData& InI...,
    const EContentBrowserItemSaveFlags ...
)

Attempt to save the given item.

Public function Virtual

void

 

Shutdown()

Shutdown this data source instance.

Public function Virtual

bool

 

UpdateThumbnail

(
    const FContentBrowserItemData& InI...,
    FAssetThumbnail& InThumbnail
)

Attempt to update the thumbnail associated with the given item.

Constants

Name

Description

AliasTagName

The metadata tag to set for the AliasDataSource to automatically create aliases for an asset