I’m answering my own question here. I solved this by wrapping the function that sets the application scale in a blueprintable function. Then I call it from python in a file that has to be named init_unreal.py for Unreal to run it on startup. init_unreal.py must be in the /Content/python/ folder (make it if it does not exist), or some other folder that is in the Editor’s python path. Here is the code:
.cpp
#include "GPSetApplicationScale.h"
#include "Framework/Application/SlateApplication.h"
void UGPSetApplicationScale::SetScale(float Scale)
{
FSlateApplication::Get().SetApplicationScale(Scale);
}
.h
#include "GPSetApplicationScale.generated.h"
UCLASS(Blueprintable)
class GRANDPA_API UGPSetApplicationScale : public UObject
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="Smoketests")
void SetScale(float Scale);
};
init_unreal.py
unreal.GPSetApplicationScale().set_scale(1.4)