Commit Graph

275 Commits

Author SHA1 Message Date
nick darnell
ff3e36b82d Make the WarnIfAssetsLoadedInScope respect the enabled state.
[CL 23182578 by nick darnell in ue5-main branch]
2022-11-17 15:29:26 -05:00
patrick enfedaque
8e9ab48d37 Fix regression from CL 21826272 where GetAssetPathRedirection was no longer redirecting based on AssetPath causing some failed redirections of SoftObjectPaths when saving new maps
#jira UE-169239
#rb rob.millar
#preflight 636d1bfd4170db7932b265fb

[CL 23084824 by patrick enfedaque in ue5-main branch]
2022-11-10 14:03:09 -05:00
nick darnell
3845a7f3a6 Editor - Introducing a new helper utility class, FWarnIfAssetsLoadedInScope exists in CoreUObject so that it can be used in lots of places, but it will only work in Editor builds, so it is marked as such. It allows you to throw a scope around some code to detect unexpected asset loads during that scope and then emit them as errors in the editor. It wont warn anyone that doesn't have -WarnIfAssetsLoaded in their commandline. It's a great little debugging utility when you're trying to prevent unexpected hitches from being introduced into the editor from unnessesary loads.
#jira UE-165574

[CL 23071814 by nick darnell in ue5-main branch]
2022-11-10 01:08:11 -05:00
henrik karlsson
fa90b399a4 Added includes for future change. This changelist only contains added #include and a couple of empty placeholder files
Tested compiling fortnite, unrealeditor, lyra, qagame with non-unity/pch

#preflight 63635997876630122adeab9f
#rb none

[CL 22958990 by henrik karlsson in ue5-main branch]
2022-11-03 14:18:47 -04:00
robert manuszewski
6dc32674ac Adding FPackageName::GetContentPathForPackageRoot to be able to get the filesystem path (e.g. D:/Project/Engine/Content) of a given package root (e.g. /Engine/)
#rb Steve.Robb
#preflight 6360c64663608aee36d1a954

[CL 22888595 by robert manuszewski in ue5-main branch]
2022-11-01 15:08:10 -04:00
edwin maynard
2f2e641dd0 [Backout] - CL22878456 (Backed out due to CIS issues)
[FYI] Robert.Manuszewski
Original CL Desc
-----------------------------------------------------------------
Adding FPackageName::GetContentPathForPackageRoot to be able to get the filesystem path (e.g. D:/Project/Engine/Content) of a given package root (e.g. /Engine/)

#rb Steve.Robb
#preflight 6360c64663608aee36d1a954

[CL 22888588 by edwin maynard in ue5-main branch]
2022-11-01 15:08:01 -04:00
robert manuszewski
263c23a1dc Adding FPackageName::GetContentPathForPackageRoot to be able to get the filesystem path (e.g. D:/Project/Engine/Content) of a given package root (e.g. /Engine/)
#rb Steve.Robb
#preflight 6360c64663608aee36d1a954

[CL 22888560 by robert manuszewski in ue5-main branch]
2022-11-01 15:07:16 -04:00
Matt Peters
39227f54cd EditorDomain: Add static reflected UObject method DeclareConstructedClasses. Classes that can construct other classes during PostLoad need to declare those classes.
UObject statics: Improve the feedback in the compile error for static reflected UObject methods when the function prototype is incorrect.
UObject delegates: Add an OnObjectConstructed delegate, and add the Object being PostLoaded to the PackageAccessTracking UE_TRACK_REFERENCING_PACKAGE_SCOPED, so we can give a warning when objects are constructed during PostLoad that have not been declared via DeclareConstructedClasses.
EditorDomain: Improve performance of CalculatePackageDigest by precomputing the inclusive schema for every class instead of needing to calculate it each time that class is used.
EditorDomain: Fix bug in UObject::DeclareCustomVersions that was causing array properties not to be parsed.
EditorDomainUtils: change ClassDigests to identify ClassPaths using TopLevelAssetPath to match the changes made by ANY_PACKAGE.
CoreRedirects: Add FCoreRedirectObjectName costructor from FTopLevelAssetPath to reduce boilerplate for detecting class redirects.
#rb Zousar.Shaker
#rnx
#preflight 6345c695e94850122406b944

[CL 22469685 by Matt Peters in ue5-main branch]
2022-10-11 20:19:09 -04:00
Mike Beach
765a9c71b8 Fixing up /Config/ root path resolution, and making it match the other game sub-directories (current behavior works as long as the game project is organized in this fashion: //<DEPOT>/<ProjFolder>, but it does not work if the project folder is nested somewhere else. This fix resolves that problem.).
#preflight 63448c7a7045f13c96dffc0e

[CL 22460108 by Mike Beach in ue5-main branch]
2022-10-11 12:38:59 -04:00
nick darnell
3cadcb77af Core - Introducing FindPackageReferencesInObject, this utility function provides a pretty path from the root object to any references to any of the packages provided.
Given a root object, this function will call the callback every time it encounters a reference in the root object (including all inlined/instanced UObjects.  The returned references will be in an easily understood debugging format so that they're easy to understand the context.

For example, Actions[2](GameFeatureAction_Activities)->ObjectActivitiesInfo[0].TargetReference

Where TargetReference was one of the listed PackagesReferenced.  The point of this function is to assist in the reporting of references between objects you need to show the developer.

[CL 22366197 by nick darnell in ue5-main branch]
2022-10-05 19:10:37 -04:00
Robert Millar
6a3da51ffd Removing FNames containing asset paths (/Path/To/Package.AssetName) or subobject paths (/Path/To/Package.AssetName:Inner).
These FNames can take 30mb+ of memory in a large project.
Refactor FSoftObjectPath to store a FTopLevelAssetPath instead of an FName for the top level asset part.
Refactor FAssetData to infer the object path from the PackageName and AssetName fields and an editor-only field called OptionalOuterPath for external actors which are non-top-level assets.
Refactor FAssetBundleData to only store top level asset references.
Increase EUnrealEngineObjectUE5Version for FSoftObjectPath invalidation.
Increase FAssetRegistryVersion to invalidate serialization of FAssetData and FAssetBundleData - asset registry serialization does not see EUnrealEngineObjectUE5Version.
Replace TMap in Asset Registry with TSet to avoid duplicating the key fields.
Remove object path FName fields from native blueprint make/break functions for FARFilter - those pins will be orphaned.
Refactor redirect collector to use soft object paths rather than FNames.

UE_DEPRECATED markers have been commented out in this change to allow separate submission of deprecation fixups across the engine.

#jira UE-161932
#rb matt.peters,francis.hurteau,ben.zeigler
#lockdown marc.audy
#preflight

[CL 21826272 by Robert Millar in ue5-main branch]
2022-09-06 15:02:43 -04:00
robomerge
2c246d6859 Added support for diffing objects managed by a transaction annotation
ITransactionObjectAnnotation has two new functions; SupportsAdditionalObjectChanges to state whether the annotation type supports object diffing (default false), and ComputeAdditionalObjectChanges to actually compute the diff against another annotation (which must be of the same type).

This allows transaction annotations that entirely manage other objects (such as FActorTransactionAnnotation which manages the SCS and UCS components on an actor) to produce meaningful change information that can be passed to the PostTransacted function of the managed object (tagged with ETransactionObjectChangeCreatedBy::TransactionAnnotation).

Note: It is not safe to cache the result of a ComputeAdditionalObjectChanges outside of the current transaction, as objects managed by a transaction annotation can have volatile names. This means that the transaction annotation itself will have ComputeAdditionalObjectChanges called on it during undo/redo as well as during transaction snapshot/finalization, and means that the transaction annotation must have its own way of pairing old->new objects over time.

#preflight 63062421516bef57ffe8bafe
#rb Rex.Hill, Bart.Hawthorne, Francis.Hurteau, Jason.Walter

[CL 21572764 by robomerge in ue5-main branch]
2022-08-25 17:10:33 -04:00
UnrealBot
73409369c0 Branch snapshot for CL 21319338
[CL 21319338 in ue5-main branch]
2022-08-10 16:03:37 +00:00
jamie dale
1de56ef0a0 Hardened FPackageName::ParseExportTextPath to better ensure that the source matches the expected format before attempting the parse
#jira
#preflight 62d04a69e468fcfd0b254e6d
#rb Matt.Peters, Robert.Manuszewski
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21111820 via CL 21111855 via CL 21111885 via CL 21112241 via CL 21112393
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21142346 by jamie dale in ue5-main branch]
2022-07-17 22:39:34 -04:00
jamie dale
51aa93ab5c Fixed regression in FSoftObjectPath::SetPath from ANY_PACKAGE removal
The class part of an ExportText path now also starts with a /, so the code that was trimming it off during SetPath was no longer running.

#jira
#preflight 62cf05bb7822772758de6914
#rb Matt.Peters, Robert.Manuszewski
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21078121 via CL 21080081 via CL 21080570 via CL 21080909
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21083083 by jamie dale in ue5-main branch]
2022-07-13 18:30:48 -04:00
Martin Ridgers
b22fedf770 Fixed deadlock if FLongPackagePathsSingleton isn't yet initialised.
The constructor for FLongPackagePathsSingleton would take a write lock. This would block however as there are Get() call sites where a read lock is already being held. But as the singleton construction is thread-safe there is no need to take a write lock in constructor and it has been removed. To mitigate the error returning in the future the Get() is called before taking any read locks. The lock was renamed and moved into FLongPackagePathsSingleton instead of a global.

#rb cm
#preflight 62be97728d5e67875907ebcf

[CL 20911412 by Martin Ridgers in ue5-main branch]
2022-07-01 02:58:57 -04:00
james hopkin
049e968491 [core] Removed header extension test in operator== to match WITH_EDITOR code.
[REVIEW] [at]Matt.Peters

#ROBOMERGE-AUTHOR: james.hopkin
#ROBOMERGE-SOURCE: CL 20772922 via CL 20772982 via CL 20772993 via CL 20772999 via CL 20773005
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20774449 by james hopkin in ue5-main branch]
2022-06-22 10:40:53 -04:00
steve robb
fd2a0b1e20 Removal of TEXT literal concatenations, which doesn't work in UTF-8 mode.
#rb devin.doucette
#jira UE-132142
#preflight 62a8748fa76c84377748036b

#ROBOMERGE-OWNER: steve.robb
#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 20647443 via CL 20648283 via CL 20648315
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20651786 by steve robb in ue5-main branch]
2022-06-14 12:46:34 -04:00
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
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]
2022-06-01 03:46:59 -04:00
CarlMagnus Nordin
3d5a2052dc AsyncLoading2: Add support for having multiple PackageStore backends
#preflight 6296fc872a1851b4ccae7e39
#rb pj.kack

[CL 20447121 by CarlMagnus Nordin in ue5-main branch]
2022-06-01 02:12:33 -04:00
danny couture
373563955a Fix potential deadlock by moving the ForEachObject sections that locks the hash table outside of another lock
#rnx
#rb Francis.Hurteau
#preflight 628f6b0680139a518168c9e5

[CL 20378034 by danny couture in ue5-main branch]
2022-05-26 08:06:42 -04:00
Matt Peters
2eca89a984 UClass: Move the UClass pointers to the cppclass's AddReferencedObject function onto a new type FUObjectCppClassStaticFunctions that allows us to easily add new static functions that are reflected in the same way.
Move the existing DeclareCustomVersions function which was declared as a virtual UObject function into a static UObject function using this method.

#rb Steve.Robb
#rnx
#preflight 62827303046b81bf93c15ef2

[CL 20226876 by Matt Peters in ue5-main branch]
2022-05-16 13:00:04 -04:00
pj kack
70b097884c GC: Fix incorrect assert in GCObjectReferencer (fallout from 19898875).
Assertion failed: GObjUnhashUnreachableIsInProgress || GObjIncrementalPurgeIsInProgress || !IsGarbageCollecting() [File:.\Runtime/CoreUObject/Private/Misc/GCObjectReferencer.cpp]
With the new default lock behavior it should be allowed to add and remove references outside of the reachability analysis scope.
With the legacy lock behavior checking IsGarbageCollectingAndLockingUObjectHashTables() means the same thing as IsGarbageCollecting().
When the legacy lock behavior is deleted this check can be simplified to check(!IsGarbageCollectingAndLockingUObjectHashTables()).

#jira UE-150654
#rb francis.hurteau, danny.couture, robert.millar
#rnx

#ROBOMERGE-OWNER: pj.kack
#ROBOMERGE-AUTHOR: pj.kack
#ROBOMERGE-COMMAND: _robomerge[bot4] UE5-MAIN
#ROBOMERGE-SOURCE: CL 20038707 via CL 20038717 via CL 20038721 via CL 20038724 via CL 20038728
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20038836 by pj kack in ue5-main branch]
2022-05-04 04:20:42 -04:00
brian bekich
d993e84cb6 Fix handling of invalid package paths from clients
#jira UE-145643
#rb ryan.gerleve

#ROBOMERGE-AUTHOR: brian.bekich
#ROBOMERGE-SOURCE: CL 19785177 via CL 19785195 via CL 19792886 via CL 19793235 via CL 19793656
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19809617 by brian bekich in ue5-main branch]
2022-04-19 11:36:06 -04:00
Jon Nabozny
8a888b2953 Add a console command that can be used to resolve Soft Object Paths in Editor, and change the warning for broken Soft Object Paths to include the Referencing Package Name.
#preflight 623ba15f0820efd094ae9d74

[CL 19488066 by Jon Nabozny in ue5-main branch]
2022-03-23 18:51:45 -04:00