I’ll also make my contribution
I work mostly with с++, so my choise is function like this:
void AAssignMaterialsActor::AssignMaterials()
{
for (auto& sm : staticMeshes) {
sm->SetMaterial(0, Material);
}
}
Call it in editor using next data like:
UFUNCTION(BlueprintCallable, CallInEditor)
void AssignMaterials();
UPROPERTY(EditAnywhere, Category = Generation)
UMaterialInterface* Material;
UPROPERTY(EditAnywhere, Category = Generation)
TArray<UStaticMesh*> staticMeshes;
Because we are in editor materials will be applied in content browser