Force opening of a .umap asset in editor via C++? [4.9.1]

Currently trying to spawn in hundreds of levels in the editor from C++, but as per this bug report, spawning several hundred in one session leads to an ‘out of video memory’ crash. I have found that reloading the current map/level/world will ‘reset’ this limit and allow me to spawn more.

Because this is part of a lengthy automated process (by which we import lots of architectural data into the world and split parts of it out into levels), I need to be able to automate the reload of this master level. The only way I’ve seen is via UEditorEngine::Map_Load (EditorServer.cpp:2155), but this is both private and unwieldy.

Any ideas?

I think this should do the trick.

FEditorFileUtils::LoadMap(TEXT("/Game/Maps/mapname.mapname"), false, true);

Awesome, that totally does the trick! Now I need to save the map before each load (otherwise I lose the levels created in this process since the last save).

Of course, FEditorFileUtils::SaveMap is not exported -_-

Ahh, got it working. This is what I use every 100 levels to stop the ‘Out of video memory bug’ + keep the created levels saved/existing.

Thanks for the help, Goomii!