CARLA
Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorAttribute.h
Go to the documentation of this file.
1 // Copyright (c) 2017 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 
12 
13 #include "ActorAttribute.generated.h"
14 
15 #define CARLA_ENUM_FROM_RPC(e) static_cast<uint8>(carla::rpc::ActorAttributeType:: e)
16 
17 /// List of valid types for actor attributes.
18 UENUM(BlueprintType)
19 enum class EActorAttributeType : uint8
20 {
21  Null = 0, // Workarround for UE4.24 issue with enums
22  Bool = CARLA_ENUM_FROM_RPC(Bool) UMETA(DisplayName = "Bool"),
23  Int = CARLA_ENUM_FROM_RPC(Int) UMETA(DisplayName = "Integer"),
24  Float = CARLA_ENUM_FROM_RPC(Float) UMETA(DisplayName = "Float"),
25  String = CARLA_ENUM_FROM_RPC(String) UMETA(DisplayName = "String"),
26  RGBColor = CARLA_ENUM_FROM_RPC(RGBColor) UMETA(DisplayName = "RGB Color (comma separated)"),
27 
28  SIZE UMETA(Hidden),
29  INVALID UMETA(Hidden)
30 };
31 
32 #undef CARLA_ENUM_FROM_RPC
33 
34 /// Definition of an actor variation. Variations represent attributes of the
35 /// actor that the user can modify in order to generate variations of the same
36 /// actor.
37 ///
38 /// A list of recommended values is given. If bRestrictToRecommended is true,
39 /// only recommended values are accepted as valid.
40 USTRUCT(BlueprintType)
41 struct CARLA_API FActorVariation
42 {
43  GENERATED_BODY()
44 
45  UPROPERTY(EditAnywhere, BlueprintReadWrite)
46  FString Id;
47 
48  UPROPERTY(EditAnywhere, BlueprintReadWrite)
50 
51  UPROPERTY(EditAnywhere, BlueprintReadWrite)
52  TArray<FString> RecommendedValues;
53 
54  UPROPERTY(EditAnywhere, BlueprintReadWrite)
55  bool bRestrictToRecommended = false;
56 };
57 
58 /// An actor attribute, may be an intrinsic (non-modifiable) attribute of the
59 /// actor or an user-defined actor variation.
60 USTRUCT(BlueprintType)
61 struct CARLA_API FActorAttribute
62 {
63  GENERATED_BODY()
64 
65  UPROPERTY(EditAnywhere, BlueprintReadWrite)
66  FString Id;
67 
68  UPROPERTY(EditAnywhere, BlueprintReadWrite)
70 
71  UPROPERTY(EditAnywhere, BlueprintReadWrite)
72  FString Value;
73 };
static const FString SIZE
EActorAttributeType
List of valid types for actor attributes.
An actor attribute, may be an intrinsic (non-modifiable) attribute of the actor or an user-defined ac...