Commit Graph

45 Commits

Author SHA1 Message Date
mikko mononen
54eb8e271f StateTree: Introduced PropertyFunctions (contributed) (take2)
- Added property functions which can be executed and chained during property binding to set values of properties

[CL 34087989 by mikko mononen in ue5-main branch]
2024-06-04 03:56:38 -04:00
justin peterson
4b5e90f42a [Backout] - CL33856504 - CIS Cook Warning
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Introduced PropertyFunctions (contributed)
- Added property functions which can be executed and chained during property binding to set values of properties

[CL 33868630 by justin peterson in ue5-main branch]
2024-05-23 14:06:53 -04:00
mikko mononen
8fb0559486 StateTree: Introduced PropertyFunctions (contributed)
- Added property functions which can be executed and chained during property binding to set values of properties

[CL 33856515 by mikko mononen in ue5-main branch]
2024-05-23 04:48:59 -04:00
mikko mononen
ef8f978f83 StateTree: Various fixes how the binding sources are displayed.
- Added editor only StatePath to FStateTreeBindableStructDesc to help error reporting
- Friendlify user defined struct property names in FStateTreePropertyPath::ToString()
- Fixed FStateTreeEditorNode::GetName() to return the BP node name instead of the wrapper name
- Categorize binding sources based on state (including one section for global) in the binding popup

#jira UE-212418, UE-209016
#rb Yoan.StAmant

[CL 33623462 by mikko mononen in ue5-main branch]
2024-05-14 02:41:50 -04:00
logan buchy
7e550e71fc [Backout] - CL33242681
[FYI] marshall.beachy
Original CL Desc
-----------------------------------------------------------------
Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33319481 by logan buchy in ue5-main branch]
2024-04-30 01:05:58 -04:00
logan buchy
fc52e2fa82 Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33242716 by logan buchy in ue5-main branch]
2024-04-25 16:00:45 -04:00
robert millar
113e467dce Backing out to avoid crash opening some assets with instanced structs.
[Backout] - CL33171468
[FYI] logan.buchy
Original CL Desc
-----------------------------------------------------------------
Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33205050 by robert millar in ue5-main branch]
2024-04-24 13:31:59 -04:00
logan buchy
6a08f9cc13 Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33171500 by logan buchy in ue5-main branch]
2024-04-23 12:26:48 -04:00
logan buchy
e92a21f90b [Backout] - CL33154533
[FYI] logan.buchy
Original CL Desc
-----------------------------------------------------------------
Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33161624 by logan buchy in ue5-main branch]
2024-04-23 00:48:23 -04:00
logan buchy
f0ce334aa6 Performance improvement for nested FInstancedStruct in details panel
* Pathological performance issues occurred when viewing/editing USTRUCT objects that nested FInstancedStruct (either directly or in containers).  The PropertyNode system's implementation when handling FInstancedStructs would recurse up the property tree to discover the address of the owning objects and then recurse again up with the starting address.  The root cause of the performance issue is that the recursion would branch on the way up in the following functions: GetInstancesNum, GetMemoryOfInstance, GetOwnerPackages, HasValidStructData (by way of IsValid). On the way up again, branches would occur in GetValueBaseAddress, via duplicate calls in FItemPropertyNode::GetValueBaseAddress to ParentNode->GetValueAddress.
* The problem has been addressed by having the StructPropertyNode handle StructProviders that perform indirection differently than other providers.  When indirection is present, walk up to the parent node of the struct which will be an ItemPropertyNode - the address of this is retrieved and passed back down to the StructProvider.  In the current codebase, the FInstancedStructProvider is the only one that does this type of indirection - it can make the assumption that the passed in address is an FInstancedStruct and thus reinterpret it to get the StructMemory and UStruct* pointers.
* Added an InternalGetReadAddressUncached which public GetReadAddress** functions will call.  This new function will not resolve the Struct in the case of a Struct property indirection unlike GetReadAddressUncached.  It is intended as an internal function only to be called by the public APIs.
* Added a safeguard canary value to FInstancedStruct to debug/catch cases where the wrong raw void* is reinterpreted as an FInstancedStruct.  FInstancedStruct::CastFromVoid helper should be used over a naked reinterpret_cast
* Note that it isn't guarantees all paths where slow recursive behaviour occurs has been addressed in this CL. Specifically, the InstancedStructDetails implementations to get the dispaly values still go through the data enumeration though it should be better now that GetInstancesNum and GetMemoryOfInstance are not recursively calling the Enumerate pathways.  See GetDisplayValueString, GetTooltipText, GetDisplayValueIcon, GenerateStructPicker - this is the primary expense in Slate that is probably causing additional performance loss.

#rb mikko.mononen
#jira UE-207555

[CL 33154559 by logan buchy in ue5-main branch]
2024-04-22 18:20:14 -04:00
mikko mononen
e329242707 StateTree: Blueprint Property Ref.
- State Tree property ref which can be used in BP tasks

[CL 31470182 by mikko mononen in ue5-main branch]
2024-02-14 09:04:52 -05:00
mikko mononen
06ed216b15 StateTree: Fixed crash when resolving bindings without value into Weak or Soft Objects.
[CL 31041153 by mikko mononen in ue5-main branch]
2024-01-31 05:31:30 -05:00
mikko mononen
e669bb6cd9 StateTree: Added property references (get pointer to a property based on binding)
- Added FStateTreePropertyRef which allows to get pointer to bindable output properties in the StateTree
- This will eventually supercede FStateTreeStructRef

[CL 30563615 by mikko mononen in ue5-main branch]
2024-01-11 04:24:45 -05:00
mikko mononen
1503c2d68c StateTree: Clear struct references on FStateTreePropertyBindings::PerformResetObjects()
#jira UE-189896
#rb Yoan.StAmant

[CL 30388928 by mikko mononen in ue5-main branch]
2023-12-19 02:16:58 -05:00
mikko mononen
400112a177 StateTree: Enabled parameters for all state types
- Allow each state to have parameters (not super useful yet)
- Made property bindings for parameters to retain binding when a param is renamed (keeps track of the property bag ID)
- Fixed access of temporary instance data with EStateTreeDataSourceType::StateParameterData
- Added comments for UStateTreeState properties
- Changed property order of UStateTreeState so that display data comes first, then state settings, and finally parameters
- Fixed FStateTreeStateParametersInstanceDataDetails to allow property editing and value binding at the same time

#rb Mieszko.Zielinski

[CL 30112368 by mikko mononen in ue5-main branch]
2023-12-05 06:59:39 -05:00
mikko mononen
a500b14b6a StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29884503 by mikko mononen in ue5-main branch]
2023-11-22 04:08:33 -05:00
grant medine
74338326da [Backout] - CL29805076
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29810071 by grant medine in ue5-main branch]
2023-11-17 11:42:17 -05:00
mikko mononen
72c488d0cf StateTree: Changed how instance data is accessed
- Remove DataView concept
- Added FStateTreeExecutionFrame, which defines an active branch of a specific state tree that is running
- Added FStateTreeDataHandle, which allows frame relative access of instance data (replaces the DataViews)
- Changed linked states to spawn new frames (will later extend to handle linked trees on other assets)
- Bumped StateTree data version number, requires recomplation of StateTrees

#rb Yoan.StAmant

[CL 29805087 by mikko mononen in ue5-main branch]
2023-11-17 07:41:08 -05:00
mikko mononen
2372c0c1e7 StateTree: Fixed binding validation and binding display update issues
- Added Modify() for the validation functions so that they behave nice with undo (e.g. a binding may be removed by validation)
- Changed FCachedBindingData::ConditionallyUpdateData() to check if the binding has changed so that the caching reacts to undos and other modifications
- Changed FStateTreePropertyPath::ResolveIndirectionsWithValue() to fall back to the property object type, on null objects (previous logic was preventing some valid cases on empty instances)

#rb Mieszko.Zielinski

[CL 29553170 by mikko mononen in ue5-main branch]
2023-11-08 02:26:27 -05:00
mikko mononen
5260606711 StateTree: Fixed invalidating binding to parameter of Object type.
#jira UE-197989

[CL 29039713 by mikko mononen in ue5-main branch]
2023-10-24 04:44:08 -04:00
mikko mononen
391e15d1d9 StateTree: Changed bindings to not derefernce soft objects during copy
[CL 27518455 by mikko mononen in ue5-main branch]
2023-08-31 08:03:46 -04:00
mikko mononen
a10f0364b9 StateTree: Remove ensure from ResolveIndirectionsWithValue()
- fails silenty, as we need to call it during runtiem load
- there's already a note on the method documentation about the behavior

[CL 26232215 by mikko mononen in ue5-main branch]
2023-06-26 09:15:23 -04:00
mikko mononen
0c9e82ff6d StateTree: Show mismatching property types on property binding
- Improved formatting of State Tree error messages
- Fixed GetDataViewByID to return true on null values but valid types (e.g. context data)
- Added check if property types match for property binding widget
- Cache current property binding data for binding widget

#jira UE-168333

[CL 26230591 by mikko mononen in ue5-main branch]
2023-06-26 06:34:49 -04:00
yoan stamant
3110bb501b On behalf of mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Improved reconciling property names when they change
- Added PropertyGuid to FStateTreePropertyPathSegment to allow reconsile changed Blueprint class and User Defined Struct property names
- Changed FStateTreePropertyPath to optionally handle property redirects and BP/UDS name changes
- Renamed UpdateInstanceStructsFromValue to UpdateSegmentsFromValue to better reflect the use
- Improved State Tree editor bindings to update when BP/UDS properties are changed

#jira UE-184193, UE-168168

[CL 26148754 by yoan stamant in ue5-main branch]
2023-06-21 10:25:47 -04:00
mikko mononen
866e20fbf7 [Backout] - CL26143160
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
StateTree: Improved reconciling property names when they change
- Added PropertyGuid to FStateTreePropertyPathSegment to allow reconsile changed Blueprint class and User Defined Struct property names
- Changed FStateTreePropertyPath to optionally handle property redirects and BP/UDS name changes
- Renamed UpdateInstanceStructsFromValue to UpdateSegmentsFromValue to better reflect the use
- Improved State Tree editor bindings to update when BP/UDS properties are changed

#jira UE-184193, UE-168168

[CL 26145857 by mikko mononen in ue5-main branch]
2023-06-21 08:49:48 -04:00