CARLA
Loading...
Searching...
No Matches
MoveAssetsCommandlet.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
10#include "Commandlets/Commandlet.h"
11#include "Engine/ObjectLibrary.h"
12
13#include <util/ue-header-guard-begin.h>
14#if WITH_EDITORONLY_DATA
15#include "AssetRegistry/AssetRegistryModule.h"
16#include "AssetToolsModule.h"
17#endif // WITH_EDITORONLY_DATA
18#include <util/ue-header-guard-end.h>
19
20#include "MoveAssetsCommandlet.generated.h"
21
22/// Struct containing Package Params, used for storing the parsed arguments when
23/// invoking this commandlet
24USTRUCT()
25struct CARLA_API FMovePackageParams
26{
27 GENERATED_USTRUCT_BODY()
28
29 FString Name;
30
31 TArray<FString> MapNames;
32};
33
34UCLASS()
36{
37 GENERATED_BODY()
38
39public:
40
41 /// Default constructor.
43#if WITH_EDITORONLY_DATA
44
45 /// Parses the command line parameters provided through @a InParams The
46 /// arguments to parse are the package name and a list of map names
47 /// concatenated in a string.
48 FMovePackageParams ParseParams(const FString &InParams) const;
49
50 /// Moves all the assets contained in a map from @a SrcPath to @a DestPath
51 void MoveAssetsFromMapForSemanticSegmentation(const FString &PackageName, const FString &MapName);
52
53 /// Moves the meshes of all maps listed in a @PackageParams
54 void MoveAssets(const FMovePackageParams &PackageParams);
55
56public:
57
58 /// Main method and entry of the commandlet, taking as input parameters @a
59 /// Params.
60 virtual int32 Main(const FString &Params) override;
61
62#endif // WITH_EDITORONLY_DATA
63
64private:
65
66 /// The following data structures are declared as class members and with
67 /// UPROPERTY macro to avoid UE4 to garbage collect them.
68
69 /// Loaded assets from any object library
70 UPROPERTY()
71 TArray<FAssetData> AssetDatas;
72
73 /// Loaded maps from any object library
74 UPROPERTY()
75 TArray<FAssetData> MapContents;
76
77 /// Used for loading assets in object library. Loaded Data is stored in
78 /// AssetDatas.
79 UPROPERTY()
80 UObjectLibrary *AssetsObjectLibrary;
81};
TArray< FAssetData > MapContents
Loaded maps from any object library.
TArray< FAssetData > AssetDatas
The following data structures are declared as class members and with UPROPERTY macro to avoid UE4 to ...
UObjectLibrary * AssetsObjectLibrary
Used for loading assets in object library.
UMoveAssetsCommandlet()
Default constructor.
Struct containing Package Params, used for storing the parsed arguments when invoking this commandlet...
TArray< FString > MapNames