CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
Unreal
CarlaUnreal
Plugins
Carla
Source
Carla
Commandlet
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
9
#include "
Carla/OpenDrive/OpenDriveActor.h
"
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
24
USTRUCT()
25
struct CARLA_API
FMovePackageParams
26
{
27
GENERATED_USTRUCT_BODY()
28
29
FString
Name
;
30
31
TArray<FString>
MapNames
;
32
};
33
34
UCLASS()
35
class
UMoveAssetsCommandlet
: public
UCommandlet
36
{
37
GENERATED_BODY()
38
39
public
:
40
41
/// Default constructor.
42
UMoveAssetsCommandlet
();
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
56
public
:
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
64
private
:
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
};
OpenDriveActor.h
UCommandlet
UMoveAssetsCommandlet::MapContents
TArray< FAssetData > MapContents
Loaded maps from any object library.
Definition
MoveAssetsCommandlet.h:75
UMoveAssetsCommandlet::AssetDatas
TArray< FAssetData > AssetDatas
The following data structures are declared as class members and with UPROPERTY macro to avoid UE4 to ...
Definition
MoveAssetsCommandlet.h:71
UMoveAssetsCommandlet::AssetsObjectLibrary
UObjectLibrary * AssetsObjectLibrary
Used for loading assets in object library.
Definition
MoveAssetsCommandlet.h:80
UMoveAssetsCommandlet::UMoveAssetsCommandlet
UMoveAssetsCommandlet()
Default constructor.
Definition
MoveAssetsCommandlet.cpp:11
FMovePackageParams
Struct containing Package Params, used for storing the parsed arguments when invoking this commandlet...
Definition
MoveAssetsCommandlet.h:26
FMovePackageParams::MapNames
TArray< FString > MapNames
Definition
MoveAssetsCommandlet.h:31
FMovePackageParams::Name
FString Name
Definition
MoveAssetsCommandlet.h:29
Generated by
1.18.0