1 - Create a C++ Blueprint function library (see wiki for details), and create the following function:
void UMyPluginBPLibrary::SetDistanceFieldResolutionScale(UStaticMeshComponent * SMComponent, float NewDFResolutionScale)
{
#if WITH_EDITOR
if (SMComponent == nullptr)
{
return;
}
UStaticMesh* Mesh = SMComponent->GetStaticMesh();
if (Mesh && Mesh->SourceModels.Num() > 0)
{
Mesh->Modify();
for (int32 i=0; i < Mesh->SourceModels.Num(); i++)
{
FStaticMeshSourceModel& Model = Mesh->SourceModels[i];
Model.BuildSettings.DistanceFieldResolutionScale = NewDFResolutionScale;
}
Mesh->Build();
}
#endif
}
2 - Create a Blutility that calls this function for the selected (or all) static mesh components:
Compile, save and close the Blutility editor, then double-click the Blutility to run it.