Working script for 5.4, for a Scripted Asset Action Blueprint
void UMyBPLibrary::SetDistanceFieldResolutionScale(UStaticMesh* Mesh, float NewDFResolutionScale)
{
#if WITH_EDITOR
if (Mesh == nullptr)
{
return;
}
//UStaticMesh* Mesh = SMComponent->GetStaticMesh();
if (Mesh && Mesh->GetNumSourceModels() > 0)
{
Mesh->Modify();
for (int32 i = 0; i < Mesh->GetNumSourceModels(); i++)
{
FStaticMeshSourceModel& Model = Mesh->GetSourceModel(i);
Model.BuildSettings.DistanceFieldResolutionScale = NewDFResolutionScale;
}
Mesh->Build();
}
#endif
}