From a1a1aa3f0190c21c2e8324acf0460a6423484fec Mon Sep 17 00:00:00 2001 From: Michele Bianchi Date: Fri, 10 Jan 2020 16:20:38 +0900 Subject: [PATCH] Change Roadrunned semantic names in the move commandlet --- .../Carla/Commandlet/MoveAssetsCommandlet.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/MoveAssetsCommandlet.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/MoveAssetsCommandlet.cpp index da223c5e5..64027a936 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/MoveAssetsCommandlet.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/MoveAssetsCommandlet.cpp @@ -100,6 +100,12 @@ void MoveFiles(const TArray &Assets, const FString &DestPath) new(AssetsAndNames) FAssetRenameData(Asset, DestPath, Asset->GetName()); } + std::cerr << "These are the assets we are going to move: " << std::endl; + for (const auto& asset: AssetsAndNames) { + std::cerr << "\tFrom: " << TCHAR_TO_ANSI(*asset.OldObjectPath.GetAssetPathString()) << std::endl; + std::cerr << "\tTo: " << TCHAR_TO_ANSI(*asset.NewObjectPath.GetAssetPathString()) << std::endl; + } + if (AssetsAndNames.Num() > 0) { AssetToolsModule.Get().RenameAssetsWithDialog(AssetsAndNames); @@ -129,6 +135,8 @@ void UMoveAssetsCommandlet::MoveAssetsFromMapForSemanticSegmentation( AssetDataMap.Add(Paths, {}); } + std::cerr << "Time to move " << MapContents.Num() << " assets." << std::endl; + for (const auto &MapAsset : MapContents) { // Get AssetName @@ -138,11 +146,17 @@ void UMoveAssetsCommandlet::MoveAssetsFromMapForSemanticSegmentation( FString AssetName; MapAsset.AssetName.ToString(AssetName); + std::cerr << "Moving Object: " << TCHAR_TO_ANSI(*ObjectName) << std::endl; + std::cerr << "Moving Asset: " << TCHAR_TO_ANSI(*AssetName) << std::endl; + if (SrcPath.Len()) { const FString CurrentPackageName = MeshAsset->GetOutermost()->GetName(); + std::cerr << "Package name: " << TCHAR_TO_ANSI(*CurrentPackageName) << std::endl; + std::cerr << "Source path: " << TCHAR_TO_ANSI(*SrcPath) << std::endl; + if (!ensure(CurrentPackageName.StartsWith(SrcPath))) { continue; @@ -181,6 +195,7 @@ void UMoveAssetsCommandlet::MoveAssetsFromMapForSemanticSegmentation( for (const auto &Elem : AssetDataMap) { FString DestPath = TEXT("/Game/") + PackageName + TEXT("/Static/") + Elem.Key + "/" + MapName; + std::cerr << "Now moving all " << TCHAR_TO_ANSI(*Elem.Key) << " to " << TCHAR_TO_ANSI(*DestPath) << std::endl; MoveFiles(Elem.Value, DestPath); } }