Skip to content

LD::Editor::PropertyUtils

Module: SMSystemEditor

Namespaces

Name
LD::Editor::PropertyUtils::CategoryExpansion
LD::Editor::PropertyUtils::IO

Classes

Name
struct LD::Editor::PropertyUtils::FPropertyOverrideArgs
struct LD::Editor::PropertyUtils::FPropertyRetrieval
struct LD::Editor::PropertyUtils::FPropertyRetrievalArgs

Functions

Name
SMSYSTEMEDITOR_API bool IsSplitStructResultNode(const USMGraphK2Node_PropertyNode_Base * InResultNode)
SMSYSTEMEDITOR_API bool PerformSubPinReset(UEdGraphPin * InPin)
SMSYSTEMEDITOR_API bool CanPerformSubPinReset(const UEdGraphPin * InPin)
void RegenerateAllPinIds(UEdGraph * InGraph)
void RegenerateNestedResultNodeGuids(USMPropertyGraph * InGraph)
void RestoreNestedSplitsRecursive(const UEdGraphSchema_K2 * Schema, UEdGraphPin * Root, const TSet< FName > & NestedNames)
SMSYSTEMEDITOR_API TSharedPtr< ISinglePropertyView > CreatePropertyViewForProperty(UObject * InObjectOwner, const FName & InPropertyName)
SMSYSTEMEDITOR_API void SetPropertyValue(FProperty * InProperty, const FString & InValue, UObject * InObject, int32 InArrayIndex =0)
SMSYSTEMEDITOR_API void SetSinglePropertyValue(const FProperty * InProperty, const FString & InValue, void * InValueAddress, UObject * InOwnerForErrorContext =nullptr)
SMSYSTEMEDITOR_API FString GetPropertyValue(FProperty * InProperty, UObject * InObject, int32 InArrayIndex =0)
SMSYSTEMEDITOR_API FProperty * GetExtendedGraphPropertyResult(FProperty * InProperty, uint8 * InContainer)
SMSYSTEMEDITOR_API bool IsObjectPropertyInstanced(const FObjectProperty * ObjectProperty)
SMSYSTEMEDITOR_API void GetAllObjectProperties(const void * InObject, const UStruct * InPropertySource, TArray< FPropertyRetrieval > & OutProperties, const FPropertyRetrievalArgs & InArgs =FPropertyRetrievalArgs())
SMSYSTEMEDITOR_API void ForEachInstancedSubObject(const UObject * InObject, const TFunction< void(UObject *)> & Function)
SMSYSTEMEDITOR_API const FGuid & SetGraphPropertyFromProperty(FSMGraphProperty_Base & GraphProperty, FProperty * Property, const USMNodeInstance * NodeInstance, int32 Index =0, bool bSetGuid =true, bool bUseTemplateInGuid =true, bool bUseTempNativeGuid =false)
SMSYSTEMEDITOR_API void SetGraphPropertyFlagsFromNativeProperty(FSMGraphProperty_Base & InOutGraphProperty, const FProperty * InProperty)
SMSYSTEMEDITOR_API bool IsPropertyExposedToGraphNode(const FProperty * Property)
SMSYSTEMEDITOR_API bool IsPropertyDisplayedOnGraphNode(const FProperty * Property)
SMSYSTEMEDITOR_API bool EvaluateEditCondition(const FString & InExpression, const USMNodeInstance * InTemplate)
bool ClassHasEditConditionVariables(const UClass * InNodeClass)
SMSYSTEMEDITOR_API bool IsPropertyHandleExposedContainer(const TSharedPtr< IPropertyHandle > & InHandle)
SMSYSTEMEDITOR_API FStructProperty * GetGraphPropertyFromProperty(FProperty * Property)
SMSYSTEMEDITOR_API bool IsPropertyGraphProperty(const FProperty * Property)
SMSYSTEMEDITOR_API void SetPropertyOverride(USMNodeInstance * InNodeCDO, const FPropertyOverrideArgs & InArgs)
bool ShouldGraphPropertyDisplayThumbnail(const USMGraphK2Node_PropertyNode_Base * InGraphPropertyNode)
FText GetPropertyDisplayName(const FText & InPropertyText, const int32 InArrayIndex =INDEX_NONE)
FText GetSubPinDisplayName(const UEdGraphPin * InSubPin)
FText GetPropertyDisplayName(const FProperty * InProperty)
SMSYSTEMEDITOR_API const FProperty * FindSubPinMemberProperty(const UEdGraphPin * InSubPin)
FString GetTrailingMemberGuidHex(FName InName)
SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByName(UEdGraphPin * InRootPin, FName InName)
SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByAuthoredName(UEdGraphPin * InRootPin, FName InAuthoredName)
SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByPinId(UEdGraphPin * InRootPin, const FGuid & InPinId)
UEdGraphPin * FindSubPinByGuidSuffix(UEdGraphPin * InRootPin, const FString & InGuidHex)
bool HasShowOnlyInnerPropertiesMeta(const FProperty * InProperty)
void ForceSplitInlineMetaSubPins(const UEdGraphSchema_K2 * InK2Schema, UEdGraphPin * InRootPin)
void NormalizeSplitLeafDefaults(const UEdGraphSchema_K2 * InK2Schema, UEdGraphPin * InRootPin)
void MapNodeTemplatesToProperties(USMGraphNode_StateNodeBase * InStateNode, TMap< USMNodeInstance , TArray< USMGraphK2Node_PropertyNode_Base * > > & OutTemplatePropertyMap, TMap< USMNodeInstance , TArray< FProperty * > > * OutOrderedExposedFields =nullptr)

Functions Documentation

function IsSplitStructResultNode

SMSYSTEMEDITOR_API bool IsSplitStructResultNode(
    const USMGraphK2Node_PropertyNode_Base * InResultNode
)

True when both the property's bSplit flag and the result pin's live SubPins agree that the struct is split. Single gate for split-only behavior.


function PerformSubPinReset

SMSYSTEMEDITOR_API bool PerformSubPinReset(
    UEdGraphPin * InPin
)

Reset a property-graph pin to the parent template's CDO value at the sub-pin's path. Reset reflects the BP class default rather than the engine's per-pin AutogeneratedDefaultValue (which doesn't propagate through deep nested splits or array-element child graphs). Falls back to the engine reset when the pin doesn't belong to a property-graph result node. Callers wrap the call in their own FScopedTransaction.

Parameters:

InPin
The pin to reset. No-op when null.

Return: True when the CDO walk wrote the value. False when the engine autogen fallback fired (or when InPin was null / had no schema).


function CanPerformSubPinReset

SMSYSTEMEDITOR_API bool CanPerformSubPinReset(
    const UEdGraphPin * InPin
)

True when a right-click reset on InPin would change its current value. Pairs with PerformSubPinReset so the menu enable state matches the action's effect. Compares against the parent template's CDO value for property-graph result nodes; falls back to the schema's autogen comparison otherwise.

Parameters:

InPin
The pin to query. Returns false when null, read-only, or wired.

Return: True when reset would write a new value.


function RegenerateAllPinIds

void RegenerateAllPinIds(
    UEdGraph * InGraph
)

Assign a fresh PinId to every pin and sub-pin under InGraph. Used after clone/duplicate so PinIds don't collide with the source (slate tree-view SubPinWidgets map keys on PinId).


function RegenerateNestedResultNodeGuids

void RegenerateNestedResultNodeGuids(
    USMPropertyGraph * InGraph
)

Walk InGraph's SubPropertyGraphs recursively and stamp a fresh Guid on every nested child-graph result node's inline FSMGraphProperty. Used after a duplicate that carried the SubPropertyGraphs tree via StaticDuplicateObjectEx, where every nested result node inherited the source's guid and would collide in any guid-keyed lookup (e.g. compile synthesis ChildResultMap). Does not touch InGraph's own ResultNode; the caller handles depth 0.


function RestoreNestedSplitsRecursive

void RestoreNestedSplitsRecursive(
    const UEdGraphSchema_K2 * Schema,
    UEdGraphPin * Root,
    const TSet< FName > & NestedNames
)

Recursively split sub-pins of Root whose PinName appears in NestedNames and whose type is splittable. Restores saved nested-split shape onto a freshly built pin tree; caller handles the top-level split.


function CreatePropertyViewForProperty

SMSYSTEMEDITOR_API TSharedPtr< ISinglePropertyView > CreatePropertyViewForProperty(
    UObject * InObjectOwner,
    const FName & InPropertyName
)

Create a temporary property handle for a given property. Call GetPropertyHandle() from here. The property handle will be valid as long as the property view is valid.

Parameters:

InObjectOwner
UObject owning the property.
InPropertyName
The field name of the property.

Return: A property handle created for this property.


function SetPropertyValue

SMSYSTEMEDITOR_API void SetPropertyValue(
    FProperty * InProperty,
    const FString & InValue,
    UObject * InObject,
    int32 InArrayIndex =0
)

Correctly set a property value by importing a text value. Handles individual properties, arrays, and extended graph properties. This does not use property handles and instance propagation will not occur.

Parameters:

InProperty
The property to import data.
InValue
The text value to import.
InObject
The object instance containing this property.
InArrayIndex
An index for the property.

function SetSinglePropertyValue

SMSYSTEMEDITOR_API void SetSinglePropertyValue(
    const FProperty * InProperty,
    const FString & InValue,
    void * InValueAddress,
    UObject * InOwnerForErrorContext =nullptr
)

Raw text-import writer. Tries PropertyValueFromString_Direct, falls back to ImportText_Direct with PPF_SerializedAsImportText. Does NOT navigate arrays or the extended-graph-property Result sub-field, and does NOT fire Modify / PreEditChange / PostEditChangeProperty. Use when you already have the concrete property and the address of its immediate container.

Parameters:

InProperty
The property whose value will be written.
InValue
The text value to import.
InValueAddress
Address of the property's storage (InProperty->ContainerPtrToValuePtr already resolved).
InOwnerForErrorContext
Optional UObject used only for import error-context logging.

function GetPropertyValue

SMSYSTEMEDITOR_API FString GetPropertyValue(
    FProperty * InProperty,
    UObject * InObject,
    int32 InArrayIndex =0
)

Return the string value of a property. Handles individual properties, arrays, and extended graph properties.

Parameters:

InProperty
The property to import data.
InObject
The object instance containing this property.
InArrayIndex
An index for the property.

function GetExtendedGraphPropertyResult

SMSYSTEMEDITOR_API FProperty * GetExtendedGraphPropertyResult(
    FProperty * InProperty,
    uint8 * InContainer
)

Retrieve the 'Result' FProperty from a single property with no array handling. Null if not a custom graph property.

Parameters:

InProperty
The extended graph property.
InContainer
The instance container of the property.

Return: The FProperty result, or nullptr if not a custom graph property.


function IsObjectPropertyInstanced

SMSYSTEMEDITOR_API bool IsObjectPropertyInstanced(
    const FObjectProperty * ObjectProperty
)

Checks if an object property is instanced or exported.


function GetAllObjectProperties

SMSYSTEMEDITOR_API void GetAllObjectProperties(
    const void * InObject,
    const UStruct * InPropertySource,
    TArray< FPropertyRetrieval > & OutProperties,
    const FPropertyRetrievalArgs & InArgs =FPropertyRetrievalArgs()
)

Recursively retrieve all nested object properties. Checks all root properties and properties of nested structs or exported objects. Does not handle maps or sets.

Parameters:

InObject
The object address to check. Generally can just provide a UObject instance.
InPropertySource
The source containing the properties. Usually your InObject->GetClass()
OutProperties
All found object properties.
InArgs
Additional configuration arguments.

function ForEachInstancedSubObject

SMSYSTEMEDITOR_API void ForEachInstancedSubObject(
    const UObject * InObject,
    const TFunction< void(UObject *)> & Function
)

Iterate over each valid instanced sub-object in an object. Sub-objects are matched to the owning object's ObjectProperty values where the owning property is marked Instanced but not transient.

This is useful for cooking builds as sub-objects may have the transient flag added during cook when they normally wouldn't be a transient object.

This won't account for properties belonging to a map or set.

Parameters:

InObject
The object owning the sub-objects. The sub-objects may be nested.
Function
A function to execute for each sub-object.

function SetGraphPropertyFromProperty

SMSYSTEMEDITOR_API const FGuid & SetGraphPropertyFromProperty(
    FSMGraphProperty_Base & GraphProperty,
    FProperty * Property,
    const USMNodeInstance * NodeInstance,
    int32 Index =0,
    bool bSetGuid =true,
    bool bUseTemplateInGuid =true,
    bool bUseTempNativeGuid =false
)

Sets all related internal properties. Returns the guid used.


function SetGraphPropertyFlagsFromNativeProperty

SMSYSTEMEDITOR_API void SetGraphPropertyFlagsFromNativeProperty(
    FSMGraphProperty_Base & InOutGraphProperty,
    const FProperty * InProperty
)

Sets the graph property flags from a native property.


function IsPropertyExposedToGraphNode

SMSYSTEMEDITOR_API bool IsPropertyExposedToGraphNode(
    const FProperty * Property
)

Checks appropriate flags on a property to see if it should be exposed to a graph node.


function IsPropertyDisplayedOnGraphNode

SMSYSTEMEDITOR_API bool IsPropertyDisplayedOnGraphNode(
    const FProperty * Property
)

True when a property surfaces on the graph node, either as an exposed blueprint variable or as a graph property (e.g. FSMTextGraphProperty, commonly declared EditDefaultsOnly and therefore not "exposed"). This is the set of properties an EditCondition can gate on the node.


function EvaluateEditCondition

SMSYSTEMEDITOR_API bool EvaluateEditCondition(
    const FString & InExpression,
    const USMNodeInstance * InTemplate
)

Evaluate a UPROPERTY EditCondition expression against a node template, matching the engine's details-panel semantics: unary '!', logical '&&'/'||', equality/relational comparisons, arithmetic, parenthesized grouping, bool/numeric/enum operands, and no-arg bool UFUNCTION conditions. Mirrors the (non-linkable, Private) engine FEditConditionParser as its behavioral reference. Any expression that cannot be parsed or resolved to a bool is treated as met so a malformed condition never hides or locks data.

Parameters:

InExpression
The EditCondition metadata string (e.g. "bUseAdvanced", "Mode == EMode::Fast").
InTemplate
The node instance whose sibling values / functions the expression resolves against.

Return: True when the condition is met (variable stays editable / visible). Permissive-true on failure.


function ClassHasEditConditionVariables

bool ClassHasEditConditionVariables(
    const UClass * InNodeClass
)

True when any graph-exposed property on the class carries an EditCondition specifier. Cheap per-class scan used to route EditCondition-bearing nodes through the full construction path even without a construction script.


function IsPropertyHandleExposedContainer

SMSYSTEMEDITOR_API bool IsPropertyHandleExposedContainer(
    const TSharedPtr< IPropertyHandle > & InHandle
)

Checks if the property handle is a supported container and exposed.


function GetGraphPropertyFromProperty

SMSYSTEMEDITOR_API FStructProperty * GetGraphPropertyFromProperty(
    FProperty * Property
)

Returns the struct property if this property is a graph property.


function IsPropertyGraphProperty

SMSYSTEMEDITOR_API bool IsPropertyGraphProperty(
    const FProperty * Property
)

Checks if the property is considered a graph property.


function SetPropertyOverride

SMSYSTEMEDITOR_API void SetPropertyOverride(
    USMNodeInstance * InNodeCDO,
    const FPropertyOverrideArgs & InArgs
)

Apply graph property overrides to the CDO. This will propagate to instances.


function ShouldGraphPropertyDisplayThumbnail

bool ShouldGraphPropertyDisplayThumbnail(
    const USMGraphK2Node_PropertyNode_Base * InGraphPropertyNode
)

If a graph property should show its thumbnail.


function GetPropertyDisplayName

FText GetPropertyDisplayName(
    const FText & InPropertyText,
    const int32 InArrayIndex =INDEX_NONE
)

Return the display text of a property with an optional array index appended.


function GetSubPinDisplayName

FText GetSubPinDisplayName(
    const UEdGraphPin * InSubPin
)

Return the member-only display text for a split-struct sub-pin. Uses the struct member FProperty's DisplayNameText so UDS and native structs both render unqualified. Falls back to PinFriendlyName then PinName with parent prefix stripped.


function GetPropertyDisplayName

FText GetPropertyDisplayName(
    const FProperty * InProperty
)

Resolve a property's user-facing display name. Formats the authored name through NameToDisplayString unless DisplayName metadata is present and differs (matching metadata is treated as auto-populated by the UDS compile and ignored).


function FindSubPinMemberProperty

SMSYSTEMEDITOR_API const FProperty * FindSubPinMemberProperty(
    const UEdGraphPin * InSubPin
)

Resolve the struct member FProperty backing a split-struct sub-pin by matching the sub-pin's member-portion FName against the parent pin's UScriptStruct. Null when no match.


function GetTrailingMemberGuidHex

FString GetTrailingMemberGuidHex(
    FName InName
)

Return the rename-stable trailing GUID suffix from a sub-pin / property FName, or empty string when absent. UDS members carry a stable 32-char hex GUID; native members don't. Pair with FindSubPinByGuidSuffix to migrate saved references across UDS renames.


function FindSubPinByName

SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByName(
    UEdGraphPin * InRootPin,
    FName InName
)

Recursively walk InRootPin->SubPins for a sub-pin with the exact PinName InName. Null when not found.


function FindSubPinByAuthoredName

SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByAuthoredName(
    UEdGraphPin * InRootPin,
    FName InAuthoredName
)

Find the immediate split sub-pin of InRootPin whose authored member name equals InAuthoredName (case-insensitive). Resolves through each sub-pin's member FProperty so UDS members are addressable by their clean editor name despite the GUID-hashed pin name. Non-recursive, unlike FindSubPinByName, because authored names are unique only among siblings. Null when not found.


function FindSubPinByPinId

SMSYSTEMEDITOR_API UEdGraphPin * FindSubPinByPinId(
    UEdGraphPin * InRootPin,
    const FGuid & InPinId
)

Recursively walk InRootPin->SubPins for a sub-pin with the exact PinId InPinId. Null when not found.


function FindSubPinByGuidSuffix

UEdGraphPin * FindSubPinByGuidSuffix(
    UEdGraphPin * InRootPin,
    const FString & InGuidHex
)

Recursively walk InRootPin->SubPins for a sub-pin whose PinName ends with InGuidHex. Pairs with GetTrailingMemberGuidHex to migrate saved references across UDS renames.


function HasShowOnlyInnerPropertiesMeta

bool HasShowOnlyInnerPropertiesMeta(
    const FProperty * InProperty
)

True when the UPROPERTY has the ShowOnlyInnerProperties meta (details-panel convention that hides the struct header and surfaces members at the parent's indent).


function ForceSplitInlineMetaSubPins

void ForceSplitInlineMetaSubPins(
    const UEdGraphSchema_K2 * InK2Schema,
    UEdGraphPin * InRootPin
)

Recursively force-split every sub-pin under InRootPin whose backing FProperty carries ShowOnlyInnerProperties. Mirrors the top-level bSplit-by-meta one or more levels deep. Idempotent.


function NormalizeSplitLeafDefaults

void NormalizeSplitLeafDefaults(
    const UEdGraphSchema_K2 * InK2Schema,
    UEdGraphPin * InRootPin
)

Move split-leaf literals that the engine parked in DefaultValue into the storage field their pin type actually reads. UEdGraphSchema_K2::SplitPin assigns each member's exported string straight to the child's DefaultValue, but text pins read DefaultTextValue and object / class / interface pins read DefaultObject, so those leaves render empty until the literal is re-routed. Recurses through nested sub-pins, skips wired leaves, and is idempotent.

Soft object and soft class pins are deliberately excluded: they store their path in DefaultValue. Container leaves are excluded too, since the schema rejects a literal on an array, set, or map pin.

Parameters:

InK2Schema
Schema used to re-route each literal. No-op when null.
InRootPin
Pin whose sub-pin tree is walked. Its own default is left alone. No-op when null.

function MapNodeTemplatesToProperties

void MapNodeTemplatesToProperties(
    USMGraphNode_StateNodeBase * InStateNode,
    TMap< USMNodeInstance *, TArray< USMGraphK2Node_PropertyNode_Base * > > & OutTemplatePropertyMap,
    TMap< USMNodeInstance *, TArray< FProperty * > > * OutOrderedExposedFields =nullptr
)

Discover and sort properties per node instance.

Parameters:

InStateNode
The state node whose templates should be introspected.
OutTemplatePropertyMap
Receives the per-template graph-property-node list in display order.
OutOrderedExposedFields
Optional. When provided, receives the per-template ordered FProperty list (native first, then blueprint variables), using the same sort rules applied when building the map. Populating this is an opt-in side-output so callers that only need the graph-property-node list (e.g., tests) don't pay for the FProperty lookups.