UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AssetData.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"
12#include "Containers/Map.h"
13#include "Containers/Set.h"
20#include "HAL/PlatformMath.h"
21#include "HAL/UnrealMemory.h"
22#include "IO/IoChunkId.h"
23#include "IO/IoHash.h"
25#include "Logging/LogCategory.h"
26#include "Logging/LogMacros.h"
29#include "Misc/CString.h"
30#include "Misc/EnumClassFlags.h"
31#include "Misc/Guid.h"
32#include "Misc/Optional.h"
33#include "Misc/PackageName.h"
34#include "Misc/PackagePath.h"
35#include "Misc/SecureHash.h"
36#include "Misc/StringBuilder.h"
39#include "Templates/Tuple.h"
40#include "Templates/TypeHash.h"
41#include "Templates/UniquePtr.h"
44#include "UObject/Class.h"
46#include "UObject/NameTypes.h"
47#include "UObject/Object.h"
51#include "UObject/Package.h"
56#include "UObject/UnrealNames.h"
57
58#include "AssetData.generated.h"
59
60struct FAssetBundleData;
61struct FCustomVersion;
62class FCbWriter;
63class FCbFieldView;
65
68
71{
72 enum Type
73 {
74 PreVersioning = 0, // From before file versioning was implemented
75 HardSoftDependencies, // The first version of the runtime asset registry to include file versioning.
76 AddAssetRegistryState, // Added FAssetRegistryState and support for piecemeal serialization
77 ChangedAssetData, // AssetData serialization format changed, versions before this are not readable
78 RemovedMD5Hash, // Removed MD5 hash from package data
79 AddedHardManage, // Added hard/soft manage references
80 AddedCookedMD5Hash, // Added MD5 hash of cooked package to package data
81 AddedDependencyFlags, // Added UE::AssetRegistry::EDependencyProperty to each dependency
82 FixedTags, // Major tag format change that replaces USE_COMPACT_ASSET_REGISTRY:
83 // * Target tag INI settings cooked into tag data
84 // * Instead of FString values are stored directly as one of:
85 // - Narrow / wide string
86 // - [Numberless] FName
87 // - [Numberless] export path
88 // - Localized string
89 // * All value types are deduplicated
90 // * All key-value maps are cooked into a single contiguous range
91 // * Switched from FName table to seek-free and more optimized FName batch loading
92 // * Removed global tag storage, a tag map reference-counts one store per asset registry
93 // * All configs can mix fixed and loose tag maps
94 WorkspaceDomain, // Added Version information to AssetPackageData
95 PackageImportedClasses, // Added ImportedClasses to AssetPackageData
96 PackageFileSummaryVersionChange, // A new version number of UE5 was added to FPackageFileSummary
97 ObjectResourceOptionalVersionChange,// Change to linker export/import resource serialization
98 AddedChunkHashes, // Added FIoHash for each FIoChunkId in the package to the AssetPackageData.
99 ClassPaths, // Classes are serialized as path names rather than short object names, e.g. /Script/Engine.StaticMesh
100 RemoveAssetPathFNames, // Asset bundles are serialized as FTopLevelAssetPath instead of FSoftObjectPath, deprecated FAssetData::ObjectPath
101 AddedHeader, // Added header with bFilterEditorOnlyData flag
102 AssetPackageDataHasExtension, // Added Extension to AssetPackageData.
103 AssetPackageDataHasPackageLocation, // Added PackageLocation to AssetPackageData.
104 MarshalledTextAsUTF8String, // Replaced 2 byte wide string with UTF8 String
105 PackageSavedHash, // Replaced FAssetPackageData::PackageGuid with PackageSavedHash
106 ExternalActorToWorldIsEditorOnly, // FPackageDependencyData::LoadDependenciesFromPackageHeader changed how it calculates PackageDependencies
107 ManageDependenciesCookRule, // CookRule property added to EDependencyProperties for EDependencyCategory::Manage
108
109 // -----<new versions can be added above this line>-------------------------------------------------
112 };
113
116
119
120private:
122};
123
124namespace UE::AssetRegistry
125{
127}
128
130{
136
144}
145
151{
152 No,
153 Yes,
154};
155
160USTRUCT(BlueprintType)
162{
164public:
167 {
168 return TEXT("CL_");
169 }
170
171 enum class ECreationFlags
172 {
173 None = 0,
174 SkipAssetRegistryTagsGathering = 1 << 0, // Do not perform expensive step of gathering asset registry tags at construction.
175 AllowBlueprintClass = 1 << 1, // Unless specified, the default when trying to create one for a blueprint class
176 // will create one for the UBlueprint instead, but this can be overridden
177 };
178
179public:
180#if WITH_EDITORONLY_DATA
182 UE_DEPRECATED(5.1, "FName asset paths have been deprecated. Use GetSoftObjectPath to get the path this asset will use in memory when loaded or GetObjectPathString() if you were just doing ObjectPath.ToString()")
183 UPROPERTY()
185#endif
187 UPROPERTY(BlueprintReadOnly, Category = AssetData, transient)
188 FName PackageName;
190 UPROPERTY(BlueprintReadOnly, Category = AssetData, transient)
191 FName PackagePath;
193 UPROPERTY(BlueprintReadOnly, Category = AssetData, transient)
194 FName AssetName;
196 UE_DEPRECATED(5.1, "Class names are now represented by path names. Please use AssetClassPath.")
197 UPROPERTY(BlueprintReadOnly, Category = AssetData, transient, meta=(DeprecatedProperty, DeprecationMessage="Short asset class name must be converted to full asset pathname. Use AssetClassPath instead."))
198 FName AssetClass;
200 UPROPERTY(BlueprintReadOnly, Category = AssetData, transient)
201 FTopLevelAssetPath AssetClassPath;
202
203private:
204 UE::AssetRegistry::FChunkArrayRegistryHandle ChunkArrayRegistryHandle;
205
206public:
208 uint32 PackageFlags = 0;
209
210#if WITH_EDITORONLY_DATA
211private:
221public:
222#endif
223
231
233#if !UE_STRIP_DEPRECATED_PROPERTIES
234 UE_DEPRECATED(5.1, "Use SetChunkIDs/GetChunkIDs/AddChunkID instead.")
236#endif
237
238 COREUOBJECT_API void SetTagsAndAssetBundles(FAssetDataTagMap&& Tags);
239
240 // These are usually very small arrays and we can preallocate two elements for the same cost as one on 64-bit systems
243
244 COREUOBJECT_API FChunkArrayView GetChunkIDs() const;
245 COREUOBJECT_API void SetChunkIDs(FChunkArray&& InChunkIDs);
246 COREUOBJECT_API void SetChunkIDs(const FChunkArrayView& InChunkIDs);
247 COREUOBJECT_API void AddChunkID(int32 ChunkID);
248 COREUOBJECT_API void ClearChunkIDs();
249 COREUOBJECT_API bool HasSameChunkIDs(const FAssetData& OtherAssetData) const;
250
252 static COREUOBJECT_API SIZE_T GetChunkArrayRegistryAllocatedSize();
253
254public:
255PRAGMA_DISABLE_DEPRECATION_WARNINGS // Compilers can complain about deprecated members in compiler generated code
258 {
259 }
260 FAssetData(FAssetData&&) = default;
261 FAssetData(const FAssetData&) = default;
263 FAssetData& operator=(const FAssetData&) = default;
265
266 UE_DEPRECATED(5.1, "Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.")
268 UE_DEPRECATED(5.1, "Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.")
270
275
279
285
287 bool operator==(const FAssetData& Other) const
288 {
289 return PackageName == Other.PackageName && AssetName == Other.AssetName;
290 }
291
292 bool operator!=(const FAssetData& Other) const
293 {
294 return PackageName != Other.PackageName || AssetName != Other.AssetName;
295 }
296
298 bool operator>(const FAssetData& Other) const
299 {
300 if (PackageName == Other.PackageName)
301 {
302 return Other.AssetName.LexicalLess(AssetName);
303 }
304 return Other.PackageName.LexicalLess(PackageName);
305 }
306
308 bool operator<(const FAssetData& Other) const
309 {
310 if (PackageName == Other.PackageName)
311 {
312 return AssetName.LexicalLess(Other.AssetName);
313 }
314 return PackageName.LexicalLess(Other.PackageName);
315 }
316
318 bool IsValid() const
319 {
320 return !PackageName.IsNone() && !AssetName.IsNone();
321 }
322
329 bool IsUAsset() const
330 {
331 if (!IsValid())
332 {
333 return false;
334 }
335
337 AssetName.ToString(AssetNameStrBuilder);
338
340 PackageName.ToString(PackageNameStrBuilder);
341 return DetectIsUAssetByNames(PackageNameStrBuilder, AssetNameStrBuilder);
342 }
343
345 COREUOBJECT_API FSoftObjectPath GetSoftObjectPath() const;
346
347 // TODO: Deprecate in favor of GetSoftObjectPath
349 {
350 return GetSoftObjectPath();
351 }
352
354 FString GetObjectPathString() const
355 {
357 AppendObjectPath(Builder);
358 return FString(Builder);
359 }
360
365 COREUOBJECT_API static bool IsUAsset(UObject* Object);
366
373 COREUOBJECT_API bool IsTopLevelAsset() const;
374
380 COREUOBJECT_API static bool IsTopLevelAsset(UObject* Object);
381
382 void Shrink()
383 {
384 TagsAndValues.Shrink();
385 }
386
387#if WITH_EDITORONLY_DATA
389 void SetOptionalOuterPathName(FName InName) { OptionalOuterPath = InName; }
390#endif
391
393 FString GetFullName() const
394 {
395 FString FullName;
396 GetFullName(FullName);
397 return FullName;
398 }
399
401 void GetFullName(FString& OutFullName) const
402 {
403 OutFullName.Reset();
404 OutFullName += AssetClassPath.ToString();
405 OutFullName.AppendChar(TEXT(' '));
406 AppendObjectPath(OutFullName);
407 }
408
411 {
412 OutFullNameBuilder.Reset();
413 AssetClassPath.AppendString(OutFullNameBuilder);
414 OutFullNameBuilder.AppendChar(TEXT(' '));
415 AppendObjectPath(OutFullNameBuilder);
416 }
417
419 FString GetExportTextName() const
420 {
421 FString ExportTextName;
422 GetExportTextName(ExportTextName);
423 return ExportTextName;
424 }
425
428 {
429 OutExportTextName.Reset();
430 OutExportTextName.Append(AssetClassPath.ToString());
431 OutExportTextName.AppendChar(TEXT('\''));
432 AppendObjectPath(OutExportTextName);
433 OutExportTextName.AppendChar(TEXT('\''));
434 }
435
438 {
441 OutExportTextNameBuilder.AppendChar(TEXT('\''));
442 AppendObjectPath(OutExportTextNameBuilder);
443 OutExportTextNameBuilder.AppendChar(TEXT('\''));
444 }
445
451 COREUOBJECT_API UE::Core::FVersePath GetVersePath() const;
452
454 bool IsRedirector() const
455 {
456 return IsRedirectorClassName(AssetClassPath);
457 }
458
460 {
461 return Object && IsRedirectorClassName(Object->GetClass()->GetClassPathName());
462 }
463
468 COREUOBJECT_API UClass* GetClass(EResolveClass ResolveClass = EResolveClass::No) const;
469
474 bool IsInstanceOf(const UClass* BaseClass, EResolveClass ResolveClass = EResolveClass::No) const
475 {
476 UClass* ClassPointer = GetClass(ResolveClass);
477 return ClassPointer && ClassPointer->IsChildOf(BaseClass);
478 }
479
480 template<typename BaseClass>
482 {
483 return IsInstanceOf(BaseClass::StaticClass(), ResolveClass);
484 }
485
488 {
489 if (!IsValid())
490 {
491 return;
492 }
493
494#if WITH_EDITORONLY_DATA
495 if (!OptionalOuterPath.IsNone())
496 {
498 }
499 else
500#endif
501 {
502 Builder << PackageName << '.' << AssetName;
503 }
504 }
505
507 void AppendObjectPath(FString& String) const
508 {
510 AppendObjectPath(Builder);
511 String.Append(FString(Builder));
512 }
513
515 COREUOBJECT_API FPrimaryAssetId GetPrimaryAssetId() const;
516
525 UObject* FastGetAsset(bool bLoad = false, TSet<FName> LoadTags = {}) const
526 {
527 if (!IsValid())
528 {
529 // Do not try to find the object if the fields are not set
530 return nullptr;
531 }
532
533 // We load PackageName rather than using GetObjectPath because external assets may be saved in a different package to their loaded path.
534 UPackage* FoundPackage = FindObjectFast<UPackage>(nullptr, PackageName);
535
536 // We could find an existing package in memory that is still pending load in the loader.
537 if (FoundPackage && !FoundPackage->IsFullyLoaded())
538 {
539 FoundPackage = nullptr;
540 }
541
542 if (FoundPackage == nullptr && bLoad)
543 {
544 FLinkerInstancingContext InstancingContext(MoveTemp(LoadTags));
545 FoundPackage = LoadPackage(nullptr, *PackageName.ToString(), LOAD_None, nullptr, &InstancingContext);
546 }
547
548 if (!FoundPackage)
549 {
550 return nullptr;
551 }
552
553#if WITH_EDITORONLY_DATA
554 if (!OptionalOuterPath.IsNone())
555 {
557 AppendObjectPath(Builder);
558 return FindObject<UObject>(nullptr, *Builder);
559 }
560 else
561#endif
562 {
563 // If the package is loaded all objects in it must be loaded, just search for the asset in memory with its outer.
564 return FindObjectFast<UObject>(FoundPackage, AssetName);
565 }
566 }
567
576 {
577
578 return FastGetAsset(true /* bLoad */, MoveTemp(LoadTags));
579 }
580
588 {
589 return (PackageFlags & FlagsToCheck) != 0;
590 }
591
599 {
600 return ((PackageFlags & FlagsToCheck) == FlagsToCheck);
601 }
602
605 {
606 if (PackageFlags & PKG_NotExternallyReferenceable)
607 {
609 }
610 else if (PackageFlags & PKG_AccessSpecifierEpicInternal)
611 {
613 }
614
616 }
617
620 {
621 if (PackageName.IsNone())
622 {
623 return nullptr;
624 }
625
626 UPackage* Package = FindPackage(NULL, *PackageName.ToString());
627 if (Package)
628 {
629 Package->FullyLoad();
630 }
631 else
632 {
633 Package = LoadPackage(NULL, *PackageName.ToString(), LOAD_None);
634 }
635
636 return Package;
637 }
638
640 bool FindTag(const FName InTagName) const
641 {
642 return TagsAndValues.FindTag(InTagName).IsSet();
643 }
644
646 template <typename ValueType>
647 bool GetTagValue(FName Tag, ValueType& OutValue) const;
648
650 template<typename Func>
651 void EnumerateTags(Func Fn) const
652 {
653 TagsAndValues.ForEach(Fn);
654 }
655
657 template <typename ValueType>
658 ValueType GetTagValueRef(const FName Tag) const;
659
661 bool IsAssetLoaded() const
662 {
663 return FastGetAsset(false) != nullptr;
664 }
665
667 void PrintAssetData() const
668 {
669 UE_LOG(LogAssetData, Log, TEXT(" FAssetData for %s"), *GetObjectPathString());
670 UE_LOG(LogAssetData, Log, TEXT(" ============================="));
671 UE_LOG(LogAssetData, Log, TEXT(" PackageName: %s"), *PackageName.ToString());
672 UE_LOG(LogAssetData, Log, TEXT(" PackagePath: %s"), *PackagePath.ToString());
673 UE_LOG(LogAssetData, Log, TEXT(" AssetName: %s"), *AssetName.ToString());
674 UE_LOG(LogAssetData, Log, TEXT(" AssetClassPath: %s"), *AssetClassPath.ToString());
675 UE_LOG(LogAssetData, Log, TEXT(" TagsAndValues: %d"), TagsAndValues.Num());
676
677 for (const auto TagValue: TagsAndValues)
678 {
679 UE_LOG(LogAssetData, Log, TEXT(" %s : %s"), *TagValue.Key.ToString(), *TagValue.Value.AsString());
680 }
681
682 const TConstArrayView<int32> CurrentChunkIDs = GetChunkIDs();
683 UE_LOG(LogAssetData, Log, TEXT(" ChunkIDs: %d"), CurrentChunkIDs.Num());
684
685 for (int32 Chunk : CurrentChunkIDs)
686 {
687 UE_LOG(LogAssetData, Log, TEXT(" %d"), Chunk);
688 }
689
690 UE_LOG(LogAssetData, Log, TEXT(" PackageFlags: %d"), PackageFlags);
691 }
692
695 {
696 for(int32 AssetIdx=0; AssetIdx<Assets.Num(); AssetIdx++)
697 {
698 const FAssetData& Data = Assets[AssetIdx];
699 if (Data.IsInstanceOf(DesiredClass))
700 {
701 return Data;
702 }
703 }
704 return FAssetData();
705 }
706
708 template <class T>
710 {
711 UClass* DesiredClass = T::StaticClass();
713 check(Asset == NULL || Asset->IsA(DesiredClass));
714 return (T*)Asset;
715 }
716
721 template<class Archive>
722 inline void SerializeForCache(Archive&& Ar)
723 {
724 SerializeForCacheWithTagsAndBundles(Ar, [](FArchive& Ar, FAssetData& Ad, FAssetRegistryVersion::Type) {
725 static_cast<Archive&>(Ar).SerializeTagsAndBundles(Ad);
726 });
727 }
731 template<class Archive>
733 {
734 SerializeForCacheOldVersionWithTagsAndBundles(Ar, Version, [](FArchive& Ar, FAssetData& Ad, FAssetRegistryVersion::Type Version) {
735 static_cast<Archive&>(Ar).SerializeTagsAndBundlesOldVersion(Ad, Version);
736 });
737 }
738
739 // Note: these functions should only be used for live communication between processes running the same version of the engine.
740 // There is no versioning support
741 COREUOBJECT_API void NetworkWrite(FCbWriter& Writer, bool bWritePackageName) const;
743private:
749 UE_FORCEINLINE_HINT void SerializeForCacheInternal(FArchive& Ar, FAssetRegistryVersion::Type Version, void (*SerializeTagsAndBundles)(FArchive& , FAssetData&, FAssetRegistryVersion::Type));
750 COREUOBJECT_API void SerializeForCacheWithTagsAndBundles(FArchive& Ar, void (*SerializeTagsAndBundles)(FArchive&, FAssetData&, FAssetRegistryVersion::Type));
751 COREUOBJECT_API void SerializeForCacheOldVersionWithTagsAndBundles(FArchive& Ar, FAssetRegistryVersion::Type Version, void (*SerializeTagsAndBundles)(FArchive&, FAssetData&, FAssetRegistryVersion::Type));
752
753 static bool DetectIsUAssetByNames(FStringView PackageName, FStringView ObjectPathName)
754 {
756 {
757 // Get everything after the last slash
759 PackageName.FindLastChar(TEXT('/'), IndexOfLastSlash);
760 PackageBaseName = PackageName.Mid(IndexOfLastSlash + 1);
761 }
762
763 return PackageBaseName.Equals(ObjectPathName, ESearchCase::IgnoreCase);
764 }
765
766public:
767 COREUOBJECT_API static bool IsRedirectorClassName(FTopLevelAssetPath ClassPathName);
768
771
773 {
774 return HashCombine(GetTypeHash(AssetData.PackageName), GetTypeHash(AssetData.AssetName));
775 }
776};
777
779
780
781template<>
783{
784 enum
785 {
787 };
788};
789
790template <typename ValueType>
791inline bool FAssetData::GetTagValue(FName Tag, ValueType& OutValue) const
792{
794 if (FoundValue.IsSet())
795 {
796 FMemory::Memzero(&OutValue, sizeof(ValueType));
797 LexFromString(OutValue, *FoundValue.GetValue());
798 return true;
799 }
800 return false;
801}
802
803template <>
804inline bool FAssetData::GetTagValue<FString>(FName Tag, FString& OutValue) const
805{
807 if (FoundValue.IsSet())
808 {
810 return true;
811 }
812
813 return false;
814}
815
816template <>
817inline bool FAssetData::GetTagValue<FText>(FName Tag, FText& OutValue) const
818{
820 if (FoundValue.IsSet())
821 {
823 return true;
824 }
825
826 return false;
827}
828
829template <>
830inline bool FAssetData::GetTagValue<FName>(FName Tag, FName& OutValue) const
831{
833 if (FoundValue.IsSet())
834 {
836 return true;
837 }
838 return false;
839}
840
841template <typename ValueType>
842inline ValueType FAssetData::GetTagValueRef(FName Tag) const
843{
844 ValueType TmpValue;
845 FMemory::Memzero(&TmpValue, sizeof(ValueType));
847 if (FoundValue.IsSet())
848 {
849 LexFromString(TmpValue, *FoundValue.GetValue());
850 }
851 return TmpValue;
852}
853
854template <>
855inline FString FAssetData::GetTagValueRef<FString>(FName Tag) const
856{
858 return FoundValue.IsSet() ? FoundValue.AsString() : FString();
859}
860
861template <>
862inline FText FAssetData::GetTagValueRef<FText>(FName Tag) const
863{
866 return TmpValue;
867}
868
869template <>
870inline FName FAssetData::GetTagValueRef<FName>(FName Tag) const
871{
873 return FoundValue.IsSet() ? FoundValue.AsName() : FName();
874}
875
876template <>
877inline FAssetRegistryExportPath FAssetData::GetTagValueRef<FAssetRegistryExportPath>(FName Tag) const
878{
880 return FoundValue.IsSet() ? FoundValue.AsExportPath() : FAssetRegistryExportPath();
881}
882
883namespace UE::AssetRegistry
884{
885
888{
891
894 : Key(InKey)
896 {
897 }
898 bool operator<(const FPackageCustomVersion& RHS) const
899 {
900 if (Key < RHS.Key) return true;
901 if (RHS.Key < Key) return false;
902 return Version < RHS.Version;
903 }
904 bool operator==(const FPackageCustomVersion& RHS) const
905 {
906 return Key == RHS.Key && Version == RHS.Version;
907 }
909 {
910 return Ar << CustomVersion.Key << CustomVersion.Version;
911 }
912
913private:
915 {
916 return Value.Write(Writer);
917 }
920 {
921 return Value.TryRead(Field);
922 }
923 COREUOBJECT_API bool TryRead(const FCbFieldView& Field);
924};
925
941
942}
943
946{
947public:
950
952
953private:
955 uint32 Flags;
956
957public:
958
965
968
971
974
975private:
976#if WITH_EDITORONLY_DATA
977 FIoHash PackageSavedHash;
978#endif
979
980public:
983
984private:
986
987public:
988
989
992 , Flags(0)
993 , DiskSize(0)
995 {
996 }
997
1003 {
1004 return CustomVersions.Get();
1005 }
1018
1020 bool IsLicenseeVersion() const { return (Flags & FLAG_LICENSEE_VERSION) != 0; }
1021 void SetIsLicenseeVersion(bool bValue) { Flags = (Flags & ~FLAG_LICENSEE_VERSION) | (bValue ? FLAG_LICENSEE_VERSION : 0); }
1022
1024 bool HasVirtualizedPayloads() const { return (Flags & FLAG_HAS_VIRTUALIZED_PAYLOADS) != 0; }
1025 void SetHasVirtualizedPayloads(bool bValue) { Flags = (Flags & ~FLAG_HAS_VIRTUALIZED_PAYLOADS) | (bValue ? FLAG_HAS_VIRTUALIZED_PAYLOADS : 0); }
1026
1028 bool IsReadOnly() const { return (Flags & FLAG_PACKAGE_READ_ONLY) != 0; }
1029 void SetIsReadOnly(bool bValue) { Flags = (Flags & ~FLAG_PACKAGE_READ_ONLY) | (bValue ? FLAG_PACKAGE_READ_ONLY : 0); }
1030
1037
1040 {
1042 }
1043
1045#if WITH_EDITORONLY_DATA
1048#else
1049 UE_DEPRECATED(5.6, "No longer supported in non-editor configurations, to save memory.")
1051 UE_DEPRECATED(5.6, "No longer supported in non-editor configurations, to save memory.")
1053#endif
1054
1055 // Note: these functions should only be used for live communication between processes running the same version of the engine.
1056 // There is no versioning support
1057 COREUOBJECT_API void NetworkWrite(FCbWriter& Writer) const;
1059
1061 {
1062 // Clear existing location flags
1063 Flags = Flags & ~FLAG_PACKAGE_LOCATION_MASK;
1064
1065 static_assert((uint8)FPackageName::EPackageLocationFilter::MaxBit <= 2, "We are storing PackageLocation in two bits");
1067 Flags |= uint32(PackageLocation) << FLAG_PACKAGE_LOCATION_TO_ENUM_SHIFT_SIZE;
1068 }
1069
1071 {
1072 return FPackageName::EPackageLocationFilter((Flags & FLAG_PACKAGE_LOCATION_MASK) >> FLAG_PACKAGE_LOCATION_TO_ENUM_SHIFT_SIZE);
1073 }
1074
1075private:
1076 UE_FORCEINLINE_HINT void SerializeForCacheInternal(FArchive& Ar, FAssetPackageData& PackageData, FAssetRegistryVersion::Type Version);
1077
1078 enum : uint32
1079 {
1080 FLAG_LICENSEE_VERSION = 1u << 0,
1081 FLAG_HAS_VIRTUALIZED_PAYLOADS = 1u << 1,
1082 FLAG_PACKAGE_READ_ONLY = 1u << 2,
1083
1084 FLAG_PACKAGE_LOCATION_IODISPATCHER = 1u << 30,
1085 FLAG_PACKAGE_LOCATION_FILESYSTEM = 1u << 31,
1086
1087 FLAG_PACKAGE_LOCATION_TO_ENUM_SHIFT_SIZE = 30u,
1088 FLAG_PACKAGE_LOCATION_MASK = uint32(FPackageName::EPackageLocationFilter::ValidMask) << FLAG_PACKAGE_LOCATION_TO_ENUM_SHIFT_SIZE
1089 };
1090};
1091
1092
1096#if WITH_EDITORONLY_DATA
1099{
1101 // Displayed-on-graph options
1104 // Slider-based options
1109 // Checkbox options
1116 {}
1117
1118 /* Whether to display the Referencers */
1119 bool bShowReferencers;
1120 /* Whether to display the Dependencies */
1121 bool bShowDependencies;
1122 /* Whether to only display the References/Dependencies which match the text filter, if any.
1123 If the optional is not set, don't change the current reference viewer's value. */
1127 /* Compact mode allows to hide the thumbnail and minimize the space taken by the nodes. Useful when there are many dependencies to inspect, to keep the UI responsive.
1128 If the optional is not set, don't change the current reference viewer's value. */
1141 bool bShowPluginFilter;
1147 UE_DEPRECATED(5.1, "bShowShowNativePackages is deprecated, please use bShowShowCodePackages instead.")
1154 bool bShowCompactMode;
1155};
1157#endif // WITH_EDITORONLY_DATA
#define NULL
Definition oodle2base.h:134
EGLSurface EGLint const EGLint * names
Definition AndroidOpenGLFunctions.h:11
#define check(expr)
Definition AssertionMacros.h:314
COREUOBJECT_API const FName GAssetBundleDataName
EResolveClass
Definition AssetData.h:151
FAssetDataTagMapSharedView LoadTags(FAssetRegistryReader &Reader)
Definition AssetRegistryArchive.cpp:327
EAssetRegistryTagsCaller
Definition AssetRegistryTagsContext.h:32
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
void LexFromString(EAudioFeature &OutFeature, const TCHAR *String)
Definition IOSAppDelegate.cpp:163
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
@ PKG_AccessSpecifierEpicInternal
Objects in this package can only be referenced in a different plugin or mount point by Epic.
Definition ObjectMacros.h:142
@ PKG_NotExternallyReferenceable
Objects in this package cannot be referenced in a different plugin or mount point (i....
Definition ObjectMacros.h:141
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
@ LOAD_None
No flags.
Definition ObjectMacros.h:69
EPackageExtension
Definition PackagePath.h:39
EAssetAccessSpecifier
Definition Package.h:204
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
UPackage * FindPackage(UObject *InOuter, const TCHAR *PackageName)
Definition UObjectGlobals.cpp:924
@ Unspecified
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AssetRegistry.Build.cs:6
Definition Archive.h:1208
Definition AssetDataTagMap.h:303
int32 Num() const
Definition AssetDataTagMap.h:376
FAssetTagValueRef FindTag(FName Tag) const
Definition AssetDataTagMap.h:353
void ForEach(Func Fn) const
Definition AssetDataTagMap.h:390
COREUOBJECT_API void Shrink()
‍** Shrinks the contained map *‍/
Definition AssetDataTagMap.cpp:1599
Definition AssetDataTagMap.h:289
Definition AssetData.h:946
TArray< FName > ImportedClasses
Definition AssetData.h:967
COREUOBJECT_API FIoHash GetPackageSavedHash() const
Definition AssetData.cpp:1120
bool IsLicenseeVersion() const
Definition AssetData.h:1020
COREUOBJECT_API void SetPackageSavedHash(const FIoHash &InHash)
Definition AssetData.cpp:1129
COREUOBJECT_API void SerializeForCache(FArchive &Ar)
Definition AssetData.cpp:1109
TMap< FIoChunkId, FIoHash > ChunkHashes
Definition AssetData.h:964
void SetCustomVersions(TConstArrayView< UE::AssetRegistry::FPackageCustomVersion > InCustomVersions)
Definition AssetData.h:1010
FAssetPackageData()
Definition AssetData.h:990
bool IsReadOnly() const
Definition AssetData.h:1028
FPackageFileVersion FileVersionUE
Definition AssetData.h:973
COREUOBJECT_API void SerializeForCacheOldVersion(FArchive &Ar, FAssetRegistryVersion::Type Version)
Definition AssetData.cpp:1115
SIZE_T GetAllocatedSize() const
Definition AssetData.h:1039
void SetIsReadOnly(bool bValue)
Definition AssetData.h:1029
FPackageName::EPackageLocationFilter GetPackageLocation() const
Definition AssetData.h:1070
void SetCustomVersions(TConstArrayView< FCustomVersion > InCustomVersions)
Definition AssetData.h:1006
void SetIsLicenseeVersion(bool bValue)
Definition AssetData.h:1021
int32 FileVersionLicenseeUE
Definition AssetData.h:982
COREUOBJECT_API bool TryNetworkRead(FCbFieldView Field)
Definition AssetData.cpp:1188
int64 DiskSize
Definition AssetData.h:970
FMD5Hash CookedHash
Definition AssetData.h:949
EPackageExtension Extension
Definition AssetData.h:951
bool HasVirtualizedPayloads() const
Definition AssetData.h:1024
TConstArrayView< UE::AssetRegistry::FPackageCustomVersion > GetCustomVersions() const
Definition AssetData.h:1002
void SetCustomVersions(TArray< UE::AssetRegistry::FPackageCustomVersion > &&InCustomVersions)
Definition AssetData.h:1014
COREUOBJECT_API void NetworkWrite(FCbWriter &Writer) const
Definition AssetData.cpp:1152
void SetHasVirtualizedPayloads(bool bValue)
Definition AssetData.h:1025
void SetPackageLocation(FPackageName::EPackageLocationFilter PackageLocation)
Definition AssetData.h:1060
Definition AssetDataTagMap.h:182
COREUOBJECT_API FString AsString() const
Definition AssetDataTagMap.cpp:1419
bool IsSet() const
Definition AssetDataTagMap.h:242
COREUOBJECT_API FText AsText() const
Definition AssetDataTagMap.cpp:1439
COREUOBJECT_API FName AsName() const
Definition AssetDataTagMap.cpp:1424
Definition CompactBinary.h:610
Definition CompactBinaryWriter.h:68
Definition LinkerInstancingContext.h:99
Definition NameTypes.h:617
CORE_API FString ToString() const
Definition UnrealNames.cpp:3537
FORCEINLINE bool LexicalLess(const FName &Other) const
Definition NameTypes.h:821
FORCEINLINE bool IsNone() const
Definition NameTypes.h:827
Definition UnrealType.h:3087
EPackageLocationFilter
Definition PackageName.h:405
Definition SetUtilities.h:95
Definition Text.h:385
Definition ArrayView.h:139
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition ContainerAllocationPolicies.h:894
Definition StringBuilder.h:509
bool FindLastChar(CharType Search, int32 &OutIndex) const
Definition StringView.h:763
bool Equals(TStringView< OtherCharType > OtherView, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
Definition StringView.h:306
ViewType Mid(int32 Position, int32 CharCount=MAX_int32) const
Definition StringView.h:606
Definition Class.h:3793
static COREUOBJECT_API FPackageCustomVersionsHandle FindOrAdd(TConstArrayView< FCustomVersion > InCustomVersions)
Definition AssetData.cpp:1340
TConstArrayView< FPackageCustomVersion > Get() const
Definition AssetData.h:930
friend class FPackageCustomVersionRegistry
Definition AssetData.h:939
COREUOBJECT_API friend FArchive & operator<<(FArchive &Ar, FPackageCustomVersionsHandle &Handle)
Definition AssetData.cpp:1361
Definition VersePath.h:14
Definition Object.h:95
Definition Package.h:216
Type
Definition LogVerbosity.h:17
@ Warning
Definition LogVerbosity.h:34
@ IgnoreCase
Definition CString.h:26
Definition FieldSystemNoiseAlgo.cpp:6
Definition AssetRegistryImpl.h:48
void ConcatenateOuterPathAndObjectName(FStringBuilderBase &Builder, FName OuterPath, FName ObjectName)
Definition AssetData.cpp:114
FAssetPathParts SplitIntoOuterPathAndAssetName(FStringView InObjectPath)
Definition AssetData.cpp:103
Definition PackageReader.h:15
Definition AdvancedWidgetsModule.cpp:13
Definition AssetBundleData.h:82
Definition AssetData.h:162
FString GetFullName() const
Definition AssetData.h:393
bool operator>(const FAssetData &Other) const
Definition AssetData.h:298
bool HasAnyPackageFlags(uint32 FlagsToCheck) const
Definition AssetData.h:587
UObject * GetAsset(TSet< FName > LoadTags={}) const
Definition AssetData.h:575
bool IsUAsset() const
Definition AssetData.h:329
bool IsAssetLoaded() const
Definition AssetData.h:661
bool HasAllPackageFlags(uint32 FlagsToCheck) const
Definition AssetData.h:598
bool operator==(const FAssetData &Other) const
Definition AssetData.h:287
void GetFullName(FString &OutFullName) const
Definition AssetData.h:401
friend UE_FORCEINLINE_HINT uint32 GetTypeHash(const FAssetData &AssetData)
Definition AssetData.h:772
PRAGMA_DISABLE_DEPRECATION_WARNINGS FAssetData()
Definition AssetData.h:257
bool IsRedirector() const
Definition AssetData.h:454
TSharedPtr< FAssetBundleData, ESPMode::ThreadSafe > TaggedAssetBundles
Definition AssetData.h:230
FAssetDataTagMapSharedView TagsAndValues
Definition AssetData.h:225
static T * GetFirstAsset(const TArray< FAssetData > &Assets)
Definition AssetData.h:709
FAssetData & operator=(FAssetData &&)=default
TConstArrayView< int32 > FChunkArrayView
Definition AssetData.h:242
void AppendObjectPath(FString &String) const
Definition AssetData.h:507
bool IsInstanceOf(const UClass *BaseClass, EResolveClass ResolveClass=EResolveClass::No) const
Definition AssetData.h:474
static FAssetData GetFirstAssetDataOfClass(const TArray< FAssetData > &Assets, const UClass *DesiredClass)
Definition AssetData.h:694
static bool IsRedirector(UObject *Object)
Definition AssetData.h:459
ValueType GetTagValueRef(const FName Tag) const
Definition AssetData.h:842
static const TCHAR * GetCollectionTagPrefix()
Definition AssetData.h:166
EAssetAccessSpecifier GetAssetAccessSpecifier() const
Definition AssetData.h:604
FAssetData & operator=(const FAssetData &)=default
void PrintAssetData() const
Definition AssetData.h:667
bool operator!=(const FAssetData &Other) const
Definition AssetData.h:292
void GetExportTextName(FString &OutExportTextName) const
Definition AssetData.h:427
void EnumerateTags(Func Fn) const
Definition AssetData.h:651
void Shrink()
Definition AssetData.h:382
void AppendObjectPath(FStringBuilderBase &Builder) const
Definition AssetData.h:487
ECreationFlags
Definition AssetData.h:172
void GetExportTextName(FStringBuilderBase &OutExportTextNameBuilder) const
Definition AssetData.h:437
FAssetData(FAssetData &&)=default
FSoftObjectPath ToSoftObjectPath() const
Definition AssetData.h:348
void SerializeForCacheOldVersion(Archive &&Ar, FAssetRegistryVersion::Type Version=FAssetRegistryVersion::LatestVersion)
Definition AssetData.h:732
bool FindTag(const FName InTagName) const
Definition AssetData.h:640
FString GetObjectPathString() const
Definition AssetData.h:354
void SerializeForCache(Archive &&Ar)
Definition AssetData.h:722
UPackage * GetPackage() const
Definition AssetData.h:619
FAssetData(const FAssetData &)=default
bool GetTagValue(FName Tag, ValueType &OutValue) const
Definition AssetData.h:791
UObject * FastGetAsset(bool bLoad=false, TSet< FName > LoadTags={}) const
Definition AssetData.h:525
bool IsValid() const
Definition AssetData.h:318
void GetFullName(FStringBuilderBase &OutFullNameBuilder) const
Definition AssetData.h:410
bool operator<(const FAssetData &Other) const
Definition AssetData.h:308
FString GetExportTextName() const
Definition AssetData.h:419
bool IsInstanceOf(EResolveClass ResolveClass=EResolveClass::No) const
Definition AssetData.h:481
Definition AssetDataTagMap.h:27
Definition AssetData.h:71
Type
Definition AssetData.h:73
@ AddedHeader
Definition AssetData.h:101
@ HardSoftDependencies
Definition AssetData.h:75
@ ExternalActorToWorldIsEditorOnly
Definition AssetData.h:106
@ VersionPlusOne
Definition AssetData.h:110
@ RemoveAssetPathFNames
Definition AssetData.h:100
@ ManageDependenciesCookRule
Definition AssetData.h:107
@ ClassPaths
Definition AssetData.h:99
@ MarshalledTextAsUTF8String
Definition AssetData.h:104
@ ObjectResourceOptionalVersionChange
Definition AssetData.h:97
@ LatestVersion
Definition AssetData.h:111
@ AddedCookedMD5Hash
Definition AssetData.h:80
@ PreVersioning
Definition AssetData.h:74
@ WorkspaceDomain
Definition AssetData.h:94
@ PackageFileSummaryVersionChange
Definition AssetData.h:96
@ PackageImportedClasses
Definition AssetData.h:95
@ AddedHardManage
Definition AssetData.h:79
@ PackageSavedHash
Definition AssetData.h:105
@ ChangedAssetData
Definition AssetData.h:77
@ AddedDependencyFlags
Definition AssetData.h:81
@ AddedChunkHashes
Definition AssetData.h:98
@ AssetPackageDataHasExtension
Definition AssetData.h:102
@ RemovedMD5Hash
Definition AssetData.h:78
@ AddAssetRegistryState
Definition AssetData.h:76
@ AssetPackageDataHasPackageLocation
Definition AssetData.h:103
@ FixedTags
Definition AssetData.h:82
COREUOBJECT_API static const FGuid GUID
Definition AssetData.h:115
static COREUOBJECT_API bool SerializeVersion(FArchive &Ar, FAssetRegistryVersion::Type &Version)
Definition AssetData.cpp:972
Definition CustomVersion.h:40
Definition Guid.h:109
Definition IoHash.h:33
Definition SecureHash.h:133
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
Definition ObjectVersion.h:762
Definition PrimaryAssetId.h:126
Definition SoftObjectPath.h:56
Definition TopLevelAssetPath.h:38
COREUOBJECT_API void AppendString(FWideStringBuilderBase &Builder) const
Definition TopLevelAssetPath.cpp:21
COREUOBJECT_API FString ToString() const
Definition TopLevelAssetPath.cpp:58
Definition Optional.h:131
Definition StructOpsTypeTraits.h:11
@ WithIdenticalViaEquality
Definition StructOpsTypeTraits.h:18
Definition StructOpsTypeTraits.h:46
friend bool LoadFromCompactBinary(const FCbFieldView &Field, FPackageCustomVersion &Value)
Definition AssetData.h:919
FPackageCustomVersion(const FGuid &InKey, const int32 InVersion)
Definition AssetData.h:893
friend FCbWriter & operator<<(FCbWriter &Writer, const FPackageCustomVersion &Value)
Definition AssetData.h:914
bool operator==(const FPackageCustomVersion &RHS) const
Definition AssetData.h:904
friend FArchive & operator<<(FArchive &Ar, FPackageCustomVersion &CustomVersion)
Definition AssetData.h:908
int32 Version
Definition AssetData.h:890
bool operator<(const FPackageCustomVersion &RHS) const
Definition AssetData.h:898
FGuid Key
Definition AssetData.h:889
FStringView OuterPath
Definition AssetData.h:133
FStringView InnermostName
Definition AssetData.h:134