Ignoring OpenDrive in 'PropsMap' & fixed MapPaths

This commit is contained in:
Marc Garcia Puig 2019-06-27 15:05:39 +02:00 committed by Néstor Subirón
parent 7f2ad73d02
commit b3537a5df1
2 changed files with 15 additions and 11 deletions

View File

@ -146,12 +146,17 @@ bool UCookAssetsCommandlet::SaveWorld(FAssetData &AssetData, FString &DestPath,
World->MarkPackageDirty();
World->GetOuter()->MarkPackageDirty();
// @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<AOpenDriveActor>(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);

View File

@ -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)