Commit Graph

1657 Commits

Author SHA1 Message Date
Matt Peters
3c2010d281 AppendToClassSchemaContext: Hide the use of FBlake3 behind an interface so we can easily change it.
#rb Steve.Robb
#rnx
#preflight 62975270a660a44a23b4ac94

[CL 20451128 by Matt Peters in ue5-main branch]
2022-06-01 08:05:42 -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
George Rolfe
04df2dac7c TemplateString + customization
#jira none
#rb sebastian.nordgren
#preflight 6295f14f926be5fb68b3e29a

[CL 20435453 by George Rolfe in ue5-main branch]
2022-05-31 07:40:18 -04:00
robert manuszewski
43d504502b Adding automated startup tests to check if class / struct / enum / property metadata contains values with short type names which will help with ANY_PACKAGE removal
(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]
2022-05-28 12:18:53 -04:00
George Rolfe
1733b33a3f Added TIsUEnumClass trait with UHT integration
#jira none
#rb tim.smith
#rb steve.robb
#preflight 6290bb1c1f0041249bec1f57

[CL 20391947 by George Rolfe in ue5-main branch]
2022-05-27 08:28:20 -04:00
Per Larsson
c30e677d1b Merge BulkData 1&2
#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]
2022-05-27 04:31:58 -04:00
robert millar
ae6572db39 Refactor reference chain searching to handle multiple objects at once to reduce time spent scanning all objects and creating/deleting temporary structures.
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]
2022-05-26 18:34:44 -04:00
robert millar
412079529f Add IsGarbage function.
#rb none

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20368750 via CL 20368758 via CL 20369216 via CL 20369301
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20370894 by robert millar in ue5-main branch]
2022-05-25 16:27:55 -04:00
Steve Robb
c20cb33cf6 Fix for copy+pasted description for UStruct::DestroyStruct.
#jira UE-114278
#rb trivial
#preflight none

[CL 20368857 by Steve Robb in ue5-main branch]
2022-05-25 14:22:21 -04:00
robert manuszewski
ab7e946c3b New utility functions for ANY_PACKAGE removal
- UClass::TryFindTypeSlow
- UClass::TryFindTypeSlowSafe
- UClass::TryConvertShortTypeNameToPathName
- UClass::TryFixShortClassNameExportPath
- Additional options for StaticFindFirstObject
- Added a new overload for FObjectPropertyBase::GetExportPath

#jira UE-99463
#rb Steve.Robb
#preflight 628d28a2c97e4beea3ab258f

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20360134 via CL 20360138 via CL 20360316 via CL 20360356
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20360692 by robert manuszewski in ue5-main branch]
2022-05-25 02:13:39 -04:00
robert manuszewski
77ac0ff10f Adding UStruct::GetStructPathName() (part of a bigger change required for a fix)
#rb trivial
#preflight 62863b012b53e2be4c972d30

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20344772 via CL 20344773 via CL 20344775 via CL 20344777
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20345312 by robert manuszewski in ue5-main branch]
2022-05-24 04:18:40 -04:00
HertzDonut
90f1d6a993 UStructs can now provide a CanEditChange override by setting the TStructOpsTypeTraitsBase2::WithCanEditChange trait.
PR #8877: Contributed by HertzDonut

#rb sebastian.nordgren
#preflight 628b6da1183c1e134617e4c3

[CL 20323458 by HertzDonut in ue5-main branch]
2022-05-23 07:33:11 -04:00
robert manuszewski
f8a812a32f Converting hardcoded short class/enum names to pathnames ahead of ANY_PACKAGE removal
#rb trivial
#jira UE-99463
#preflight 6288fd998828ea88c8aef3d0

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20314896 via CL 20314897 via CL 20314903 via CL 20314904
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315214 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:02 -04:00
matt breindel
6114886c10 Introduce new FVirtualStackAllocator which provides alloca() type functionality backed by virtual memory. Only supported on platforms with support for manual virtual memory management.
[REVIEW] [at]*tim.tillotson
#rb steve.robb tim.tillotson
#preflight 62859e01614041edb7c36eed (failed for seemingly unrelated reasons)

#ROBOMERGE-AUTHOR: matt.breindel
#ROBOMERGE-SOURCE: CL 20284331 via CL 20284341 via CL 20284483 via CL 20284591
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20304687 by matt breindel in ue5-main branch]
2022-05-20 18:45:18 -04:00
tom noonan
f174a13ea8 Fixed Instances of a script in the world copied from a template will continue to use the template's version of the class
Originally prepared by markus.breyer with some additional fixes for some issues I was seeing while testing

[REVIEW] [at]markus.breyer, [at]robert.manuszewski

#ROBOMERGE-AUTHOR: tom.noonan
#ROBOMERGE-SOURCE: CL 20277717 via CL 20277723 via CL 20277728 via CL 20277731
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20278380 by tom noonan in ue5-main branch]
2022-05-19 07:41:50 -04:00
Matt Peters
820edc49b5 EditorDomain: Add UObject::AppendToClassSchema so that textures can declare EnableLegacyAlphaCoverageThresholdScaling and use different EditorDomain packages when that variable is changed. This will also add to the new hybrid iterative cook system to allow detection of when iteratively-cooked packages need to be invalidated due to changes in Serialize and PostLoad.
#rb Zousar.Shaker
#rnx
#preflight 6284e723614041edb7763cef

[CL 20259777 by Matt Peters in ue5-main branch]
2022-05-18 09:02:27 -04:00
paul chipchase
f85fad88ff It is now possible to disable virtualization for all payloads owned by a specific asset type by adding the name of the asset to [Core.ContentVirtualization]DisabledAsset string array in the engine ini file.
#rb Per.Larsson
#rnx
#jira UE-151377
#preflight 628364050039ea57a52d6989

### Virtualization
- [Core.ContentVirtualization] in the engine ini file now supports an array called 'DisabledAsset' which can be used to name asset types that should not virtualize their payloads.
-- By default (in BaseEngine.ini) we have disabled the StaticMesh asset as we know it will crash if a payload is missing and the SoundWave asset as it still is pending testing.
- This new way to disable virtualization is data driven. The older hard coded method has not been removed but will likely be reworked in a future submit.
- Now when an editor bulkdata is adding it's payload to the package trailer builder during package save it will poll the virtualization system with a call to the new method ::IsDisabledForObject by passing in it's owner.
-- If the owner is valid and was present in the 'DisabledAsset' array then the method will return true and the EPayloadFlags::DisableVirtualization flag will be applied.

### Package Trailer
- The pre-existing functionality of enum EPayloadFilter has been moved to a new enum EPayloadStorageType as will only filter payloads based on their storage type.
- EPayloadFilter has been modified to filter payloads based on functionality although at the moment the only thing it can filter for is to return payloads that can be virtualized, it is left for future expansion.
- EPayloadFlags has been reduced to a uint16 with the remaining 2bytes being turned into a new member EPayloadFilterReason.
- This new member allows us to record the exact reason why a payload is excluded from virtualization. If it is zero then the payload can virtualize, otherwise it will contain one or more reasons as to why it is being excluded. For this reason the enum is a bitfield.
- Added overloads of ::GetPayloads and ::GetNumPayloads that take EPayloadFilter rather than a EPayloadStorageType
- Added wrappers around all AccessMode types for FLookupTableEntry.
- FPackageTrailerBuilder has been extended to take a EPayloadFilterReason so that the caller can already provide a reason why the payload cannot be virtualized.
-- As a future peace of work this will probably be changed and we will ask the caller to pass in the owner UObject pointer instead and then we will process the filtering when building the package trailer to a) keep all of the filtering code in one place b) keep the filtering consistent

### PackageSubmissionChecks
- The virtualization process in  will now request the payloads that can be virtualized from the package trailer, which respects the new payload flag, rather than requesting all locally stored payloads.

### UObjects
- There is no need for the SoundWave or MeshDescription classes to opt out of virtualization on construction. This will be done when the package is saved and is now data driven rather than being hardcoded.

### DumpPackagePayloadInfo
- The command has been updated to also display the filter reasons applied to each payload

[CL 20240971 by paul chipchase in ue5-main branch]
2022-05-17 07:54:28 -04:00
Andrew Davidson
9741042a2b Reduce use of UE_DECLARE_LWC_TYPE macro to improve Intellisense.
Moved Math forward declarations from CoreFwd.h to Math/MathFwd.h
#rb steve.robb
#preflight 62837df43c1cdc59e2b07dd5

[CL 20240602 by Andrew Davidson in ue5-main branch]
2022-05-17 07:05:35 -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
andy sonnenburg
ff4861eacf Rename AreEqual to AreIdentical in dynamic value representation.
#preflight 627e9fac6d7654cc68b34001

#ROBOMERGE-AUTHOR: andy.sonnenburg
#ROBOMERGE-SOURCE: CL 20187151 via CL 20187642 via CL 20188658 via CL 20188732 via CL 20188761
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20191586 by andy sonnenburg in ue5-main branch]
2022-05-13 18:56:58 -04:00
Matt Peters
7032a26f23 SavePackage: Add IsCachedCookedPlatformDataLoaded calls; it is required by the contract of BeginCacheForCookedPlatformData. Add a Timeout result to return to the cookerto wait if any IsCachedCookedPlatformDataLoaded calls are incomplete.
#rb Francis.Hurteau
#rnx
#preflight 627c2ef47535c51f4c93b510

[CL 20151503 by Matt Peters in ue5-main branch]
2022-05-11 18:03:33 -04:00
michael nicolella
cd56533446 Adding a thread_local global FFrame* tracking pointer that mimics the ScriptStack in the FBlueprintContextTracker, but remains enabled when DO_BLUEPRINT_GUARD=0
#rb Phillip.Kavan
#preflight 6279dc5b5b16ddee36e88d21

#ROBOMERGE-AUTHOR: michael.nicolella
#ROBOMERGE-SOURCE: CL 20118901 via CL 20120619 via CL 20120654 via CL 20120674
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20121921 by michael nicolella in ue5-main branch]
2022-05-10 09:04:27 -04:00
robert millar
ef3f3a4ef0 Always include referencing property info in HandleGarbageReference since it's guarded by a cvar anyway.
Allow ENABLE_GC_OBJECT_CHECKS to be overriden outside of GarbageCollection.h

#rb none

#ROBOMERGE-AUTHOR: robert.millar
#ROBOMERGE-SOURCE: CL 20085499 via CL 20086136 via CL 20086228 via CL 20086317
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20108298 by robert millar in ue5-main branch]
2022-05-09 15:04:33 -04:00
louisphilippe seguin
521fda3d2d NetConditionGroup feature
* Added new ELifetimeCondition COND_NetGroup, that is only supported on replicated subobjects.
* Any subobject using COND_NetGroup must be part of a netcondition group via the NetConditionGroupManager world subsystem for it to get replicated.
* PlayerControllers can be members of a group via IncludeInNetConditionGroup
* When a netgroup subobject replicates to a connection we will only replicate it if the playercontroller of the connection is a member of atleast one group of that subobject.
* NetGroupOwner and NetGroupReplay are special groups that automatically replicate to the owner's connection or the replay net driver.
* This feature is only available to Actors or Actorcomponents with bReplicateUsingRegisteredSubObjectList = true

#jira UE-132891
#rb Ryan.Gerleve, Mattias.Hornlund, John.Barrett

#ROBOMERGE-AUTHOR: louisphilippe.seguin
#ROBOMERGE-SOURCE: CL 20076279 via CL 20076546 via CL 20076844
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20106219 by louisphilippe seguin in ue5-main branch]
2022-05-09 13:48:08 -04:00
paul chipchase
6cef6bb3c3 Add a utility to load a package trailer directly from an archive
#rb trivial
#rnx
#preflight 6273dd6a5c29fb7661e98c60

[CL 20057584 by paul chipchase in ue5-main branch]
2022-05-05 10:34:32 -04:00