Commit Graph

188 Commits

Author SHA1 Message Date
jaime cifuentes
75a6bee328 PropertyBag : Fis for CIS error UUSerStruct missing dependencies on load
#rb [at]mikko.mononen [at]helge.mathee

[CL 27872926 by jaime cifuentes in ue5-main branch]
2023-09-14 05:26:12 -04:00
steve robb
da9f5a828a Replaced TChooseClass with std::conditional_t.
#rb none
#jira UE-195271

[CL 27816205 by steve robb in ue5-main branch]
2023-09-12 19:55:55 -04:00
mikko mononen
76460d5be7 StateTree: Fix undoing property add immediately after adding it
- Added Identical() to FInstancedPropertyBag
- Fixed FInstancedPropertyBag to reset when loading empty data

#jira UE-185342

[CL 27628535 by mikko mononen in ue5-main branch]
2023-09-06 05:01:34 -04:00
charles lefebvre
a2500ef81d Do not use Cast as a const_cast
#rnx
#rb Steve.Robb

[CL 27595453 by charles lefebvre in ue5-main branch]
2023-09-05 10:11:04 -04:00
adrien logut
ca3e82ada8 [StructUtils][PCG] Improve filtering for pin types supported in Property Bags
* IsPinTypeAccepted UFunction is now receiving a bool that will tell if the pin type is a child or not
* It will allow to filter out specific structures
* On PCG side, add the support for Vec2/Vec4/Quat/SoftObjectPath/SoftClassPath as graph parameters

#rnx
#rb ryan.buehler, wyatt.marvil
[FYI] julien.lheureux

[CL 27526219 by adrien logut in ue5-main branch]
2023-08-31 12:21:54 -04:00
logan buchy
551ef12e01 Add ability to create specific instances of a ScriptStruct from a PropertyBag
* This change adds a funciton to PropertyBag to allow a caller to manually specify the name of the struct that gets generated.
* TEDS queries depend on matching specific types to have an effect.  The Memento system can generate memento structs that need to have a one-to-one mapping to the mementoizable column to perform the translation between the two types.  This requires that the generated type for column structs with two identical layouts be unique in order to create the correct processor.

#rb Mikko.Mononen
#jira UE-192033

[CL 27488088 by logan buchy in ue5-main branch]
2023-08-30 12:35:55 -04:00
vlad golovan
64817cadd6 Set scroll position to the selected struct when opening struct picker. So that you see options near selected struct rather then always starting at the top and scrolling to the area you want to scroll to.
#rb mikko.mononen

[CL 27451100 by vlad golovan in ue5-main branch]
2023-08-29 12:11:35 -04:00
david punsetmartinez
a341b47b05 Add missing includes for NoPCH
[CL 27409676 by david punsetmartinez in ue5-main branch]
2023-08-28 09:32:23 -04:00
mikko mononen
9a07a2a579 [StructUtils] Made instanced struct filter public so that it can be reused, removed unused code.
[CL 27370446 by mikko mononen in ue5-main branch]
2023-08-25 03:35:08 -04:00
jaime cifuentes
becb70719c PropertyBag : Fixed FPropertyBagContainerTypes ranged for loop helpers (after changing an array to a TStaticArray)
#rb mikko.mononen

[CL 27303180 by jaime cifuentes in ue5-main branch]
2023-08-23 08:56:21 -04:00
mikko mononen
91a97670e9 [Backout] - CL27098170
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
Prevent accessing of invalid property nodes after undo and redo.

There's a window after undo (between undo and next property view tick) where property nodes point to the previous data.
If e.g. a property customization needs to refresh cached data after undo, they will try to access the data via old pointers.
Similar issue happens when removing item from array, the tick of IDetailCustomNodeBuilder gets called before we have updates the property nodes.

All these issues happen because when we update the child nodes, there are some parts of code that still hold hard refereces to them, and they are not
actually cleared on FPropertyNode::DestroyTree(). That in turn will cause IPropertyHandle to be in valid state, but pointing to data that has been freed.

- Detach property nodes recursively on FPropertyNode::DestroyTree(), also clearing parent pointers to that the invlidate property path cannot be followed.
- Call update view (same as tick) after undo to invalidate property nodes which do not point to correct memory anymore
- Use FEditorDelegates::PostUndoRedo instead of undo client, as in some rare cases with consequtive undo/redo the undo client callbacks get called on a stale pointer
- Postpone gameplay tag caching to next tick, since the delegates are called in reverse and SDetailsView gets OnUndoRedo gets called after out customization

#jira UE-190882

[CL 27169489 by mikko mononen in ue5-main branch]
2023-08-17 07:44:28 -04:00
mikko mononen
5bb059d5a7 Prevent accessing of invalid property nodes after undo and redo.
There's a window after undo (between undo and next property view tick) where property nodes point to the previous data.
If e.g. a property customization needs to refresh cached data after undo, they will try to access the data via old pointers.
Similar issue happens when removing item from array, the tick of IDetailCustomNodeBuilder gets called before we have updates the property nodes.

All these issues happen because when we update the child nodes, there are some parts of code that still hold hard refereces to them, and they are not
actually cleared on FPropertyNode::DestroyTree(). That in turn will cause IPropertyHandle to be in valid state, but pointing to data that has been freed.

- Detach property nodes recursively on FPropertyNode::DestroyTree(), also clearing parent pointers to that the invlidate property path cannot be followed.
- Call update view (same as tick) after undo to invalidate property nodes which do not point to correct memory anymore
- Use FEditorDelegates::PostUndoRedo instead of undo client, as in some rare cases with consequtive undo/redo the undo client callbacks get called on a stale pointer
- Postpone gameplay tag caching to next tick, since the delegates are called in reverse and SDetailsView gets OnUndoRedo gets called after out customization

#jira UE-190882

[CL 27098189 by mikko mononen in ue5-main branch]
2023-08-15 04:12:54 -04:00
david punsetmartinez
793cace42b Fix nopch compilation
[CL 26685934 by david punsetmartinez in ue5-main branch]
2023-07-28 16:12:44 -04:00
yoan stamant
53a83b0864 [FInstancedStruct] replaced versioning implementation to use archive custom versioning.
Also make serialization symmetrical so struct serialized in cooked builds can be deserialized in Editor builds.
#rb mikko.mononen
#rb francis.hurteau

[CL 26583352 by yoan stamant in ue5-main branch]
2023-07-25 14:36:56 -04:00
yoan stamant
0ef1147525 Fixed minor typo in FConstStructView description
#rb trivial

[CL 26296196 by yoan stamant in ue5-main branch]
2023-06-28 15:43:43 -04:00
mikko mononen
740cd9beb0 PropertyBag: Potential fix for crash on max/linux
#jira UE-187811

[CL 26118441 by mikko mononen in ue5-main branch]
2023-06-20 07:43:25 -04:00
adrien logut
22a59db823 [StructUtils] Add SoftPath getter/setter support in PropertyBag to interact with properties that are SoftObjectPtr or SoftObjectClass.
* Otherwise we need to redo logic on the client side to set soft object pointers, when objects are not yet loaded.

#rb mikko.mononen

[CL 26011431 by adrien logut in ue5-main branch]
2023-06-15 08:46:01 -04:00
mikko mononen
aa0f6deeab StructUtils: Change FPropertyBagContainerTypes to use GetArrayHash()
[CL 26006029 by mikko mononen in ue5-main branch]
2023-06-15 04:33:31 -04:00
mikko mononen
8d415bee22 StructUtils: Added some FInstancedStruct tests.
#jira UE-172048

[CL 25973976 by mikko mononen in ue5-main branch]
2023-06-14 06:17:51 -04:00
neil henning
7802bfa31a Allow AutoRTFM to work on StructUtils.
[CL 25868562 by neil henning in ue5-main branch]
2023-06-08 08:01:44 -04:00
jamie dale
54de61d9ce Improved multi-edit behavior of instanced struct instances
Editing multiple instanced struct instances will now edit the properties of the common struct of all instances (like object editing), rather than only editing instanced struct instances using the same struct type as the first instance being edited.

#jira
#rb Mikko.Mononen

[CL 25866991 by jamie dale in ue5-main branch]
2023-06-08 06:10:17 -04:00
jamie dale
7660483989 Fixed a crash when editing multiple instanced struct instances with different stuct types
#jira
[FYI] Mikko.Mononen, Katy.Mollenkopf
#rnx

[CL 25850371 by jamie dale in ue5-main branch]
2023-06-07 13:24:34 -04:00
helge mathee
887a6ca53e Property Bag Test - use less aggressive GC
#jira UE-185780
#rb jaime.cifuentes

[CL 25838725 by helge mathee in ue5-main branch]
2023-06-07 04:12:53 -04:00
adrien logut
1b2449577e [StructUtils] Fixing crash in PropertyBagDetails: Dereferencing nullptr
#rnx
#rb trivial

[CL 25815328 by adrien logut in ue5-main branch]
2023-06-06 10:09:45 -04:00
adrien logut
7fbf7277dc [StructUtils] Add callback options with metadata on FInstancedPropertyBag
* Add a TypeFilter callback to filter out some types when changing the type of a property
* Add a RemoveCheck callback to cancel the removal of a property
* Add generic way to invoke UFunctions. Will need to be moved in its seperate file later on.

#jira UE-183576
#rb mikko.mononen, julien.lheureux
#preflight 6479ff1fe75a2263919a6625

[CL 25774029 by adrien logut in ue5-main branch]
2023-06-02 17:12:34 -04:00