UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AssetRegistryHelpers.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
8#include "Containers/Array.h"
9#include "Containers/Set.h"
11#include "Delegates/Delegate.h"
12#include "UObject/NameTypes.h"
13#include "UObject/Object.h"
19#include "AssetRegistryHelpers.generated.h"
20
21class IAssetRegistry;
22class UClass;
23struct FFrame;
24struct FAssetIdentifier;
25
26USTRUCT(BlueprintType)
28{
30
31 UPROPERTY(BlueprintReadWrite, Transient, Category = AssetData)
33
34 UPROPERTY(BlueprintReadWrite, Transient, Category = AssetData)
35 FString Value;
36};
37
38UENUM(BlueprintType, DisplayName = "Sort Order")
44
46{
47 None = 0,
48 // If we should scan recursively or not
49 RecursivePaths = (1 << 0),
50 // If we should only include on disk assets
51 IncludeOnlyOnDiskAsset = (1 << 1),
52 // If we should only return assets directly outered to the provided outer
53 ExactOuter = (1 << 2),
54 // Scan the AssetRegistry for each path passed in
55 ScanPaths = (1 << 3)
56};
58
61{
63
64public:
65 UFUNCTION(BlueprintPure, Category = "Asset Registry")
66 static TScriptInterface<IAssetRegistry> GetAssetRegistry();
67
74 UFUNCTION(BlueprintPure, Category = "Asset Data")
75 static FAssetData CreateAssetData(const UObject* InAsset, bool bAllowBlueprintClass = false);
76
78 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(DisplayName = "Is Valid Asset Data", ScriptMethod))
79 static bool IsValid(const FAssetData& InAssetData);
80
82 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
83 static bool IsUAsset(const FAssetData& InAssetData);
84
86 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
87 static bool IsRedirector(const FAssetData& InAssetData);
88
90 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
91 static FString GetFullName(const FAssetData& InAssetData);
92
94 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
95 static FSoftObjectPath ToSoftObjectPath(const FAssetData& InAssetData);
96
97 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
98 static UClass* GetClass(const FAssetData& InAssetData);
99
101 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
102 static UObject* GetAsset(const FAssetData& InAssetData);
103
105 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
106 static bool IsAssetLoaded(const FAssetData& InAssetData);
107
108#if WITH_EDITOR
110 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod="IsCooked"))
111 static bool IsAssetCooked(const FAssetData& InAssetData);
112
114 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod="HasEditorOnlyData"))
116#endif // WITH_EDITOR
117
119 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
120 static FString GetExportTextName(const FAssetData& InAssetData);
121
123 UFUNCTION(BlueprintPure, Category = "Asset Data", meta=(ScriptMethod))
124 static bool GetTagValue(const FAssetData& InAssetData, const FName& InTagName, FString& OutTagValue);
125
129 UFUNCTION(BlueprintPure, Category = "Asset Registry")
130 static FARFilter SetFilterTagsAndValues(const FARFilter& InFilter, const TArray<FTagAndValue>& InTagsAndValues);
131
133 UFUNCTION(BlueprintPure, Category = "Asset Registry", meta=(ScriptMethod))
134 static ASSETREGISTRY_API void GetBlueprintAssets(const FARFilter& InFilter, TArray<FAssetData>& OutAssetData);
135
141 UFUNCTION(BlueprintCallable, Category = "Asset Registry")
143
149 UFUNCTION(BlueprintPure, Category = "Asset Registry", meta=(ScriptMethod))
150 static ASSETREGISTRY_API UClass* FindAssetNativeClass(const FAssetData& AssetData);
151
160 UFUNCTION(BlueprintCallable, Category = "Asset Registry")
162
169 UFUNCTION(BlueprintCallable, Category = "Asset Registry")
170 static ASSETREGISTRY_API void SortByAssetName(UPARAM(Ref) TArray<FAssetData>& Assets, EAssetRegistrySortOrder SortOrder);
171
175 static ASSETREGISTRY_API void FindReferencersOfAssetOfClass(UObject* AssetInstance, TConstArrayView<UClass*> InMatchClasses, TArray<FAssetData>& OutAssetDatas);
176
180 static ASSETREGISTRY_API void FindReferencersOfAssetOfClass(const FAssetIdentifier& InAssetIdentifier, TConstArrayView<UClass*> InMatchClasses, TArray<FAssetData>& OutAssetDatas);
181
191
193 static bool ASSETREGISTRY_API IsAssetDataBlueprintOfClassSet(const FAssetData& AssetData, const TSet<FTopLevelAssetPath>& ClassNameSet);
194
199 static ASSETREGISTRY_API void FixupRedirectedAssetPath(FName& InOutAssetPath);
200
205 static ASSETREGISTRY_API void FixupRedirectedAssetPath(FSoftObjectPath& InOutSoftObjectPath);
206
207#if WITH_EDITOR
216 UE_DEPRECATED(5.7, "Please use GetAssetsWithOuterForPaths with enum flags")
218
226#endif
227};
EAssetsWithOuterForPathsFlags
Definition AssetRegistryHelpers.h:46
EAssetRegistrySortOrder
Definition AssetRegistryHelpers.h:40
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Sort(T *First, const int32 Num, const PREDICATE_CLASS &Predicate)
Definition Sorting.h:78
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UPARAM(...)
Definition ObjectMacros.h:748
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition IAssetRegistry.h:263
Definition Array.h:670
Definition ScriptInterface.h:139
Definition AssetRegistryHelpers.h:61
DECLARE_DYNAMIC_DELEGATE_RetVal_TwoParams(bool, FSortingPredicate, const FAssetData &, Left, const FAssetData &, Right)
Definition Class.h:3793
Definition Object.h:95
@ false
Definition radaudio_common.h:23
Definition ARFilter.h:23
Definition AssetData.h:162
Definition AssetIdentifier.h:12
Definition Stack.h:114
Definition SoftObjectPath.h:56
Definition AssetRegistryHelpers.h:28
Definition AssetRegistryHelpers.h:184