the plugin is easy, you can search “Extend the editor” for full example source, i only add a toolbar button for export operation. the key code is getting the dtNavMesh instance from UE4, then you can save any data within it(but no tilecache):
class ARecastNavMeshTrick : public ARecastNavMesh
{
public:
const FPImplRecastNavMesh* GetRecastNavMeshImplTrick() const { return GetRecastNavMeshImpl(); }
};
void ExportNavMeshData()
{
UWorld* World = GEditor->GetEditorWorldContext().World();
const ANavigationData* NavData = World->GetNavigationSystem()->GetMainNavData(FNavigationSystem::DontCreate);
const ARecastNavMeshTrick* NavMeshData = Cast<const ARecastNavMeshTrick>(NavData);
const FPImplRecastNavMesh* RecastMesh = NavMeshData->GetRecastNavMeshImplTrick();
dtNavMesh* DetourNavMesh = RecastMesh->DetourNavMesh;
FString TempFilename = FPaths::GameSavedDir() + World->GetMapName() + ".navmesh";
FTCHARToUTF8 Filename(*TempFilename);
bool b = hztool::navmesh::save_navmesh(Filename.Get(), DetourNavMesh);
if (b)
{
FPlatformMisc::MessageBoxExt(EAppMsgType::Ok, TEXT("export navmesh ok!!!"), TEXT("TestCommand"));
}
}