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]
Fix a nullptr issue when running in -game -server using the unrealEditor.exe
GEditor might be null
#rb: James.Hopkin
#preflight 626ac894a5009ff191b5d63c
#ROBOMERGE-AUTHOR: eric.knapik
#ROBOMERGE-SOURCE: CL 19965770 via CL 19968113 via CL 19968395 via CL 19968875
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 19972764 by eric knapik in ue5-main branch]
#rb Danny.Couture, Matt.Peters
#jira UE-145191
#rnx
#preflight 62286bebf4469cadac0977c1
#lockdown Simon.Tourangeau
### Problem
- This problem was introduced in CL 19224316 which removed the direct call to ::ResetLoaders as forcing a package that was being unloaded to load all of it's bulkdata payloads into memory did not make much sense.
- Since the fix in that CL was about flushing all async compilation work before calling ::ResetLoaders, if we could avoid calling it unless absolutely needed (objects that were not gced) then we could reduce the chance of us actually needing to flush the async compilation work, which can be slow.
### Fix
- However if the package is being renamed, then the uobjects contained within the package will have been moved to the new package, in which case we want any bulkdata objects that they own to remain valid so we cannot rely on the call to ::ResetLoaders that occurs when a package is garbage collected as that variant leaves the newly detached bulkdata objects in an invalid state that can no longer access their payloads.
- Rolled the fix back to a 'dumber' version. We once again call ::ResetLoaders on each package but before we start doing that we check all packages that we are trying to unload to see if any have asnyc compilation work running and only if we detect this do we flush the system.
-- Renamed ::ResetPackageLoaders to ::FlushAsyncCompilation and moved it to be called much earlier.
-- Removed the array of weak ptrs added in 19224316 as they are no longer used.
- I also changed the code documentation on ::ResetLoaders to make it clear why it is being called there.
#ROBOMERGE-AUTHOR: paul.chipchase
#ROBOMERGE-SOURCE: CL 19319379 in //UE5/Release-5.0/... via CL 19319782
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)
[CL 19347983 by paul chipchase in ue5-main branch]
#rb Danny.Couture
#jira UE-144025
#rnx
#preflight 621f9577901d830f36563e26
#lockdown Mark.Lintott
- There is the potential here to call ResetLoader on a package that has async compilation work running, which currently is not thread safe. In addition, calling ResetLoader at this point can force bulkdata payloads to be loaded off disk only for the package to be immediately destroyed via garbage collection.
- The call to ::ResetLoader has been removed, we now rely on the loader being reset as part of the garbage collection process, which will not force the payload to be loaded.
- Note that if a package is garbage collected there is already code to make sure that it waits on it's async compilation tasks (if any) and so should be thread safe.
- As a safety precaution we retain an array of weak pointers to the packages and check them after the garbage collection pass to see if any of the packages survived. If they did survive we then call ::ResetLoader on them to detach the package from the file on disk, maintaining the existing behaviour.
-- Before we call ::ResetLoader we check to see if any of the packages has outstanding async compilation work and if so we flush the compilation manager to avoid any potential threading issues.
#ROBOMERGE-AUTHOR: paul.chipchase
#ROBOMERGE-SOURCE: CL 19224316 via CL 19226273 via CL 19226448 via CL 19226623 via CL 19226800
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19230278 by paul chipchase in ue5-main branch]
This could occur when an actor on a sublevel has its class modified when ReloadPackages() is called.
This was likely caused by change 17997995 where FBlueprintCompileReinstancer::ReplaceInstancesOfClass_Inner sets CLASS_NewerVersionExists. This causes the flag to be present during PostPackageFixup which didn't occur in previous versions.
#jira UE-140850
#preflight 6204a23da30b354a40fb95c1
#rb Francis.Hurteau, Jason.Walter
#lockdown Alejandro.Arango
#ROBOMERGE-AUTHOR: patrick.hardy
#ROBOMERGE-SOURCE: CL 18940573 in //UE5/Release-5.0/... via CL 18941026 via CL 18941500
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 18941531 by patrick hardy in ue5-main branch]
This should saves around ~1.5 Mb to ~3 Mb at runtime with ~50000 packages
Added a new core define UE_STRIP_DEPRECATED_PROPERTIES that could be used to wrap deprecated properties and strip them to regain memory when a projects becomes compliant. this can be set in the project target file
Deprecated most public properties from UPackage and created accessors for them
#rb PJ.Kack
#jira UE-138957
#preflight 61f17a6f7266f4e79bd62601
#ROBOMERGE-AUTHOR: francis.hurteau
#ROBOMERGE-SOURCE: CL 18738937 in //UE5/Release-5.0/... via CL 18739524 via CL 18741373
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18742135 by francis hurteau in ue5-main branch]
This change also attempts to reduce some of the complexity of the function by breaking out some of the filtering that happens at the start.
#jira UE-132092
#rb francis.hurteau
#preflight 61b8aef9c8566c1582bdeb9e
#ROBOMERGE-AUTHOR: jason.walter
#ROBOMERGE-SOURCE: CL 18454207 in //UE5/Release-5.0/... via CL 18454212
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)
[CL 18454216 by jason walter in ue5-release-engine-test branch]
#rb Steve.Robb
[FYI] PJ.Kack
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 18416493 via CL 18416497 via CL 18416499 via CL 18435022 via CL 18437322
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)
[CL 18437640 by robert manuszewski in ue5-release-engine-test branch]
FPluginUtils::UnloadPlugins will unmount plugins even if some of its packages cannot be unloaded
#rb Matt.Peters
#preflight skip
#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 18315688 via CL 18320378 via CL 18321619 via CL 18321713 via CL 18321909 via CL 18321927
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18321936 by dave belanger in ue5-release-engine-test branch]
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971
[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
UEditorEngine::OnAssetLoaded calls UEditorEngine::InitializeNewlyCreatedInactiveWorld for any world loaded, which can result in a resident world asset that is only partially initialized (inactive worlds disable things like AI).
UEditorEngine::Map_Load finds this resident world and attempts to re-use it, however since bIsWorldInitialized is already set to true it skips running the normal editor world initialization (which enables things like AI), and the end result is an editable world with certain features uninitialized.
UEditorEngine::Map_Load does attempt to purge any resident worlds that have been left lingering, but had made special exceptions for the world that the editor is attempting to load (UE-9631, UE-17205). This change has that logic run on any lingering resident worlds that have already been initialized, thus ensuring that the world being edited will definitely be initialized with the correct set of enabled features.
#jira UE-104140
#rb Richard.TalbotWatkins, JeanMichel.Dignard
#preflight 609e9f0a423c960001f1fa36
#ROBOMERGE-SOURCE: CL 16331756 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)
[CL 16331771 by jamie dale in ue5-release-engine-test branch]
* Modified UPackageTools::UnloadPackages() to return true if there are no packages to process
#rb trivial
#robomerge release-5.0-m2
[CL 14299543 by Sebastien Lussier in ue5-main branch]