I generated a minimap texture with the WorldPartitionMiniMapBuilder commandlet. I planned to use this texture as background for my in-game minimap.
My problem is that I can’t access this texture, though I can open it and set texture properties, but I can’t find it as an asset or can’t save it to another folder. Probably because it saved as an external actor to __ExternalActors.
I tried to add a C++ getter for MiniMapTexture in WorldPartitionMiniMap Actor, but I can’t get this actor ingame at all - seems it is an only-editor actor?
Any ideas on how to get it as asset/texture pointer?
Don’t you need a system thats a little more runtime friendly than a screencap?
Id suggest setting up your own screencapture2d in orthogonal view and taking the screencap at runtime before the map is opened or when the game first loads.
You can definitely rigjt click and save the RT too if you wish to use a preset or similar, it just gives you a lot more options (including resolution and choosing what renders into the map).
I use scenecapture2d for local city maps.
But the full map is 64km2 with many cells and I’m getting out of memory with all cells loaded to capture the full map.
The WorldPartitionMiniMapBuilder does exactly this but loads, captures, and unloads every cell and bakes all screen captures to one image.
Btw I found a solution, though not in-game but in editor:
- I added a C++ function to get MiniMapTexture from WorldPartitionMiniMap Actor. Unfortunately, it is not exposed to BP that why the function.
- I created an editor utility widget and called the function for the actor which seems only available in editor mode. After calling the getter, I could export the texture into HDR format.
- When HDR is done, better to resize/save as PNG and import to UE back.
(a little bit complicated, but generally it is enough to do once for testing and finally when the map is finished)
1 Like
You can transform the runtime idea into a bluetility script that captures landscapes or individual components.
This was an example of iterating over the components which did not go so well for instance. I believe in that case the fix was to sort the components array prior to iteration.