Navigation
API > API/Editor > API/Editor/ContentBrowser
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UContentBrowserAssetContextMenuContext
References
| Module | ContentBrowser |
| Header | /Engine/Source/Editor/ContentBrowser/Public/ContentBrowserMenuContexts.h |
| Include | #include "ContentBrowserMenuContexts.h" |
Syntax
class UContentBrowserAssetContextMenuContext : public UObject
Variables
| Type | Name | Description | |
|---|---|---|---|
| TWeakPtr< FAssetContextMenu > | AssetContextMenu | ||
| bool | bCanBeModified | ||
| bool | bContainsUnsupportedAssets | ||
| bool | bHasCookedPackages | ||
| TObjectPtr< const UAssetDefinition > | CommonAssetDefinition | ||
| TObjectPtr< UClass > | CommonClass | ||
| TArray< FAssetData > | SelectedAssets | The currently selected assets in the content browser. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| const UContentBrowserAssetContextMenuContext * | FindContextWithAssets
(
const MenuOrSectionType& MenuOrSection |
Finds the Content Browser MenuContext from a Menu or Section, and returns the context provided there are some selected assets. | |
| int32 | GetNumAssetsSelected
(
const MenuOrSectionType& MenuOrSection |
||
| TArray< TSoftObjectPtr< ExpectedAssetType > > | GetSelectedAssetSoftObjects
(
EIncludeSubclasses IncludeSubclasses |
Get the selected assets as an array of SoftObjectPtr |
|
| TArray< FAssetData > | GetSelectedAssetsOfType
(
const UClass* AssetClass, |
Returns a filtered array of assets that are of the desired class and potentially any subclasses. | |
| const TArray< FContentBrowserItem > & | Read-only access to the list of currently selected items | ||
| TArray< ExpectedAssetType * > | |||
| const FAssetData * | GetSingleSelectedAssetOfType
(
const UClass* AssetClass, |
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. | |
| ExpectedAssetType * | LoadFirstSelectedObject
(
const TSet< FName >& LoadTags |
Loads the first selected valid asset and returns it. | |
| TArray< UObject * > | LoadSelectedObjects
(
TSet< FName > LoadTags |
Loads all the selected assets and returns an array of the objects. | |
| TArray< ExpectedAssetType * > | LoadSelectedObjects
(
TSet< FName > LoadTags |
Loads all the selected assets and returns an array of the ExpectedAssetType. | |
| TArray< ExpectedAssetType * > | LoadSelectedObjectsIf
(
TFunctionRef< bool(const FAssetData&AssetData)> PredicateFilter |
Loads the selected assets if the PredicateFilter returns true, and returns an array of the objects. | |
| TArray< ExpectedAssetType * > | LoadSelectedObjectsIf
(
TSet< FName > LoadTags, |
Loads the selected assets if the PredicateFilter returns true, and returns an array of the objects. | |
| TArray< UObject * > | Loads the selected assets (if needed) which is based on AssetViewUtils::LoadAssetsIfNeeded, this exists primarily for backwards compatability. | ||
| ExpectedType * | LoadSingleSelectedAsset
(
const MenuOrSectionType& MenuOrSection |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| TWeakPtr< IAssetTypeActions > | 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< TWeakObjectPtr< UObject > > | 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< UObject * > | 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 |