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]
even though ASTC could encode other values of A, still clamp as if it was BC6H for consistency
now all compressed HDR formats should clamp the same way that Oodle Texture currently does
#preflight 6296556c452ffe576a816993
#rb fabian.giesen
[CL 20440882 by charles bloom in ue5-main branch]
#rb markus.breyer
#ROBOMERGE-AUTHOR: tom.noonan
#ROBOMERGE-SOURCE: CL 20390598 via CL 20391788 via CL 20391801 via CL 20391809
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20398472 by tom noonan in ue5-main branch]
A recent change in World Partition added actor pinning during the save process to
try to ensure that those actors do not get unloaded after saving. This involves
dirtying the WorldFolders object that lives in the /Engine/Transient package and
ends up triggering another package dirty event that invokes
FConcertWorkspaceUI::OnMarkPackageDirty(). The dirtying of that package
should have been ignored for the purposes of Multi-User, but the call to
ShouldIgnorePackageDirtyEvent() to determine that came after the call
to HasLiveTransactionSupport(). The latter ends up reading class paths off
of the IncludeObjectClassFilters property of UConcertSyncConfig and then
attempts to load those classes using TryLoadClass(). This eventually invoked
a call to StaticFindObjectFast(), but since we are in the middle of a package
save at this point, we ended up triggering a fatal log message.
To address this, we simply perform the check to determine whether a package
dirty event should be ignored before we check whether there is live transaction
support for the package.
#jira UE-153112
#rb jason.walter
#preflight 62911f66a84d43e1a0bab136
[CL 20397436 by matt johnson in ue5-main branch]
This moves several private helper functions out of the ConcertSandboxPlatformFileUtils
namespace to instead be public in ConcertSyncClientUtil. It also adds a
SynchronizeAssetRegistry() function that takes the place of the IDirectoryWatcher::Tick()
call that was previously inserted into the sandbox discard process. This new function
can more readily be used elsewhere when file changes need to be applied immediately
in order to bring the Asset Registry up to date.
#jira UE-153112
#rb jason.walter
#preflight 628e6f44c511f67c9fd073a1
[CL 20373534 by matt johnson in ue5-main branch]
When disconnecting from an MU session, destroying the client's package manager
would previously always reload the current level's package if that level used external
objects, since the external packages those objects are in may also have changed.
If the level itself was created while in the MU session though, the level's package
would only exist inside that session's sandbox, so leaving the session would destroy
the sandbox and purge that package, so there is no need to attempt to reload it.
#jira UE-153112
#rb jason.walter
#preflight 628c07343200b4415f36c805
[CL 20373280 by matt johnson in ue5-main branch]
Any temporary packages created while in an MU session will not exist on disk when
leaving that session and the sandbox is discarded, so they should not be reloaded.
This resolves an issue where if a world partition level is created and saved while in an
MU session, temporary packages for the external objects will be created and were
previously being marked dirty. When leaving the session, the package manager would
try and fail to reload all of those now defunct temporary packages and would issue an
error dialog about the failure.
#jira UE-153112
#rb jason.walter
#preflight 628c27ad3200b4415f3afbc1
[CL 20350731 by matt johnson in ue5-main branch]
This ensures that the Asset Registry is updated appropriately especially when files or
packages that exist only in the sandbox are deleted during a Multi-User session.
One problematic case was with the use of World Partition levels in a Multi-User session when
actors are added during the session, causing the creation of external packages that exist
only in the session's sandbox. When leaving the session, the sandbox is discarded and the
World Partition level is immediately reloaded. While the sandbox discard was properly
identifying the sandbox-only external packages and deleting them, and it was also registering
the file changes with the FDirectoryWatcherModule, doing so would only queue the file
changes as pending. Without an explicit call to IDirectoryWatcher::Tick(), the file deletes
would be processed *after* the World Partition level had already been reloaded, in which
case the Asset Registry is out of date and still contains a cached description of the added
actors. The actor's external package was indeed deleted from disk though, so the actor
would show as unloaded in the level when the level was reloaded. This could lead to situations
where the load state of the actor in World Partition gets out of sync with the level's list of
loaded actors, and a subsequent background search of the content directory could end up
clearing the stale entries at any time, either of which could potentially lead to crashes.
#jira UE-150626
#rb jason.walter
#preflight 62866ad8614041edb7089339
[CL 20287716 by matt johnson in ue5-main branch]