From 643043fb8fe1a48ec0186bd67a826cadf829605d Mon Sep 17 00:00:00 2001 From: Roel Algaba Brizuela Date: Wed, 28 Apr 2021 13:02:14 +0200 Subject: [PATCH] Created button for possible mobility warnings --- .../Carla/Source/Carla/MapGen/ProceduralBuilding.cpp | 8 ++++++++ .../Carla/Source/Carla/MapGen/ProceduralBuilding.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.cpp index 281249bf6..eb7dcd7fb 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.cpp @@ -46,6 +46,14 @@ UHierarchicalInstancedStaticMeshComponent* AProceduralBuilding::GetHISMComp( return HISMComp; } +void AProceduralBuilding::FixMobility() { + + for (UChildActorComponent *ChildComp : ChildActorComps) { + + ChildComp->SetMobility(EComponentMobility::Type::Static); + } +} + void AProceduralBuilding::ConvertOldBP_ToNativeCodeObject(AActor* BP_Building) { AProceduralBuilding* ProceduralBuilding = nullptr; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.h index 6d6df4979..3e147634b 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/ProceduralBuilding.h @@ -94,6 +94,9 @@ protected: UFUNCTION(BlueprintCallable, CallInEditor, Category="Procedural Building") void Reset(); + UFUNCTION(BlueprintCallable, CallInEditor, Category="Procedural Building") + void FixMobility(); + // TODO: AdvancedDisplay // Map containing the pair with the name of the mesh and the component that uses it UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Procedural Building|Debug")