Context:
Static Mesh Spawner is used to spawn one static mesh per point in the provided point data. PCGMeshSelectorByAttribute is used to select an entry based on an attribute present on the mesh.
Problem:
The problem is we are unable to use Attribute property overrides to target nested struct properties, such as BodyInstance.CollisionProfileName due to how it's validated in PCGMeshSelectorByAttribute.cpp. The check: if (FPCGSoftISMComponentDescriptor::StaticStruct()->FindPropertyByName(FName(PropertyOverride.PropertyTarget))) -
assumes that the PropertyTarget is not nested within a struct of the descriptor resulting in the error of "Property 'BodyInstance.CollisionProfileName' not a valid property with an ISM Descriptor. It will be ignored."
Suggested fix by Licensee as noted on case:
-Add a method in PCGAttributeAccessorHelpers for IsValidPropertyTarget (see code below)
-Call this new helper method in place of the old code as such in PCGMeshSelectorByAttribute.cpp: "if (PCGAttributeAccessorHelpers::IsValidPropertyTarget(PropertyOverride.PropertyTarget, FPCGSoftISMComponentDescriptor::StaticStruct()))"
Code:
bool PCGAttributeAccessorHelpers::IsValidPropertyTarget(const FString& InPropertyPath, const UStruct* InStruct) { const FPCGAttributePropertySelector OutputSelector = FPCGAttributePropertySelector::CreateSelectorFromString(InPropertyPath); const TArray<FString>& ExtraNames = OutputSelector.GetExtraNames(); bool bIsValid = false; if (ExtraNames.IsEmpty()) { bIsValid = IsPropertyAccessorSupported(FName(InPropertyPath), InStruct); } else { TArray<FName> 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; }
1.) Download and open repro project uploaded in ticket
2.) Ensure level "M_Test" is opened (should be opened by default when opening project), if not go to Content Drawer > Content > M_Test
3.) Open "PCG_AttributeTest"; Content Drawer > Content > PCG_AttributeTest
4.) Right-Click the "Static Mesh Spawner" node and click "Debug" to enable it
Observe: An error shows up, place mouse cursor on top of error to see: "Property 'BodyInstance.CollisionProfileName' not a valid property with an ISM Descriptor. It will be ignored."
Expected: No error
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-296837 in the post.
0 |
Component | UE - World Creation - Procedural Tools - PCG Graph |
---|---|
Affects Versions | 5.5, 5.6 |
Created | Jun 17, 2025 |
---|---|
Updated | Jun 28, 2025 |