Commit Graph

37 Commits

Author SHA1 Message Date
matt peters
c8ecba51d5 Add missing #pragma once.
#rnx
#rb matt.peters
#rbself trivial

[CL 33102032 by matt peters in ue5-main branch]
2024-04-19 10:09:10 -04:00
matt peters
3da2c17c2e Cooker: Add the ability to declare CookRuntimeReferences from UObject::Presave, for object classes that are culled on the targetplatform due to e.g. IsNeededForClientLoad=false but still want to add their references to the cook for that platform.
#rnx
#rb anton.dunchev, Zousar.Shaker

[CL 33099549 by matt peters in ue5-main branch]
2024-04-19 07:43:41 -04:00
devin doucette
d169efc6e4 Deleted FPropertyBag and remaining references to it
#jira UE-212134
#rb Francis.Hurteau
#rnx

[CL 33038564 by devin doucette in ue5-main branch]
2024-04-17 12:06:15 -04:00
jordan hoffmann
6609480c0a [BugFix] A new component added to a placed entity does not get saved when map is loaded with IDO.Enabled=true
#jira UE-207699
#rb Francis.Hurteau, Phillip.Kavan

[CL 33019754 by jordan hoffmann in ue5-main branch]
2024-04-16 19:47:46 -04:00
devin doucette
5a714b7a89 Replaced FPropertyBag with FPropertyPathNameTree for collecting unknown properties
#jira UE-211461
#rb Francis.Hurteau
#rnx

[CL 32933933 by devin doucette in ue5-main branch]
2024-04-12 12:37:01 -04:00
devin doucette
ef501dce13 Added FPropertyPathNameTree
This type will replace FPropertyBag as a means of gathering unique property paths during package loading.

#jira UE-211461
#rb Francis.Hurteau
#rnx

[CL 32932117 by devin doucette in ue5-main branch]
2024-04-12 11:44:00 -04:00
jordan hoffmann
0fc05bb8bf **This change was backed out because of cook errors. Removing a superfluous metadata check fixes the issue so this is a resubmission with the metadata check removed
[Backout] - CL32570115
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL32554750
[FYI] jordan.hoffmann
Original CL Desc
-----------------------------------------------------------------
[BugFix] changes made to IDOs in the details panel correctly mark the package dirty and save now.
[Refactor] IDOs and their Instances now share the same override set
[Feature] added FPropertyBagRepository::FindOwnerForInstanceDataObject method for reverse lookup
[Refactor] chanced some uses of UObjectBase* to UObject* in PropertyBagRespository to simplify code
#rb Phillip.Kavan, Francis.Hurteau, Andrew.Davidson
#jira UE-210574

[CL 32653950 by jordan hoffmann in ue5-main branch]
2024-04-01 18:11:06 -04:00
phillip kavan
bab7892466 Create a placeholder type object on failure to resolve a type import through an existing redirector asset at load time.
This allows a package export to still load its data to a property bag in this scenario.

#jira UE-209835
#rb Francis.Hurteau

[CL 32653262 by phillip kavan in ue5-main branch]
2024-04-01 17:38:29 -04:00
bob tellez
9269d5787f [Backout] - CL32554750
[FYI] jordan.hoffmann
Original CL Desc
-----------------------------------------------------------------
[BugFix] changes made to IDOs in the details panel correctly mark the package dirty and save now.
[Refactor] IDOs and their Instances now share the same override set
[Feature] added FPropertyBagRepository::FindOwnerForInstanceDataObject method for reverse lookup
[Refactor] chanced some uses of UObjectBase* to UObject* in PropertyBagRespository to simplify code
#rb Phillip.Kavan, Francis.Hurteau, Andrew.Davidson
#jira UE-210574

[CL 32570146 by bob tellez in ue5-main branch]
2024-03-28 02:38:10 -04:00
jordan hoffmann
87d9f2d9da [BugFix] changes made to IDOs in the details panel correctly mark the package dirty and save now.
[Refactor] IDOs and their Instances now share the same override set
[Feature] added FPropertyBagRepository::FindOwnerForInstanceDataObject method for reverse lookup
[Refactor] chanced some uses of UObjectBase* to UObject* in PropertyBagRespository to simplify code
#rb Phillip.Kavan, Francis.Hurteau, Andrew.Davidson
#jira UE-210574

[CL 32561414 by jordan hoffmann in ue5-main branch]
2024-03-27 18:25:06 -04:00
jordan hoffmann
ed9cec649d [Feature] generate new IDOs when objects are reinstanced/recompiled
[CrashFix] memory leak after reinstancing

- turned on property bag generation during CPFUO
- added functionality to FPropertyBagRepository::CreateInstanceDataObjectUnsafe which allows an external archive to be read. This is used by CPFUO
- rewrote FPropertyBagRepository::ReassociateObjects to copy metadata about properties were set by serialization from the old IDO to the new
- added CleanupLevel method that destroys all IDOs for objects that were outered to the level
- made sure that all IDOs have their ReferenceTokenStream assembled during class generation
#rb Phillip.Kavan
#jira UE-208185, UE-208975

[CL 32225922 by jordan hoffmann in ue5-main branch]
2024-03-13 16:05:26 -04:00
kevin macaulayvacher
abfebd7d6f Improves the performance of CoreRedirects
::Before::
- Boot -> PIE (6m3s)
- FCoreRedirects::RedirectNameAndValues: 18s

::After::
- Boot -> PIE (5m41s)
- FCoreRedirects::RedirectNameAndValues: 5.3s


- MatchWildcard=true support has been added to how CoreRedirects are defined in INI files. You may now define OldName="...SomeSuffix", OldName="SomePrefix..." or OldName="...SomeSubstring..." to perform string manipulation based matching for redirects, deprecating MatchSubstring=true
- Substring matches are very expensive compared to pure FName matching or even prefix and suffix matching. This expense is problematic since the presence of a substring matching rule can mean that all queries for a particular redirect type, such as package name, will need to perform the substring check even if a substring match is relatively uncommon. To combat this cost, we add a reimplementation of the PM-k, (PredictMatch-8) algorithm. This allows a redirect query to check for substring matches against _all_ possible substrings with a single pass over the redirect query name. The fuzzy matching is designed such that false positives may occur but not false negatives. When a fuzzy match is found we must perform the slow substring match to confirm. However fuzzy matching allows use to dramatically reduce our string scannin. In a case where there were 4 MatchSubstrings, from boot to PIE, we now perform slow substring matches < 0.8% of the time compared to previously.
- Replaces `FString` manipulation during redirect queries to instead use a small wrapper type `FNameUtf8String` which provides a small API to allow for FName comparisons, building and ultimately reducing copies. UTF8 is used since we need to ensure we have an encoding that we can keep the same for storing wildcard strings that will match how we query for wildcard matches. UTF8 is byte efficient for ANSI text, which improves fuzzy match prediction.

==========================================
Substring Stats
Substring Lookups:                24342736
Prediction Hit:                   72
Prediction Miss:                  213377
==========================================

#jira UE-204063
#rb Matt.Peters
[FYI] Francis.Hurteau

[CL 31941627 by kevin macaulayvacher in ue5-main branch]
2024-03-01 08:57:14 -05:00
devin doucette
6c4f1e4a4f Updated FPropertyTag to use FPropertyTypeName to represent the property type
This is a step toward deprecating the existing names used for these details and serializing the property type using its new TypeName member.

#jira UE-197352
#rb Andrew.Davidson, Francis.Hurteau
#rnx

[CL 31907456 by devin doucette in ue5-main branch]
2024-02-29 10:00:55 -05:00
phillip kavan
defecccd71 Fix to properly create multiple export objects with the same type when placeholder types are enabled and the load class import cannot be resolved (editor only).
Also made a few minor API tweaks (mostly cosmetic) and restored IsPropertyBagPlaceholderType() since I chose not to add an explicit class flag for it.

#rnx
#jira UE-197358
#rb Jordan.Hoffmann

[CL 31675590 by phillip kavan in ue5-main branch]
2024-02-21 00:43:55 -05:00
jordan hoffmann
1ca4bb7619 [RegressionFix] added launch fixup tool button back to the component action menu
#rb logan.buchy

[CL 31538784 by jordan hoffmann in ue5-main branch]
2024-02-15 17:18:00 -05:00
patrick enfedaque
acc5843091 FPropertyNode Editor Archetype/EditConst Policy
- Allow registration/unregistration of IArchetypePolicy/IEditConstPolicy which allow outside systems to provide policies
- Update some details customizations to make usage of new PropertyEditorPolicy::GetArchetype/IsPropertyEditConst which respects registered policies

#rb logan.buchy, Phillip.Kavan, Francis.Hurteau
#rnx

[CL 31467957 by patrick enfedaque in ue5-main branch]
2024-02-14 08:11:39 -05:00
phillip kavan
91216b7898 [UE]: More revisions to placeholder property bag type import/export serialization support during map asset loads in the editor.
Change summary:
- Modified ObjectPtr_Private::IsObjectPtrEqualToRawPtrOfRelatedType() to include a non-resolving NULL check for LHS. This allows unsafe type object pointers to equate to NULL object pointers (in addition to nullptr) - e.g. for compiled paths that do implicit type conversions from nullptr to TObjectPtr(nullptr). Also updated the unit test to reflect this behavior change.
- Replaced FPropertyBagRepository::IsPropertyBagPlaceholderType() with IsPropertyBagPlaceholderObject().
- No longer setting RF_HasPlaceholderType on placeholder import type CDOs. This allows UObject initializers to evaluate/dereference the CDO ptr normally as a UObject*, even if created with a placeholder type.
- Replaced direct RF_HasPlaceholderType flag queries with FPropertyBagRepository::IsPropertyBagPlaceholderObject() instead for placeholder export object queries in FLinkerLoad. This remains inclusive of the CDO.
- Now appending RF_HasPlaceholderType onto the ObjectFlags member for export entries created from placeholder type imports. The flag will be cleared if/when the correct instance is patched back into the export table (e.g. at reinstancing time).
- Modified FLinkerLoad::TryCreatePlaceholderTypeForExport() to remove the check for 'bSerializeUnknownProperty'. This does not get set until after we've created the placeholder type when we attempt to Preload() the export that's using it.
- Modified FLinkerLoad::Serialize() to virtualize serialization when loading a property bag for an object with a missing type import that was serialized with an asset version older than EUnrealEngineObjectUE5Version::SCRIPT_SERIALIZATION_OFFSET.
- Modified FLinkerLoad::Preload() to include an asset version check for when serialization of placeholder exports can be safely narrowed to SerializeScriptProperties(). For older asset versions, any non-TPS data serialization is now virtualized instead.
- A warning is now emitted by FLinkerLoad::operator<<() when returning NULL for placeholder export object refs in those cases where we are not able to enforce its type safety at runtime. This now includes reflected properties that might serialize a reference to a placeholder type's CDO, which should be an unlikely edge case that we'll now report on here.
- Re-enabled unit tests for object handle/pointer type safety (ObjectHandleTests.cpp).
- Added a "stress test" method for object pointers to assist with A/B testing and perf analysis (ObjectPtrTests.cpp).
- Modified natvis to extend the TObjectPtr format to display as 'nullptr' for pointers to placeholder export types. Intent is to minimize confusion while debugging since object pointers don't allow access to unsafe type objects directly.
- Added a CVar to control whether or not we will create placeholder exports as serialization targets when import types are missing on map load (SceneGraph.EnablePropertyBagPlaceholderObjectSupport). Also can be enabled at launch via command line (-EnablePropertyBagPlaceholderObjects) for iteration purposes. Currently the CVar/feature defaults to off (experimental/WiP).

#jira UE-197358
#rb Francis.Hurteau

[CL 31447968 by phillip kavan in ue5-main branch]
2024-02-13 16:53:52 -05:00
phillip kavan
91d599b1c4 Create placeholder types/objects for package exports when type imports are missing/unresolved on editor map loads.
Notes:
- This allows the export to deserialize its tagged property stream (TPS) data into a property bag (when enabled), while also keeping references to the object in place.
- The export can still be serialized to the same package on save with its TPS data still intact. In that case, we will serialize the property bag back into the package as a "normal" TPS data stream.
- Serialized references to placeholder objects are resolved as NULL. For FObjectPtr types, the value is resolved as NULL when dereferenced (for type safety), but is still serialized as a non-NULL reference to the original object (even if placeholder).
- Placeholders will not be created on load unless FUObjectSerializeContext::bSerializeUnknownProperty is set to TRUE in the serialization context. Otherwise, we immediately resolve the export as NULL, and its data is lost on load (previous behavior).

Change summary:
- Added FPropertyBagRepository::PropertyBagTypeRegistry (w/ thread-safe implementation). Currently using ARO to manage placeholder type object lifetime.
- Added FPropertyBagRepository::AddPropertyBagPlaceholderType()/IsPropertyBagPlaceholderType().
- Modified FLinkerLoad::CreateExport() to instance a "placeholder" package/object if the export is missing its type import on load. Otherwise falls back to returning NULL (previous behavior).
- Added UE_WITH_OBJECT_HANDLE_TYPE_SAFETY along with IsObjectHandleTypeSafe().
- Added UE::CoreUObject::Private::HasAnyFlags() to ObjectFwd.h (using int32 for the param here as the enum isn't defined at this level). Similar to internal APIs added for late resolve; avoid having to include Object.h.
- Added RF_HasPlaceholderType (reclaimed an unused bit). This allows FObjectPtr to do a faster query at resolve time for type safety when referencing a placeholder object (i.e. it will return NULL).
- Modified FObjectPtr::Get() and IsNull() variants to include an extra check for type safety. Right now this is only enabled in an editor build context.
- Modified FLinkerLoad::Preload() to narrow the serialization scope to the export's TPS data *only* (since the original base type is unknown, we need to skip any natively-serialized data that might also exist in the stream).
- Modified FLinkerLoad serialization of raw UObject* values to return NULL in the case of a placeholder object (for type safety at runtime).
- Modified FLinkerLoad serialization of FObjectPtr values to return NULL in the case of a placeholder object only if type safety features are disabled on FObjectPtr/FObjectHandle.
- Extended the LowLevel core NULL ptr tests to include additional tests for "unsafe type" objects wrapped by an FObjectPtr/TObjectPtr.

#jira UE-197358
#rb Francis.Hurteau

[CL 31258090 by phillip kavan in ue5-main branch]
2024-02-07 10:34:24 -05:00
jordan hoffmann
55a4d6a995 [Feature] IDO lifetime management
#jira UE-203767
#rb Francis.Hurteau

[CL 31188001 by jordan hoffmann in ue5-main branch]
2024-02-05 15:51:13 -05:00
devin doucette
f0b3f1f627 Updated FPropertyPathName to use FPropertyTypeName
#jira UE-197352
#rb Francis.Hurteau
#rnx

[CL 30646449 by devin doucette in ue5-main branch]
2024-01-16 16:49:05 -05:00
jordan hoffmann
38254fee20 [Refactor] Renaming scenegraph 'archetypes' to 'ObjectInstanceData'
[CL 30605552 by jordan hoffmann in ue5-main branch]
2024-01-12 17:22:37 -05:00
jordan hoffmann
034bffffa0 [Feature] Archetype Support for subobjects
[Feature] PropertyBagRepository::FindArchetype is now the primary API for obtaining archetypes
[SubFeature] added OnPathChangedCallback to UE::FPropertyPathName so that archetypes can record which properties were deserialized
#rb Francis.Hurteau
#jira UE-202457

[CL 30573263 by jordan hoffmann in ue5-main branch]
2024-01-11 13:57:26 -05:00
jordan hoffmann
6d1c000af5 [Tests] Proof of concept test for Property Bags and Archetypes
This CL introduces a ue console command that will construct a test object (UTestReportCardV<1..5>) and then upgrade it to a different version creating an archetype in the process. That archetype will then be displayed in a details panel.
Syntax:  TestVerseArchetypes <OldClassVersion> <NewClassVersion>
OldClassVersion and NewClassVersion must be integers between 1 and 5
#jira UE-199979
#rb Phillip.Kavan, Andrew.Davidson

[CL 30220171 by jordan hoffmann in ue5-main branch]
2023-12-08 16:50:42 -05:00
devin doucette
d252785fb5 Moved FPropertyBag to be internal
#jira UE-197352
#rnx

[CL 30183191 by devin doucette in ue5-main branch]
2023-12-07 12:20:45 -05:00
andrew davidson
369c43c9af Expand repository to store all object associated data
#jira UE-192688
#rb jordan.hoffmann

[CL 30011490 by andrew davidson in ue5-main branch]
2023-11-30 05:37:56 -05:00