diff --git a/CHANGELOG.md b/CHANGELOG.md index df7485a40..d7327a4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Latest Changes * Fixed `manual_control.py` and `no_rendering_mode.py` to prevent crashes when used in "no rendering mode" + * Added movable props present in the map (e.g. chairs and tables) as actors so they can be controlled from Python * Refactored `no_rendering_mode.py` to improve performance and interface ## CARLA 0.9.3 diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp index 367b0c32d..6a50fa242 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp @@ -12,6 +12,7 @@ #include "Carla/Vehicle/VehicleSpawnPoint.h" #include "EngineUtils.h" +#include "Engine/StaticMeshActor.h" #include "GameFramework/SpectatorPawn.h" static FString UCarlaEpisode_GetTrafficSignId(ETrafficSignState State) @@ -108,4 +109,19 @@ void UCarlaEpisode::InitializeAtBeginPlay() Description.Class = Actor->GetClass(); ActorDispatcher->RegisterActor(*Actor, Description); } + + for (TActorIterator It(World); It; ++It) + { + auto Actor = *It; + check(Actor != nullptr); + auto MeshComponent = Actor->GetStaticMeshComponent(); + check(MeshComponent != nullptr); + if (MeshComponent->Mobility == EComponentMobility::Movable) + { + FActorDescription Description; + Description.Id = TEXT("static.prop"); + Description.Class = Actor->GetClass(); + ActorDispatcher->RegisterActor(*Actor, Description); + } + } }