Hi,
I am beginner and I am trying to understand how to use PostEditChangeChainProperty function. I have the following USTRUCT in my header:
USTRUCT()
struct FMyStructTest
{
GENERATED_BODY()
UPROPERTY(EditAnywhere)
bool Struct_Foo;
UPROPERTY(EditAnywhere)
bool Struct_Bar;
FMyStructTest()
{
Struct_Foo= true;
Struct_Bar = true;
}
};
UPROPERTY(EditAnywhere, Category = Test)
TArray<FMyStructTest> TestStruct;
I also have functions to build a UProceduralMeshComponent. I would like to popup specific UProceduralMeshComponent on details panel using my USTRUCT. For this I am using PostEditChangeChainProperty declared in my .h file as follow:
Void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent);
And I made the following code on my cpp:
void Atest::PostEditChangeChainProperty(
FPropertyChangedChainEvent& PropertyChangedEvent)
{
Super::PostEditChangeChainProperty(PropertyChangedEvent);
const FName Tail = PropertyChangedEvent.PropertyChain.GetTail()->GetValue()->GetFName();
UE_LOG(LogTemp, Warning, TEXT("Structure Modify: %s"), *Tail.ToString());
if (PropertyName == FName(TEXT("TestStruct"))) {
TerrainFace1(Vertices, Traingles) ;
UE_LOG(LogTemp, Warning, TEXT("Struct_Foo"));
}
if (PropertyName == FName(TEXT("TestStruct"))) {
TerrainFace2(Vertices, Traingles);
UE_LOG(LogTemp, Warning, TEXT("Struct_Bar"));
}
}
However, UProceduralMeshComponent are not updated.
Could you please provide me some guidance.
Thank you.