This change consists of multiple changes:
Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values
AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes
Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names
#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32
#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786
#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20448496 by robert manuszewski in ue5-main branch]
Some compilers (clang13) are now optimizing away the this == nullptr checks, causing crashes. MSVC does not currently do so, so adding this check to catch these issues sooner rather then on clang13 only platforms
#jira UE-155379
#rb Steve.Robb
#preflight 62964e150c151996e1243b5f
[CL 20442719 by Brandon Schaefer in ue5-main branch]
(disabled until all ANY_PACKAGE removal changes are in)
#jira UE-99463
#rb Steve.Robb
#preflight 62921cafdb0a62f25c07b693
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20407210 via CL 20407235 via CL 20407352 via CL 20407427
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20409051 by robert manuszewski in ue5-main branch]
- Crash: There was a missing FScopeLock when reading the skeletal mesh imported bulk data this was crashing if we access the bulkdata in two different thread in same time.
- Deadlock: The reload package function is doing a TThreadSfeObjectIterator which deadlock if the inner code create a UObject. The skeletalmesh build can be running in another thread and can create UObject when building the morphtargets. The fix is to move the work outside of the iterator, the iteration now just store the UObject into a TArray and the work is execute in a for loop after the iteration.
#jira UE-154208
#preflight 6290dd464f63120d8e2583db
#rb danny.couture
#rnx
#lockdown jeanmichel.dignard
#ROBOMERGE-AUTHOR: alexis.matte
#ROBOMERGE-SOURCE: CL 20393643 in //UE5/Release-5.0/... via CL 20397182
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20399670 by alexis matte in ue5-main branch]
#rb Paul.Chipchase, PJ.Kack, CarlMagnus.Nordin
#jira none
#preflight 629085d14f63120d8e170977
###
This change attempts to merge the editor and the runtime version of bulk data, i.e. bulk data one and two.
The major difference between the two is the fact that the editor version supported element vice
serialization via inheritance. This has been complelety removed in the runtime version. In order
to mitigate this divergance a non-virtual base class has been extracted that forms the base
for the untyped and typed versions of bulk data.
The untyped version is only used in editor and will be deprecated. However this is a breaking change,
previously it was possible to inherit from FByteBulkData in editor builds.
Other differences between the two includes:
* IsBulkDataLoaded - returns true for bulk data 1 if an allocation has been made even if the size is zero
* StartStreaming - was removed in bulk data 2 and has been removed
* FlushAsyncLoading - bulk data 2 was busy waiting, now an event is used
All I/O related functionality has been extracted into BulkDataStreaming.cpp and is using
a FBulkDataChunkId that is either a package path or a package ID.This could potentially
be extended to contain a cache key in development builds to support loading from DDC, i.e derived
data references.
[CL 20391050 by Per Larsson in ue5-main branch]
Add ShortestToGarbage option to deduplicate reference chains by the root reference & the first garbage object encountered.
Do not use the 'Visited' counter for the FGCObject referencer so that we can find multiple chains that terminate there since it handles many disparate types of reference.
When removing duplicate chains, if the chain root is the GC object referencer, use the previous object in the chain as a key instead.
Sort chains by length before deduplicating in shortest/longest mode.
Truncate GCObjectReferencer strings in case they overflow FName's capacity.
#rb none
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20384061 via CL 20384066 via CL 20384814 via CL 20384939
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20387039 by robert millar in ue5-main branch]
Requires base casses to handle recursion for script packages and for finding UClass::StaticClass().
The class of class is class, and the outer of the class UPackage is a UPackage.
#rb none
#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20355908 via CL 20355936 via CL 20356012 via CL 20356034
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)
[CL 20357501 by robert millar in ue5-main branch]