Navigation
API > API/Plugins > API/Plugins/EditorScriptingUtilities
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.
| Name | UEditorAssetLibrary |
| Type | class |
| Header File | /Engine/Plugins/Editor/EditorScriptingUtilities/Source/EditorScriptingUtilities/Public/EditorAssetLibrary.h |
| Include Path | #include "EditorAssetLibrary.h" |
Syntax
UCLASS ()
class UEditorAssetLibrary : public UBlueprintFunctionLibrary
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UBlueprintFunctionLibrary → UEditorAssetLibrary
Functions
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool CheckoutAsset
(
const FString& AssetToCheckout |
Checkout the asset from the Content Browser. | EditorAssetLibrary.h |
|
static bool CheckoutDirectory
(
const FString& DirectoryPath, |
Checkout assets from the Content Browser. | EditorAssetLibrary.h |
|
static bool CheckoutLoadedAsset
(
UObject* AssetToCheckout |
Checkout the asset from the Content Browser. Checkout operations | EditorAssetLibrary.h |
|
| Checkout the assets from the Content Browser. | EditorAssetLibrary.h |
|
|
static bool ConsolidateAssets
(
UObject* AssetToConsolidateTo, |
Consolidates an asset by replacing all references/uses of the provided AssetsToConsolidate with references to AssetToConsolidateTo. | EditorAssetLibrary.h |
|
static bool DeleteAsset
(
const FString& AssetPathToDelete |
Delete the package the assets live in. | EditorAssetLibrary.h |
|
static bool DeleteDirectory
(
const FString& DirectoryPath |
Delete the packages inside a directory. | EditorAssetLibrary.h |
|
static bool DeleteLoadedAsset
(
UObject* AssetToDelete |
Delete an asset from the Content Browser that is already loaded. | EditorAssetLibrary.h |
|
static bool DeleteLoadedAssets
(
const TArray< UObject* >& AssetsToDelete |
Delete assets from the Content Browser that are already loaded. | EditorAssetLibrary.h |
|
static bool DoAssetsExist
(
const TArray< FString >& AssetPaths |
Check if the assets exist in the Content Browser. | EditorAssetLibrary.h |
|
static bool DoesAssetExist
(
const FString& AssetPath |
Check if the asset exists in the Content Browser. | EditorAssetLibrary.h |
|
static bool DoesDirectoryExist
(
const FString& DirectoryPath |
Check is the directory exist in the Content Browser. Directory operations | EditorAssetLibrary.h |
|
static bool DoesDirectoryHaveAssets
(
const FString& DirectoryPath, |
Check if there any asset that exist in the directory. | EditorAssetLibrary.h |
|
static UObject * DuplicateAsset
(
const FString& SourceAssetPath, |
Duplicate an asset from the Content Browser. | EditorAssetLibrary.h |
|
static bool DuplicateDirectory
(
const FString& SourceDirectoryPath, |
Duplicate asset from the Content Browser that are in the folder. | EditorAssetLibrary.h |
|
static UObject * DuplicateLoadedAsset
(
UObject* SourceAsset, |
Duplicate an asset from the Content Browser that is already loaded. | EditorAssetLibrary.h |
|
static FAssetData FindAssetData
(
const FString& AssetPath |
Return the AssetData for the Asset that can then be used with the more complex lib AssetRegistryHelpers. | EditorAssetLibrary.h |
|
static TArray< FString > FindPackageReferencersForAsset
(
const FString& AssetPath, |
Find Package Referencers for an asset. | EditorAssetLibrary.h |
|
| Get the value associated with the given tag of a loaded asset's metadata. | EditorAssetLibrary.h |
|
|
| Get all tags/values of a loaded asset's metadata. | EditorAssetLibrary.h |
|
|
| Returns the object's containing package | EditorAssetLibrary.h |
|
|
static FString GetPathNameForLoadedAsset
(
UObject* LoadedAsset |
Return a valid AssetPath for a loaded asset. | EditorAssetLibrary.h |
|
static FString GetProjectRootAssetDirectory () |
Historically, all project assets were stored in the logical "/Game/" directory when using plugins or UEFN projects, we want to ease asset reuse, and so the ambiguous "/Game/" directory is untenable. | EditorAssetLibrary.h |
|
| Gets all TagValues (from Asset Registry) associated with an (unloaded) asset as strings value. | EditorAssetLibrary.h |
|
|
| Return the list of all the assets that have the pair of Tag/Value. | EditorAssetLibrary.h |
|
|
static TArray< FString > ListAssets
(
const FString& DirectoryPath, |
Return the list of all the assets found in the DirectoryPath. List operations | EditorAssetLibrary.h |
|
| Load an asset from the Content Browser. | EditorAssetLibrary.h |
|
|
static UClass * LoadBlueprintClass
(
const FString& AssetPath |
Load a Blueprint asset from the Content Browser and return its generated class. | EditorAssetLibrary.h |
|
static bool MakeDirectory
(
const FString& DirectoryPath |
Create the directory on disk and in the Content Browser. | EditorAssetLibrary.h |
|
static void OverrideProjectRootAssetDirectory
(
FStringView InProjectRootAssetDirectory |
These are intentionally not exposed to scripts, used by editor state machines: | EditorAssetLibrary.h | |
| Remove the given tag from a loaded asset's metadata. | EditorAssetLibrary.h |
|
|
static bool RenameAsset
(
const FString& SourceAssetPath, |
Rename an asset from the Content Browser. | EditorAssetLibrary.h |
|
static bool RenameDirectory
(
const FString& SourceDirectoryPath, |
Rename assets from the Content Browser that are in the folder. | EditorAssetLibrary.h |
|
static bool RenameLoadedAsset
(
UObject* SourceAsset, |
Rename an asset from the Content Browser that is already loaded. | EditorAssetLibrary.h |
|
static void ResetProjectRootAssetDirectory() |
EditorAssetLibrary.h | ||
static bool SaveAsset
(
const FString& AssetToSave, |
Save the packages the assets live in. | EditorAssetLibrary.h |
|
static bool SaveDirectory
(
const FString& DirectoryPath, |
Save the packages the assets live in inside the directory. | EditorAssetLibrary.h |
|
static bool SaveLoadedAsset
(
UObject* AssetToSave, |
Save the packages the assets live in. | EditorAssetLibrary.h |
|
static bool SaveLoadedAssets
(
const TArray< UObject* >& AssetsToSave, |
Save the packages the assets live in. | EditorAssetLibrary.h |
|
| Set the value associated with a given tag of a loaded asset's metadata. | EditorAssetLibrary.h |
|
|
static void SyncBrowserToObjects
(
const TArray< FString >& AssetPaths |
Browses to the associated asset and selects it in the most recently used Content Browser (summoning one if necessary) This is an asynchronous operation that can take a couple of frames to resolve the request | EditorAssetLibrary.h |
|