UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Package::Relocation::Private Namespace Reference

Classes

struct  FPackageRelocationContext
 

Functions

COREUOBJECT_API bool ShouldApplyRelocation (const FPackageFileSummary &PackageSummary, FStringView LoadedPackageName, FPackageRelocationContext &OutPackageRelocationContext)
 
COREUOBJECT_API bool TryRelocateReference (const FPackageRelocationContext &InPackageRelocationContext, FStringView InPackageNameToRelocate, FStringBuilderBase &OutNewLocation)
 
COREUOBJECT_API void ApplyRelocationToObjectImportMap (const FPackageRelocationContext &InPackageRelocationContext, TArrayView< FObjectImport > ImportMapView)
 
COREUOBJECT_API void ApplyRelocationToSoftObjectArray (const FPackageRelocationContext &InPackageRelocationContext, TArrayView< FSoftObjectPath > SoftObjectPaths)
 
COREUOBJECT_API void ApplyRelocationToNameArray (const FPackageRelocationContext &InPackageRelocationContext, TArrayView< FName > PackageNames)
 

Detailed Description

Object relocation is a process done on load to make the references in ImportMap and SoftReferencePathList that point to packages in the same mount point behave as if they were relative paths. This namespace contains the utilities to calculate relocations and is called from code that loads packages.

The API from this namespace is experimental and will be changed without deprecation

Function Documentation

◆ ApplyRelocationToNameArray()

void UE::Package::Relocation::Private::ApplyRelocationToNameArray ( const FPackageRelocationContext InPackageRelocationContext,
TArrayView< FName PackageNames 
)

◆ ApplyRelocationToObjectImportMap()

void UE::Package::Relocation::Private::ApplyRelocationToObjectImportMap ( const FPackageRelocationContext InPackageRelocationContext,
TArrayView< FObjectImport ImportMapView 
)

◆ ApplyRelocationToSoftObjectArray()

void UE::Package::Relocation::Private::ApplyRelocationToSoftObjectArray ( const FPackageRelocationContext InPackageRelocationContext,
TArrayView< FSoftObjectPath SoftObjectPaths 
)

◆ ShouldApplyRelocation()

bool UE::Package::Relocation::Private::ShouldApplyRelocation ( const FPackageFileSummary PackageSummary,
FStringView  LoadedPackageName,
FPackageRelocationContext OutPackageRelocationContext 
)

Determine if we should relocate the package or not. Populate the context for the relocation functions if the package should be relocated

Note: Keep the package summary and the source of LoadedPackageName StringView in memory as the OutPackageRelocationContext use a view on the data of these arguments

◆ TryRelocateReference()

bool UE::Package::Relocation::Private::TryRelocateReference ( const FPackageRelocationContext InPackageRelocationContext,
FStringView  InPackageNameToRelocate,
FStringBuilderBase OutNewLocation 
)

Try to relocate a package name with the same relative pathing from the current package path as from the original package path i.e. OriginalPackagePath: /Game/Folder/ CurrentPackagePath: /Game/OtherFolder/SubFolder/ Example 1: InPackageNameToRelocate: /Game/Folder/Sub/Asset OutNewLocation: /Game/OtherFolder/SubFolder/Sub/Asset Example 2: InPackageNameToRelocate: /Game/OtherAsset OutNewLocation: /Game/OtherFolder/OtherAsset

Parameters
InPackageRelocationContextThe context used for the relocation of the loaded asset
InPackageNameToRelocateThe package name we want to remap relative to the current location
OutNewLocationThe relocated package name.
Returns
True If the package need to be relocated.