diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/CookAssetsCommandlet.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/CookAssetsCommandlet.cpp index 824e5a4f5..cb78df4a7 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/CookAssetsCommandlet.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/CookAssetsCommandlet.cpp @@ -146,12 +146,17 @@ bool UCookAssetsCommandlet::SaveWorld(FAssetData &AssetData, FString &DestPath, World->MarkPackageDirty(); World->GetOuter()->MarkPackageDirty(); - // Filling the map stuff (Code only applied for maps) - AOpenDriveActor *OpenWorldActor = - CastChecked(World->SpawnActor(AOpenDriveActor::StaticClass(), - new FVector(), NULL)); - OpenWorldActor->BuildRoutes(WorldName); - OpenWorldActor->AddSpawners(); + // @TODO: find a better solution + // Hardcoded so it will ignore the PropMaps umap that doesn't contains OpenDrive info + if (World->GetName() != "PropsMap") + { + // Filling the map stuff (Code only applied for maps) + AOpenDriveActor *OpenWorldActor = + CastChecked(World->SpawnActor(AOpenDriveActor::StaticClass(), + new FVector(), NULL)); + OpenWorldActor->BuildRoutes(WorldName); + OpenWorldActor->AddSpawners(); + } // Saving the package FString PackageFileName = FPackageName::LongPackageNameToFilename(PackageName, @@ -267,11 +272,9 @@ int32 UCookAssetsCommandlet::Main(const FString &Params) } // Save Map Path File for further use - FString SaveDirectory = FString("/Game/") + PackageParams.Name + TEXT("/Config"); + FString SaveDirectory = FPaths::ProjectContentDir() + PackageParams.Name + TEXT("/Config"); FString FileName = FString("MapPaths.txt"); - - // TODO: This throws a weird error when saving, we need to fix it - // SaveStringTextToFile(SaveDirectory, FileName, MapPathData, true); + SaveStringTextToFile(SaveDirectory, FileName, MapPathData, true); // Add props in a single Base Map AddMeshesToWorld(AssetsPaths.PropsPaths, false); diff --git a/Util/import.py b/Util/import.py index 23fdbf98b..2a5edd7d4 100755 --- a/Util/import.py +++ b/Util/import.py @@ -21,6 +21,7 @@ import subprocess # Global variables IMPORT_SETTING_FILENAME = "importsetting.json" +SCRIPT_NAME = os.path.basename(__file__) @contextmanager @@ -57,7 +58,7 @@ def invoke_commandlet(name, arguments): editor_path = "%s/Engine/Binaries/%s/UE4Editor" % (ue4_path, sys_name) uproject_path = os.path.join(os.getcwd(), "..", "Unreal", "CarlaUE4", "CarlaUE4.uproject") full_command = "%s %s -run=%s %s" % (editor_path, uproject_path, name, arguments) - print("\nRunning command:\n$ " + full_command + '\n') + print("\n[" + str(SCRIPT_NAME) + "] Running command:\n$ " + full_command + '\n') subprocess.check_call([full_command], shell=True)