OnConstruction() not called when SplineComponent changes

I have created an Actor with a SplineComponent, that dynamically adds SplineMeshComponents for each SplineComponent Segment. The SplineMeshComponents are added in my Actors OnConstruction function:

virtual void OnConstruction(const FTransform & Transform) override;

When I place the Actor in the Level and change the SplineComponent the OnConstruction function is not called. It is only called, when I change the SplineComponent’s ‘Input Spline Points To Construction Script’ flag. Even if I leave that flag on true, OnConstruction is not called when I change the SplineComponent.

I am printing to the Log every time OnConstruction is called, so I know for sure, that OnConstruction is called twice when the Actor is placed in the level and when I click on the SplineComponent’s flag in the Details Panel.

UE_LOG(LogAttackPath, Verbose, TEXT("%s created %d SplinePathMeshes."), *GetName(), SplinePathMeshes.Num());

Any ideas?

I found the answer. I just had to override the following method:

MyActor.h:
public:
#if WITH_EDITOR
	virtual void PostEditMove(bool bFinished) override;
#endif // WITH_EDITOR

MyActor.cpp:
#if WITH_EDITOR
void AAttackPath::PostEditMove(bool bFinished)
{
	Super::PostEditMove(bFinished);
	if (ReregisterComponentsWhenModified())
	{
		OnConstruction(GetActorTransform());
	}
}
#endif // WITH_EDITOR