Navigation
API > API/Runtime > API/Runtime/CoreUObject
A package.
| Name | UPackage |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/Package.h |
| Include Path | #include "UObject/Package.h" |
Syntax
UCLASS (MinimalAPI, Config=Engine)
class UPackage : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UPackage
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPackage
(
FVTableHelper& Helper |
DO NOT USE. This constructor is for internal usage only for hot-reload purposes. | UObject/Package.h | |
UPackage
(
const FObjectInitializer& ObjectInitializer |
UObject/Package.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~UPackage() |
UObject/Package.h |
Structs
| Name | Remarks |
|---|---|
| FAdditionalInfo |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnMetaDataTransferRequestedDelegate | TMulticastDelegate_FourParams< void, const FMetaData &OldMetaData, FMetaData &NewMetaData, const UPackage *OldPackage, UPackage *NewPackage > | A delegate that is called when old metadata is supposed to move to new metadata, such as when renaming an asset. | UObject/Package.h |
| FOnPackageDirtyStateChanged | TMulticastDelegate_OneParam< void, class UPackage * > | Delegate type for package dirty state events. ( Params: UPackage* ModifiedPackage ) | UObject/Package.h |
| FOnPackageMarkedDirty | TMulticastDelegate_TwoParams< void, class UPackage *, bool > | Delegate type for when a package is marked as dirty via UObjectBaseUtility::MarkPackageDirty ( Params: UPackage* ModifiedPackage, bool bWasDirty ) | UObject/Package.h |
| FOnPackageSaved | TMulticastDelegate_TwoParams< void, const FString &, UObject * > | Delegate type for package saved events ( Params: const FString& PackageFileName, UObject* Outer ) | UObject/Package.h |
| FOnPackageSavedWithContext | TMulticastDelegate_ThreeParams< void, const FString &, UPackage *, FObjectPostSaveContext > | Delegate type for package saved events ( Params: const FString& PackageFileName, UObject* Outer, FObjectPostSaveContext ObjectSaveContext ) | UObject/Package.h |
| FPreSavePackage | TMulticastDelegate_OneParam< void, class UPackage * > | Delegate type for when a package is about to be saved | UObject/Package.h |
| FPreSavePackageWithContext | TMulticastDelegate_TwoParams< void, class UPackage *, FObjectPreSaveContext > | Delegate type for when a package is about to be saved | UObject/Package.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bSupportCookerSoftGC | bool | Functionality to support SoftGC in the cooker. | UObject/Package.h |
| OnMetaDataTransferRequestedDelegate | FOnMetaDataTransferRequestedDelegate | UObject/Package.h | |
| PackageDirtyStateChangedEvent | FOnPackageDirtyStateChanged | Delegate to notify subscribers when the dirty state of a package is changed. | UObject/Package.h |
| PackageMarkedDirtyEvent | FOnPackageMarkedDirty | Delegate to notify subscribers when a package is marked as dirty via UObjectBaseUtility::MarkPackageDirty Note: Unlike FOnPackageDirtyStateChanged, this is always called, even when the package is already dirty Use bWasDirty to check the previous dirty state of the package Use Package->IsDirty() to get the updated dirty state of the package | UObject/Package.h |
| PackageSavedEvent | FOnPackageSaved | UObject/Package.h | |
| PackageSavedWithContextEvent | FOnPackageSavedWithContext | Delegate to notify subscribers when a package has been saved. | UObject/Package.h |
| PreSavePackageEvent | FPreSavePackage | UObject/Package.h | |
| PreSavePackageWithContextEvent | FPreSavePackageWithContext | Delegate to notify subscribers when a package is about to be saved. | UObject/Package.h |
| SoftGCPackageToObjectList | TMap< UPackage *, TArrayView< TObjectPtr< UObject > > > | UObject/Package.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCanBeImported | uint8 | Whether this package can be imported, i.e. its package name is a package that exists on disk. | UObject/Package.h | |
| bHasBeenFullyLoaded | uint8 | Whether this package has been fully loaded (aka had all it's exports created) at some point. | UObject/Package.h | |
| bIsCookedForEditor | bool | True if this packages has been cooked for the editor / opened cooked by the editor Note: This flag is accessed on different threads, do not mix with other bitfields above as the value returned might get corrupted. | UObject/Package.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AdditionalInfo | TUniquePtr< FAdditionalInfo > | Contains additional information if they differ from the defaults. | UObject/Package.h | |
| bDirty | uint8 | Used by the editor to determine if a package has been changed. | UObject/Package.h | |
| bHasBeenEndLoaded | std::atomic< bool > | This flag is manipulated on different threads, do not mix with other bitfields above as they might get corrupted. | UObject/Package.h | |
| bIsDynamicPIEPackagePending | uint8 | True if this package is a dynamic PIE package with external objects still loading | UObject/Package.h | |
| ChunkIDs | TArray< int32 > | Chunk IDs for the streaming install chunks this package will be placed in. | UObject/Package.h | |
| Delegates | TArray< UFunction * > | Link list of delegates registered to the package. The next pointer chain can't be used for this. | UObject/Package.h | |
| DeprecatedMetaData | UDEPRECATED_MetaData * | Deprecated UMetaData member when loading older packages | UObject/Package.h | |
| LoadedPath | FPackagePath | The PackagePath this package was loaded from | UObject/Package.h | |
| LoadTime | float | This should probably be entirely deprecated and removed but certain stat dump function are still using it, just compile it out in shipping for now Time in seconds it took to fully load this package. | UObject/Package.h | |
| MetaData | FMetaData | MetaData for the editor. | UObject/Package.h | |
| PackageFlagsPrivate | std::atomic< uint32 > | Package Flags | UObject/Package.h | |
| PackageId | FPackageId | Globally unique id | UObject/Package.h | |
| PersistentGuid | FGuid | Persistent GUID of package if it was loaded from disk. Persistent across saves. | UObject/Package.h | |
| PIEInstanceID | int32 | Editor only: PIE instance ID this package belongs to, INDEX_NONE otherwise | UObject/Package.h | |
| SavedHash | FIoHash | UObject/Package.h | ||
| ThumbnailMap | TUniquePtr< FThumbnailMap > | Editor only: Thumbnails stored in this package | UObject/Package.h | |
| UDEPRECATED_MetaData | friend | UObject/Package.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FThumbnailMap & AccessThumbnailMap() |
Access the thumbnail map for this package. Only call this if HasThumbnailMap returns true! | UObject/Package.h | |
bool CanBeImported() |
Returns whether the package can be imported. | UObject/Package.h | |
void ClearDirtyFlag() |
Clear the package dirty flag without any transaction tracking | UObject/Package.h | |
void ClearPackageFlags
(
uint32 FlagsToClear |
Set the specified flags to false. Does not affect any other flags. | UObject/Package.h | |
bool ContainsMap() |
Returns whether this package contains a ULevel or UWorld object. | UObject/Package.h | |
UObject * FindAssetInPackage
(
EObjectFlags RequiredTopLevelFlags |
Utility function to find Asset in this package, if any | UObject/Package.h | |
void FullyLoad() |
Fully loads this package. Safe to call multiple times and won't clobber already loaded assets. | UObject/Package.h | |
EAssetAccessSpecifier GetAssetAccessSpecifier() |
Gets how package can be referenced from other plugins and mount points | UObject/Package.h | |
const TArray< int32 > & GetChunkIDs() |
Returns our ChunkIDs | UObject/Package.h | |
| Return the list of packages found assigned to object outer-ed to the top level objects of this package | UObject/Package.h | ||
int64 GetFileSize() |
Returns our FileSize | UObject/Package.h | |
bool GetHasBeenEndLoaded () |
This flag becomes true for loaded packages after serialization and postload and before returning from LoadPackage or calling load completion delegate. | UObject/Package.h | |
FLinkerLoad * GetLinker() |
UObject/Package.h | ||
const FCustomVersionContainer & GetLinkerCustomVersions() |
UObject/Package.h | ||
int32 GetLinkerLicenseeVersion() |
UObject/Package.h | ||
const FPackageFileVersion & GetLinkerPackageVersion() |
UObject/Package.h | ||
const FPackagePath & GetLoadedPath() |
Get the path this package was loaded from; may be different than packagename, and may not be set if the package was not loaded from disk | UObject/Package.h | |
float GetLoadTime() |
Returns the time it took the last time this package was fully loaded, 0 otherwise. | UObject/Package.h | |
FMetaData & GetMetaData () |
Gets (after possibly creating) a metadata object for this package | UObject/Package.h | |
uint32 GetPackageFlags() |
Gets the package flags. | UObject/Package.h | |
FPackageId GetPackageId() |
Returns the unique package id | UObject/Package.h | |
FPackageId GetPackageIdToLoad() |
Returns the unique package id to load | UObject/Package.h | |
FGuid GetPersistentGuid() |
Returns our persistent Guid | UObject/Package.h | |
int32 GetPIEInstanceID() |
Returns the PIE instance id used by the package if any, or INDEX_NONE otherwise | UObject/Package.h | |
| UObject/Package.h | |||
FIoHash GetSavedHash() |
Hash of the package's .uasset/.umap file when it was last saved by the editor. | UObject/Package.h | |
const FThumbnailMap & GetThumbnailMap () |
Returns the thumbnail map for this package (const). | UObject/Package.h | |
FWorldTileInfo * GetWorldTileInfo() |
Get the world tile info if any | UObject/Package.h | |
bool HasAllPackagesFlags
(
uint32 FlagsToCheck |
Used to safely check whether all of the passed in flags are set. | UObject/Package.h | |
bool HasAnyPackageFlags
(
uint32 FlagsToCheck |
Used to safely check whether the passed in flag is set. | UObject/Package.h | |
bool HasThumbnailMap() |
Returns true if this package has a thumbnail map | UObject/Package.h | |
bool IsDirty() |
Returns whether the package needs to be saved. | UObject/Package.h | |
bool IsDynamicPIEPackagePending() |
Returns the bIsDynamicPIEPackagePending flag | UObject/Package.h | |
bool IsExternallyReferenceable() |
UObject/Package.h | ||
bool IsFullyLoaded() |
Returns whether the package is fully loaded. | UObject/Package.h | |
bool IsLoadedByEditorPropertiesOnly() |
Returns true when the package is only referenced by editor-only flag | UObject/Package.h | |
void MarkAsFullyLoaded() |
Marks this package as being fully loaded. | UObject/Package.h | |
void MarkAsNewlyCreated() |
Marks this package as newly created (has no corresponding file on disk). | UObject/Package.h | |
void MarkAsUnloaded() |
Marks this package as unloaded. | UObject/Package.h | |
bool RequiresLocalizationGather() |
Returns whether this package contains data required to be gathered for localization. | UObject/Package.h | |
bool SetAssetAccessSpecifier
(
const EAssetAccessSpecifier InAccessSpecifier |
Sets how the package can be referenced from other plugins and mount points | UObject/Package.h | |
void SetCanBeImportedFlag
(
bool bInCanBeImported |
Marks/Unmarks the package's bCanBeImported flag. | UObject/Package.h | |
void SetChunkIDs
(
const TArray< int32 >& InChunkIDs |
Sets our ChunkIDs | UObject/Package.h | |
void SetDirtyFlag
(
bool bIsDirty |
Marks/Unmarks the package's bDirty flag, save the package to the transaction buffer if a transaction is ongoing | UObject/Package.h | |
void SetDynamicPIEPackagePending
(
bool bInIsDynamicPIEPackagePending |
Sets the bIsDynamicPIEPackagePending flag | UObject/Package.h | |
void SetHasBeenEndLoaded
(
bool bValue |
UObject/Package.h | ||
void SetIsExternallyReferenceable
(
bool bValue |
Sets whether or not the package is ExternallyReferenceable by all plugins and mount points | UObject/Package.h | |
void SetLoadedByEditorPropertiesOnly
(
bool bIsEditorOnly, |
UObject/Package.h | ||
void SetLoadedPath
(
const FPackagePath& PackagePath |
Set the path this package was loaded from; typically called only by the linker during load | UObject/Package.h | |
void SetLoadTime
(
float InLoadTime |
Sets the time it took to load this package. | UObject/Package.h | |
void SetPackageFlags
(
uint32 FlagsToSet |
Set the specified flags to true. Does not affect any other flags. | UObject/Package.h | |
void SetPackageFlagsTo
(
uint32 NewFlags |
Sets all package flags to the specified values. | UObject/Package.h | |
void SetPackageId
(
FPackageId InPackageId |
Sets the unique package id | UObject/Package.h | |
void SetPersistentGuid
(
FGuid NewPersistentGuid |
Sets a specific persistent Guid | UObject/Package.h | |
void SetPIEInstanceID
(
int32 InPIEInstanceID |
Set the PIE instance id for this package | UObject/Package.h | |
| UObject/Package.h | |||
void SetSavedHash
(
const FIoHash& InSavedHash |
UObject/Package.h | ||
void SetThumbnailMap
(
TUniquePtr< FThumbnailMap > InThumbnailMap |
Set the internal thumbnail map for this package. | UObject/Package.h | |
void SetWorldTileInfo
(
TUniquePtr< FWorldTileInfo > InWorldTileInfo |
Set the world tile info | UObject/Package.h | |
void ThisContainsMap() |
Called to indicate that this package contains a ULevel or UWorld object. | UObject/Package.h | |
void ThisRequiresLocalizationGather
(
bool Value |
Called to indicate that this package contains data required to be gathered for localization. | UObject/Package.h | |
void ThisShouldLoadUncooked
(
const FArchive& Ar |
Call this to indicate that this package should load uncooked when possible (ie hybrid cooked editor). | UObject/Package.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FinishDestroy () |
Called to finish destroying the object. | UObject/Package.h | |
virtual bool IsAsset() |
Packages are never assets | UObject/Package.h | |
virtual bool IsNameStableForNetworking() |
For now, assume all packages have stable net names. | UObject/Package.h | |
virtual bool IsPostLoadThreadSafe() |
Called during async load to determine if PostLoad can be called on the loading thread. | UObject/Package.h | |
virtual bool NeedsLoadForClient() |
We override NeedsLoadForClient to avoid calling the expensive generic version, which only makes sure that the UPackage static class isn't excluded | UObject/Package.h | |
virtual bool NeedsLoadForServer () |
Called during saving to determine the load flags to save with the object. | UObject/Package.h | |
virtual void PostInitProperties () |
Called after the C++ constructor and after the properties have been initialized, but before the config has been loaded, etc. | UObject/Package.h | |
| Rename this object to a unique name, or change its outer. | UObject/Package.h | ||
| Serializer | UObject/Package.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
Static class override of UObject::AddReferencedObjects | UObject/Package.h | |
static bool HasAsyncFileWrites() |
Return true if SAVE_Async file writes are pending | UObject/Package.h | |
| Determines if a package contains no more assets. | UObject/Package.h | ||
static FSavePackageResultStruct Save
(
UPackage* InOuter, |
Save one specific object (along with any objects it references contained within the same Outer) into an Unreal package. | UObject/Package.h | |
static FSavePackageResultStruct Save2
(
UPackage* InPackage, |
UObject/Package.h | ||
static ESavePackageResult SaveConcurrent
(
TArrayView< FPackageSaveInfo > InPackages, |
Save a list of packages concurrently using Save2 mechanism SaveConcurrent is currently experimental and shouldn't be used until it can safely replace Save. | UObject/Package.h | |
static bool SavePackage
(
UPackage* InOuter, |
Save one specific object (along with any objects it references contained within the same Outer) into an Unreal package. | UObject/Package.h | |
static void WaitForAsyncFileWrites() |
Wait for any SAVE_Async file writes to complete | UObject/Package.h |