UContentBrowserAssetContextMenuContext

Unreal Engine C++ API Reference > Editor > ContentBrowser

Inheritance Hierarchy

References

   
Module ContentBrowser
Header /Engine/Source/Editor/ContentBrowser/Public/ContentBrowserMenuContexts.h
Include #include "ContentBrowserMenuContexts.h"

Syntax

class UContentBrowserAssetContextMenuContext : public [UObject](API\Runtime\CoreUObject\UObject\UObject)  

Variables

Type Name Description
TWeakPtr< FAsse... AssetContextMenu  
bool bCanBeModified  
bool bContainsUnsupportedAssets  
bool bHasCookedPackages  
TObjectPtr< con... CommonAssetDefinition  
TObjectPtr< UCl... CommonClass  
TArray< FAssetD... SelectedAssets The currently selected assets in the content browser.

Functions

Type Name Description
const UConte... FindContextWithAssets ( const MenuOrSectionType& MenuOrSec... ) Finds the Content Browser MenuContext from a Menu or Section, and returns the context provided there are some selected assets.
int32 GetNumAssetsSelected ( const MenuOrSectionType& MenuOrSec... )  
TArray< TSof... GetSelectedAssetSoftObjects ( EIncludeSubclasses IncludeSubclasse... ) Get the selected assets as an array of SoftObjectPtr's.
TArray< FAss... GetSelectedAssetsOfType ( const UClass* AssetClass, EIncludeSubclasses IncludeSubclasse... ) Returns a filtered array of assets that are of the desired class and potentially any subclasses.
const TArray... GetSelectedItems () Read-only access to the list of currently selected items
TArray< Expe... GetSelectedObjectsInMemory ()  
const FAsset... GetSingleSelectedAssetOfType ( const UClass* AssetClass, EIncludeSubclasses IncludeSubclasse... ) Sometimes you want to write actions that will only operate on a singular selected asset, in those cases you can use the following function which will only return a live ptr if it's an instance of that asset type, and only one thing is selected.
ExpectedAsse... LoadFirstSelectedObject ( const TSet< FName >& LoadTags ) Loads the first selected valid asset and returns it.
TArray< UObj... LoadSelectedObjects ( TSet< FName > LoadTags ) Loads all the selected assets and returns an array of the objects.
TArray< Expe... LoadSelectedObjects ( TSet< FName > LoadTags ) Loads all the selected assets and returns an array of the ExpectedAssetType.
TArray< Expe... LoadSelectedObjectsIf ( TFunctionRef< bool(const FAssetData... ) Loads the selected assets if the PredicateFilter returns true, and returns an array of the objects.
TArray< Expe... LoadSelectedObjectsIf ( TSet< FName > LoadTags, TFunctionRef< bool(const FAssetData... ) Loads the selected assets if the PredicateFilter returns true, and returns an array of the objects.
TArray< UObj... LoadSelectedObjectsIfNeeded () Loads the selected assets (if needed) which is based on AssetViewUtils::LoadAssetsIfNeeded, this exists primarily for backwards compatability.
ExpectedType... LoadSingleSelectedAsset ( const MenuOrSectionType& MenuOrSec... )  

Deprecated Variables

Type Name Description
TWeakPtr< IAsse... CommonAssetTypeActions IAssetTypeActions (CommonAssetTypeActions) is being phased out too much menu related stuff was built into their design that forced loading assets. Please use UAssetDefinition (CommonAssetDefinition).
TArray< TWeakOb... SelectedObjects Use SelectedAssets now, this field will not contain any objects. You should call LoadSelectedObjects() based on what you need.

Deprecated Functions

Type Name Description
TArray< UObj... GetSelectedObjects () GetSelectedObjects has been deprecated. We no longer automatically load assets on right click. Please use SelectedAssets and determine whatever you need for your context menu options without actually loading the assets. When you finally need all or a subset of the selected assets use LoadSelectedAssets or LoadSelectedAssetsIf

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library