Commit Graph

50 Commits

Author SHA1 Message Date
jordan hoffmann
f6dd4989df [BugFix] Fixed bug that caused CDOs to not get copied properly when generating IDOs
#rb Devin.Doucette
#jira UE-218244, UE-217948

[CL 34621857 by jordan hoffmann in ue5-main branch]
2024-06-24 17:27:36 -04:00
jordan hoffmann
7f04a77c76 - Changed "PropertiesSetBySerialization" to "SerializedProperties" and made the flag get set even for properties that were skipped during serialization. This way it's a better reflection of which properties were in the old class
- removed GMarkPropertiesSetBySerialization and added bTrackSerializedProperties flag to FUObjectSerializeContext to avoid race conditinons
#jira UE-217800
#rb Devin.Doucette

[CL 34385324 by jordan hoffmann in ue5-main branch]
2024-06-14 17:29:03 -04:00
devin doucette
b7be3b322a Added storage of unknown enum names
#jira UE-211458

[CL 34290747 by devin doucette in ue5-main branch]
2024-06-11 16:48:27 -04:00
jordan hoffmann
f892e8b1b6 [BugFix] Various UI bug fixes and updates for the InstanceDataObjectFixupTool
- changed the FRedirectedPropertyNode to use UE::FPropertyTypeName for it's types so that containers are distinguishable from one another
- made the fixup tool tabs have the name of the object they're fixing
- fixed the needs fixup warning to open several fixup tools if more than one object needs fixup rather than attempting multi-edit
- exluded VerseFunctionProperty from being made into loose properies since they can't realistically get fixed up
- fixed issue that caused incorrect properties to get marked as set by serialization during object copies

[CL 34210729 by jordan hoffmann in ue5-main branch]
2024-06-07 14:59:08 -04:00
ronald koppers
95d5fe7f46 Add TEDS' alert columns to the placeholder rows and components with loose properties.
The following additional changes were made:
- The fix up panel can now take an owning object. This is useful to lookup the object used by the component as in cases likes TEDS the object is used as the reference point.
- Added the central function `CreateInstanceDataObjectFixupDialog` to open up the fixup dialog with at least one tab. There are now multiple cases in code where this happens so helps keep consistency and reduce duplicated code.
- Added a new tag to identify loose properties.
- Added new TEDS queries for monitoring loose properties or placeholder tag and alerts so an alert action is added that pops up the fix-up tool.
- Expanded `RequiresFixup` to allow for recursively finding nested objects that require fixing up.
- Added `FindNestedInstanceDataObject` to allow IDOs to be retrieved for nested objects as well. An example is an entity with components that require fixing up, or all known IDOs under an object.
- Removed the memento registration for alerts. After a fix was done the memento would restore the alert again after it was cleared. A finer control over when alerts are recorded as mementos is needed.

#jira UE-215480
#rb jordan.hoffmann, Phillip.Kavan
[RN] Objects that fail to load now display an icon in the Outliner. Clicking the icon will bring up a tool that allows fixing issues.

[CL 34166340 by ronald koppers in ue5-main branch]
2024-06-06 14:06:27 -04:00
devin doucette
58c803af96 A few IDO-related changes
- Renamed CreateUnknownPropertyTree to FindOrCreateUnknownPropertyTree.
- Fixed an edge case where the property can be set wrong on the property tag.
- Fixed an edge case where the wrong property can be recorded as initialized.
- Added a test for unknown property tracking.

#rb Francis.Hurteau

[CL 33983975 by devin doucette in ue5-main branch]
2024-05-29 15:41:20 -04:00
devin doucette
8919a42a0c Made IDO functionality conditional on WITH_EDITORONLY_DATA
#rb Francis.Hurteau
#rnx

[CL 33930672 by devin doucette in ue5-main branch]
2024-05-27 16:26:24 -04:00
jordan hoffmann
d557375c7c [CrashFix] removed erronous code that was causing all transient objects to have IDOs, and also disabled IDOs for class default objects
#jira UE-213664
#jira UE-213682
[CrashFix] fixed a bug in CPFUO and in StaticDuplicate that was causing several objects to not get IDOs on reinstantiation
[Feature] added helper structs for enabling/disabling IDO flags on load and save
#jira UE-213135
#jira UE-213126
#jira UE-213908
#jira UE-213904
#rb Francis.Hurteau, Phillip.Kavan

[CL 33878733 by jordan hoffmann in ue5-main branch]
2024-05-23 18:36:23 -04:00
devin doucette
0aab94294a Added optional tracking and persistence of which properties have been initialized
#jira UE-212423
#rb Francis.Hurteau
#rnx

[CL 33798808 by devin doucette in ue5-main branch]
2024-05-21 12:17:02 -04:00
jordan hoffmann
d41fa50509 [Feature] Added bNeedsFixup flag to objects in the repository
#jira UE-210753

[CL 33733014 by jordan hoffmann in ue5-main branch]
2024-05-17 15:07:10 -04:00
devin doucette
5047df6573 Added loading of missing structs into IDOs
#jira UE-214628
#rb Francis.Hurteau
#rnx

[CL 33581357 by devin doucette in ue5-main branch]
2024-05-10 14:05:52 -04:00
phillip kavan
b888aac77b Revise TObjectPtr to use pointer semantics for type safety checks (editor only).
Notes:
- This replaces the previous solution that relied on indirection.
- This solution relies on packed ref handles which requires late resolve features to also be enabled.

Change summary:
- Modified FPropertyBagRepository::IsPropertyBagPlaceholderType()/IsPropertyBagPlaceholderObject() to make the parameter read-only.
- Re-enabled UE_WITH_OBJECT_HANDLE_TYPE_SAFETY for the editor context. This will unblock testing of IDO w/ placeholder type features.
- Modified UE::CoreUObject::Private::Pack() to include a new "type" trait bit in the packed object handle reference. If set, it will signal that the reference is also a placeholder-typed object.
- Modified UE::CoreUObject::Private::MakePackedObjectRef() to include a check for whether or not the given object reference is also a placeholder-typed object, and allow this case to pass.
- Added UE::CoreUObject::Private::IsObjectHandleTypeSafeNoReadNoCheck(). This allows the implementation of IsObjectHandleTypeSafe() to rely on packed reference semantics, which are implemented as internal inline definitions.
- Modified FLinkerLoad serialization of FObjectPtr values to register a packed object reference mapping for placeholder-typed objects. Note: This requires late resolve features to also be enabled.
- Modified the TObjectPtr equality test to handle the case when only the RHS side is NULL. This can occur if the RHS is a non-UObject-type bound ptr to a placeholder object while the LHS is not.
- Revised all object handle/ptr unit tests for type safety. Ensured that TObjectPtr stress tests are still in line both with/without type safety enabled.
- Added a GObjectIndexToPackedObjectRefDebug global ptr to assist with debugger visualization of resolved placeholder-typed object references to allow for removal of RF_HasPlaceholderType.
- Updated VS natvis file to revise queries for IsPlaceholderObject() on non-UObject-typed TObjectPtr values (removed ObjectFlags check and replaced w/ GObjectIndexToPackedObjectRefDebug).
- Deprecated/removed all usage of RF_HasPlaceholderType (no longer required).
- Removed FPropertyBagRepository::PropertyBagPlaceholderTypeRegistry and decoupled the current (static) API from the repo singleton instance.
- (Minor) Fixed up some handle tracking unit tests in ObjectPropertyTest.cpp that did not compile with UE_WITH_OBJECT_HANDLE_LATE_RESOLVE disabled.

#jira UE-212508, UE-197358
#rb Zousar.Shaker

[CL 33397676 by phillip kavan in ue5-main branch]
2024-05-02 11:25:44 -04:00
devin doucette
a84b38339d Decoupled ValuesSetBySerialization from the index in the serialized property path
#jira UE-212422
#rb Francis.Hurteau, Jordan.Hoffmann
#rnx

[CL 33337212 by devin doucette in ue5-main branch]
2024-04-30 10:23:20 -04:00
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