There appears to be a bug in the validation of PropertyOverrides in UPCGMeshSelectorByAttribute::SelectInstances, specifically:
- Line 190: “if (FPCGSoftISMComponentDescriptor::StaticStruct()->FindPropertyByName(FName(PropertyOverride.PropertyTarget)))”
- This assumes that the PropertyTarget is not nested within a struct of the descriptor.
- The actual override logic supports taking a nested property path and navigating it to do the get/set functionality
Proposed fix:
- Add a method in PCGAttributeAccessorHelpers for IsValidPropertyTarget (see code below)
- Call this new helper method on Line 190 in place of the old code as such: “if (PCGAttributeAccessorHelpers::IsValidPropertyTarget(PropertyOverride.PropertyTarget, FPCGSoftISMComponentDescriptor::StaticStruct()))”
We have confirmed this worked in our project and property resolves nested property paths for validation.
`bool PCGAttributeAccessorHelpers::IsValidPropertyTarget(const FString& InPropertyPath, const UStruct* InStruct)
{
const FPCGAttributePropertySelector OutputSelector = FPCGAttributePropertySelector::CreateSelectorFromString(InPropertyPath);
const TArray& ExtraNames = OutputSelector.GetExtraNames();
bool bIsValid = false;
if (ExtraNames.IsEmpty())
{
bIsValid = IsPropertyAccessorSupported(FName(InPropertyPath), InStruct);
}
else
{
TArray PropertyNames;
PropertyNames.Reserve(ExtraNames.Num() + 1);
PropertyNames.Add(OutputSelector.GetAttributeName());
for (const FString& Name : ExtraNames)
{
PropertyNames.Add(FName(Name));
}
bIsValid = IsPropertyAccessorChainSupported(PropertyNames, InStruct);
}
return bIsValid;
}`