21 FString CorrectedMapName = MapName;
22 constexpr auto PIEPrefix = TEXT(
"UEDPIE_0_");
23 CorrectedMapName.RemoveFromStart(PIEPrefix);
24 UE_LOG(LogCarla, Log, TEXT(
"FNavigationMesh: Corrected map name from %s to %s"), *MapName, *CorrectedMapName);
25 MapName = CorrectedMapName;
29 const auto FileName = MapName +
".bin";
31 TArray<FString> Files;
35 const FString SavedFilePath = FPaths::ConvertRelativePathToFull(
36 FPaths::ProjectSavedDir() / TEXT(
"Nav") / FileName);
37 if (IFileManager::Get().FileExists(*SavedFilePath))
39 Files.Add(SavedFilePath);
45 for (
const FString &PackContentDir : ContentPacks->GetPackContentDirs())
51 const FString PackFilePath = PackContentDir / TEXT(
"Maps/Nav") / FileName;
52 if (IFileManager::Get().FileExists(*PackFilePath))
54 Files.Add(PackFilePath);
61 IFileManager::Get().FindFilesRecursive(Files, *FPaths::ProjectContentDir(), *FileName,
true,
false,
false);
64 TArray<uint8> Content;
68 UE_LOG(LogTemp, Error, TEXT(
"Failed to find OpenDrive file for map '%s'"), *MapName);
70 else if (FFileHelper::LoadFileToArray(Content, *Files[0], 0))
72 UE_LOG(LogCarla, Log, TEXT(
"Loading Navigation Mesh file '%s'"), *Files[0]);
76 UE_LOG(LogTemp, Error, TEXT(
"Failed to load Navigation Mesh file '%s'"), *Files[0]);
Mounts CARLA content packs (content-only Unreal plugins cooked as DLC against a base release,...
static UCarlaContentPackManager * Get()