Commit Graph

249 Commits

Author SHA1 Message Date
jared cotton
6d13f63c39 UE-191200 - "Add UE support for [at]editable fields of optional types"
Add's support for `[at]editable` on optionals:

`FOptionalProperty` changes:
- Added custom `__INIT__` logic for `FOptionalProperty::ExportText` which previously could output no text as the optional value was initialized but returned an empty string as its export text (ie: empty arrays, maps, sets, etc). This caused the future text imports to be incorrect.

`FPropertyNode` changes:
- Added `OptionalValueNode` as private member similar in idea to existing `PropertyKeyNode`. It stores the generated `FPropertyNode` for a FOptionalValue's Value when it is set.
- Added helper function `GetOrCreateOptionalValueNode` which either returns the existing `OptionalValueNode` OR creates one if appropriate.
    - Note: This is where we bind a lambda to our Optional's Value FPropertyNode's `RebuildChildren` event which is how we update/rebuild when needed. In places where we would update/rebuild we instead call our Value to do so instead if set and then update after that has been done via this callback.

Added new widget `SPropertyEditorOptional`
- This either:
    - shows a dropdown of "Set all" or "Unset all" if we have multiple values selected
    - generates the editor for whatever our set value is if we have a single value (See `GetSingleReadAddress`)
    - shows a 'set value' button if we are not set

#JIRA UE-191200
#rb karen.jirak
#rb kurtis.schmidt

[CL 28253719 by jared cotton in ue5-main branch]
2023-09-26 18:57:13 -04:00
dan oconnor
dce9110139 Use string comparison rather than binary comparison to avoid floating point error when propagating default values
#rb Jamie.Dale

[CL 28089942 by dan oconnor in ue5-main branch]
2023-09-21 12:31:46 -04:00
jonathan bard
9b979c532d Fixed property clamping not taking into account the instance meta data if present on the property handle
#rb mikko.mononen, jurre.debarre
#jira UE-195737

[CL 27996816 by jonathan bard in ue5-main branch]
2023-09-19 11:21:08 -04:00
mikko mononen
85634ec1c3 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.

- Added bIsDestroyed on property nodes to be able distinguish property nodes which are still alive but destoyed
- Prevent calling Tick() on property tree nodes, whose property node is destroyed
- Changed Gameplay Tag, Tag Container and Query to poll for changes, because undo callbacks are triggered at times when the property handle (and underlying node) is pointing to old data
- The above gameplay tag & co change will also react to property changes from outside the details panel

#jira UE-188117 UE-190882

[CL 27705747 by mikko mononen in ue5-main branch]
2023-09-08 04:42:59 -04:00
ben hoffman
18eb67c78c Implement GetOptions for UPARAM and add it for ByProfile traces
#rb dave.jones2

#ushell-cherrypick of 27593453 by kristof.morva1

[CL 27597870 by ben hoffman in ue5-main branch]
2023-09-05 11:33:21 -04:00
mikko mononen
70c2abf5cc Added ScrollPropertyIntoView() to details view and fixed default property button padding
- Fixed padding of default buttons contaier (or else the widget created with CreateDefaultPropertyButtonWidgets() will unintentionally make a row taller)
- Added IDetailsView.ScrollPropertyIntoView(), similar to HighlightProperty() sans does not set highlight

[CL 27407050 by mikko mononen in ue5-main branch]
2023-08-28 04:23:29 -04:00
daren cheng
bccad8258a Fix PropertHandleRotator crash when no children not yet populated
#jira UE-181135
#rb Patrick.Boutot

[CL 27379084 by daren cheng in ue5-main branch]
2023-08-25 11:55:33 -04:00
andrew rodham
c8780d4340 Slate: Fixed FDeprecateSlateVector2D properties not being treated as vectors in the property editor
#rb Yohann.Dossantos

[CL 27308145 by andrew rodham in ue5-main branch]
2023-08-23 11:51:58 -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
julien stjean
dea50ea3c6 The object path used to set the properties via an asset data in FPropertyHandleObject::SetValue will now use the full path of the class instead of only the name.
Since the killpendingkill initiave we can have mutiple UClass objects that share the same name but have diferent paths. There is no value to only pass the name of class since it cannot be use to find class since it might yield multiple classes.

This also remove an issue when parsing the string since the full path of an class cannot start with an '_' while a class object can. This was an issue since the parser is not able to recognize a token that start with an '_'.

#jira UE-172066
#rb JeanLuc.Corenthin

[CL 26705114 by julien stjean in ue5-main branch]
2023-07-31 10:03:37 -04:00
marc audy
20303348c4 Remove (the never should have been exposed) direct access to the private PropertyNode via the PropertyHandle
[CL 25458606 by marc audy in ue5-main branch]
2023-05-12 16:01:47 -04:00
jamie dale
1219471e56 Added support for overriding enum value display names on a per-property basis
This can be specified by the EnumValueDisplayNameOverrides meta-data, and is a semi-colon separated list of Name=DisplayName pairs where the DisplayName can be a raw string or a NS/LOCTEXT style localized value.

#preflight 64525920d863ba2621179ac2
#rb Rex.Hill

[CL 25323006 by jamie dale in ue5-main branch]
2023-05-03 15:27:50 -04:00
tom noonan
3a2ffb4b70 Fix for instances of verse classes inserted into an array through the editor not getting correctly initialized. Very similar to the 'add element' fix made in CL21322034
[REVIEW] [at]michael.nicolella
#preflight 645235150722d4f6a2d6d2b2

[CL 25319276 by tom noonan in ue5-main branch]
2023-05-03 12:48:31 -04:00
mikko mononen
03afbfd05a Improved standalone structure property node handling
- Added IStructureProvider which allows to edit multiple instances of structs at a time
- Improved default value handling in standalone structure nodes
- Fixed bug where expanded nodes did not retain their expansion state when structure nodes were rebuild (e.g. when editing a component)
- Removed caching from Instanced struct customization

#jira UE-172047
#rb Jamie.Dale, Adrien.Logut
#preflight 644a48360f12404fb77173f6

[CL 25214019 by mikko mononen in ue5-main branch]
2023-04-27 10:06:33 -04:00
Steve Robb
16ca60f6ed Fixed duplicates being wrongly reported when adding elements to map or set properties in the editor, where the key type is a UClass* key and the class name is a subset of a name which already exists as a key.
#rb tim.smith
#jira UE-181605
#preflight 64243247a86ae7cbcc25ac66

[CL 24834996 by Steve Robb in ue5-main branch]
2023-03-29 09:38:15 -04:00
Steve Robb
9f15ca9d25 Moved FScriptSetHelper::HasElement() to editor.
#rb robert.manuszewski
#jira none
#preflight 64242845973e6096707dad75

[CL 24834160 by Steve Robb in ue5-main branch]
2023-03-29 08:04:19 -04:00
Steve Robb
fd11bd4dba Moved FScriptMapHelper::HasKey() to editor.
#rb robert.manuszewski
#jira none
#preflight 641db48f7a393e211a01d490

[CL 24800838 by Steve Robb in ue5-main branch]
2023-03-27 07:06:38 -04:00
joe pribele
a7673567fe change to FObjectPropertyBase ParseObjectPropertyValue and FindImportedObject to take in a TObjectPtr<UObject> instead of UObject
added `SetObjectPtrPropertyValue(void* PropertyValueAddress, TObjectPtr<UObject> Value)`

this allows objects to be imported from text without resolving the object
#preflight 640900fa8832f48a4dc62ee4

[CL 24567650 by joe pribele in ue5-main branch]
2023-03-08 16:56:59 -05:00
marcus wassmer
8f4f8a3c66 Submitting for Dan O'Conner
Add the ability to add customizations via property handle that disable object instancing logic associated with CPF_InstancedReference
[REVIEW] [at]marcus.wassmer
#rb jp.flouret,marcus.wassmer,dan.oconner
#preflight 6401477c1d304a54717d2953

#localization none
#tests all relevant operations on array and non-array editable versedevices in the details panel
#preferred_allowlister marcus.wassmer

[CL 24494803 by marcus wassmer in ue5-main branch]
2023-03-02 21:57:17 -05:00
mikko mononen
b6c4bd6a3c PropertyNode: Change OnRebuildChildren to an event.
This fixes nodes not rebuilding when there are multiple listeners.
E.g. FDetailArrayBuilder generating a row that contains instanced object property. Previously changing the object instance would "freeze" the array builder.

#rb Sebastian.Nordgren
#preflight 63e4b920902d6ba787efe0e6

[CL 24094515 by mikko mononen in ue5-main branch]
2023-02-09 05:28:05 -05:00
robert manuszewski
f88a8276f7 Temporarily disabling the use of property setters and getters in property panels
[FYI] Sebastian.Nordgren
#preflight none
#rb none

[CL 23868875 by robert manuszewski in ue5-main branch]
2023-01-26 11:08:17 -05:00
robert manuszewski
3be23de4e0 Fixing a crash when selecting multiple actors in the editor
#rb trivial
#preflight none

[CL 23848140 by robert manuszewski in ue5-main branch]
2023-01-25 10:21:44 -05:00
robert manuszewski
2b1d313ae6 Property panels will now properly use C++ setters and getters
#rb Sebastian.Nordgren
#preflight 63d0d175be435f17b4b4e545

[CL 23845269 by robert manuszewski in ue5-main branch]
2023-01-25 04:08:38 -05:00
sebastian nordgren
f440a95f20 IPropertyHandle::GetMetaData and related functions (GetBoolMetaData, etc.) now always check the instance metadata as well. This is what you would expect to happen when calling SetInstanceMetaData, but was only being applied selectively by certain widgets.
Added IPropertyHandle::GetDoubleMetaData().

Reported on UDN.

#rb lauren.barnes
#preflight 6373878332484253052694ab

[CL 23134410 by sebastian nordgren in ue5-main branch]
2022-11-15 07:58:57 -05:00