I’ve dug around and found the FEditorFileUtils::SaveAssetAs() C++ utility function, which was really easy to put in a BP function library
In your MyGame.Build.Cs:
PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd" });
In your project create a new BP Function Library C++, with:
#include "FileHelpers.h"
...
UCLASS()
class UMyUtils : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable)
static void SaveToDisk(UObject* Asset);
};
Then in the CPP it’s as simple as:
void UMyUtils ::SaveToDisk(UObject* Asset)
{
TArray<UObject*> Assets;
Assets.Add(Asset);
TArray<UObject*> OutSavedAssets;
FEditorFileUtils::SaveAssetsAs(Assets, OutSavedAssets);
}
It will produce a file save dialog and generally do what it says on the tin. How refreshing!