Axel : Fixed make import for large maps

This commit is contained in:
Roel Algaba Brizuela 2021-07-29 21:55:30 +02:00 committed by bernat
parent 50dd5897a7
commit c451c3cb8a
1 changed files with 10 additions and 20 deletions

View File

@ -129,7 +129,16 @@ void ULoadAssetMaterialsCommandlet::ApplyRoadPainterMaterials(const FString &Loa
// As the OpenDrive file has the same name as level, build the path to the
// xodr file using the label name and the game content directory.
const FString XodrContent = UOpenDrive::LoadXODR(LoadedMapName);
FString MapName = LoadedMapName;
if (IsInTiles)
{
int32 idx = MapName.Find("_Tile_");
if(idx > -1)
{
MapName = MapName.Mid(0, idx);
}
}
const FString XodrContent = UOpenDrive::LoadXODR(MapName);
XODRMap = carla::opendrive::OpenDriveParser::Load(carla::rpc::FromLongFString(XodrContent));
// Acquire the TilesInfo.txt file for storing the tile data (offset and size)
@ -257,25 +266,6 @@ void ULoadAssetMaterialsCommandlet::ApplyRoadPainterMaterials(const FString &Loa
UEditorLoadingAndSavingUtils::SaveDirtyPackages(true, true);
#endif
}
else {
AActor* ExistingRoadPainter = UGameplayStatics::GetActorOfClass(World, ARoadPainterWrapper::StaticClass());
if (Cast<ARoadPainterWrapper>(ExistingRoadPainter) == nullptr) {
ARoadPainterWrapper *RoadPainterBp = World->SpawnActor<ARoadPainterWrapper>(RoadPainterSubclass);
if (RoadPainterBp)
{
// Needed to call events in editor-mode
FEditorScriptExecutionGuard ScriptGuard;
// Prepare roadpainter for spawning decals
RoadPainterBp->ReadConfigFile(LoadedMapName, DecalNamesMap);
RoadPainterBp->SetBlueprintVariables();
// Spawn the decals loaded in via the JSON file
RoadPainterBp->SpawnDecalsEvent();
}
}
}
}
FDecalsProperties ULoadAssetMaterialsCommandlet::ReadDecalsConfigurationFile() {