Navigation
API > API/Plugins > API/Plugins/EditorScriptingUtilities
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UBlueprintFunctionLibrary
- UEditorAssetLibrary
References
| Module | EditorScriptingUtilities |
| Header | /Engine/Plugins/Editor/EditorScriptingUtilities/Source/EditorScriptingUtilities/Public/EditorAssetLibrary.h |
| Include | #include "EditorAssetLibrary.h" |
Syntax
UCLASS&40;&41;
class UEditorAssetLibrary : public UBlueprintFunctionLibrary
Remarks
Utility class to do most of the common functionalities with the ContentBrowser. The AssetRegistryHelpers class has more complex utilities. Use FindAssetData to get a FAssetData from an Asset Path. The Asset Path can be represented by ie. (Reference/Text Path) StaticMesh'/Game/MyFolder/MyAsset.MyAsset' ie. (Full Name) StaticMesh /Game/MyFolder/MyAsset.MyAsset ie. (Path Name) /Game/MyFolder/MyAsset.MyAsset ie. (Package Name) /Game/MyFolder/MyAsset The Directory Path can be represented by ie. /Game/MyNewFolder/ ie. /Game/MyNewFolder All operations can be slow. The editor should not be in play in editor mode. It will not work on assets of the type level.
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | CheckoutAsset
(
const FString& AssetToCheckout |
Checkout the asset from the Content Browser. | |
| bool | CheckoutDirectory
(
const FString& DirectoryPath, |
Checkout assets from the Content Browser. | |
| bool | CheckoutLoadedAsset
(
UObject* AssetToCheckout |
Checkout the asset from the Content Browser. Checkout operations | |
| bool | CheckoutLoadedAssets
(
const TArray< UObject* >& AssetsToCheckout |
Checkout the assets from the Content Browser. | |
| bool | ConsolidateAssets
(
UObject* AssetToConsolidateTo, |
Consolidates an asset by replacing all references/uses of the provided AssetsToConsolidate with references to AssetToConsolidateTo. | |
| bool | DeleteAsset
(
const FString& AssetPathToDelete |
Delete the package the assets live in. | |
| bool | DeleteDirectory
(
const FString& DirectoryPath |
Delete the packages inside a directory. | |
| bool | DeleteLoadedAsset
(
UObject* AssetToDelete |
Delete an asset from the Content Browser that is already loaded. | |
| bool | DeleteLoadedAssets
(
const TArray< UObject* >& AssetsToDelete |
Delete assets from the Content Browser that are already loaded. | |
| bool | DoAssetsExist
(
const TArray< FString >& AssetPaths |
Check if the assets exist in the Content Browser. | |
| bool | DoesAssetExist
(
const FString& AssetPath |
Check if the asset exists in the Content Browser. | |
| bool | DoesDirectoryExist
(
const FString& DirectoryPath |
Check is the directory exist in the Content Browser. Directory operations | |
| bool | DoesDirectoryHaveAssets
(
const FString& DirectoryPath, |
Check if there any asset that exist in the directory. | |
| UObject * | DuplicateAsset
(
const FString& SourceAssetPath, |
Duplicate an asset from the Content Browser. | |
| bool | DuplicateDirectory
(
const FString& SourceDirectoryPath, |
Duplicate asset from the Content Browser that are in the folder. | |
| UObject * | DuplicateLoadedAsset
(
UObject* SourceAsset, |
Duplicate an asset from the Content Browser that is already loaded. | |
| FAssetData | FindAssetData
(
const FString& AssetPath |
Return the AssetData for the Asset that can then be used with the more complex lib AssetRegistryHelpers. | |
| TArray< FString > | FindPackageReferencersForAsset
(
const FString& AssetPath, |
Find Package Referencers for an asset. | |
| FString | GetMetadataTag
(
UObject* Object, |
Get the value associated with the given tag of a loaded asset's metadata. | |
| TMap< FName, FString > | GetMetadataTagValues
(
UObject* Object |
Get all tags/values of a loaded asset's metadata. | |
| FString | GetPathNameForLoadedAsset
(
UObject* LoadedAsset |
Return a valid AssetPath for a loaded asset. | |
| TMap< FName, FString > | GetTagValues
(
const FString& AssetPath |
Gets all TagValues (from Asset Registry) associated with an (unloaded) asset as strings value. | |
| TArray< FString > | ListAssetByTagValue
(
FName TagName, |
Return the list of all the assets that have the pair of Tag/Value. | |
| TArray< FString > | ListAssets
(
const FString& DirectoryPath, |
Return the list of all the assets found in the DirectoryPath. List operations | |
| UObject * | Load an asset from the Content Browser. | ||
| UClass * | LoadBlueprintClass
(
const FString& AssetPath |
Load a Blueprint asset from the Content Browser and return its generated class. | |
| bool | MakeDirectory
(
const FString& DirectoryPath |
Create the directory on disk and in the Content Browser. | |
| void | RemoveMetadataTag
(
UObject* Object, |
Remove the given tag from a loaded asset's metadata. | |
| bool | RenameAsset
(
const FString& SourceAssetPath, |
Rename an asset from the Content Browser. | |
| bool | RenameDirectory
(
const FString& SourceDirectoryPath, |
Rename assets from the Content Browser that are in the folder. | |
| bool | RenameLoadedAsset
(
UObject* SourceAsset, |
Rename an asset from the Content Browser that is already loaded. | |
| bool | Save the packages the assets live in. | ||
| bool | SaveDirectory
(
const FString& DirectoryPath, |
Save the packages the assets live in inside the directory. | |
| bool | SaveLoadedAsset
(
UObject* AssetToSave, |
Save the packages the assets live in. | |
| bool | SaveLoadedAssets
(
const TArray< UObject* >& AssetsToSave, |
Save the packages the assets live in. | |
| void | SetMetadataTag
(
UObject* Object, |
Set the value associated with a given tag of a loaded asset's metadata. | |
| void | SyncBrowserToObjects
(
const TArray< FString >& AssetPaths |
Sync the Content Browser to the given asset(s) |