9 #include "Misc/FileHelper.h" 17 FString CorrectedMapName = MapName;
18 constexpr
auto PIEPrefix = TEXT(
"UEDPIE_0_");
19 CorrectedMapName.RemoveFromStart(PIEPrefix);
20 UE_LOG(LogCarla, Log, TEXT(
"FNavigationMesh: Corrected map name from %s to %s"), *MapName, *CorrectedMapName);
21 MapName = CorrectedMapName;
25 const auto FileName = MapName +
".bin";
27 TArray<FString> Files;
28 IFileManager::Get().FindFilesRecursive(Files, *FPaths::ProjectContentDir(), *FileName,
true,
false,
false);
30 TArray<uint8> Content;
34 UE_LOG(LogTemp, Error, TEXT(
"Failed to find OpenDrive file for map '%s'"), *MapName);
36 else if (FFileHelper::LoadFileToArray(Content, *Files[0], 0))
38 UE_LOG(LogCarla, Log, TEXT(
"Loading Navigation Mesh file '%s'"), *Files[0]);
42 UE_LOG(LogTemp, Error, TEXT(
"Failed to load Navigation Mesh file '%s'"), *Files[0]);
static TArray< uint8 > Load(FString MapName)
Return the Navigation Mesh Binary associated to MapName, or empty if the such file wasn't serialized...
static T Get(carla::rpc::Response< T > &response)