diff --git a/Content/MoCapMap.umap b/Content/MoCapMap.umap index 14a7dbb360357d4db9cfa0446809f68e5432f3d5..2c2ed7fef29cff9dc76c8118df44baf0a7479751 100644 --- a/Content/MoCapMap.umap +++ b/Content/MoCapMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e411c0cd1771015cf525991322daa708792baa510251ad631d8241e420363934 -size 88754 +oid sha256:1b3f69e37f5581395201f5625467003a46af6e8274d1a2f43677c98a7f229a73 +size 87664 diff --git a/Content/SaveSequenceAnimBP.uasset b/Content/SaveSequenceAnimBP.uasset index 125dd9c23ba9520586e5db5ca60f3dbf820c99aa..b79c17b92bd40dbd9b2a99afa1f27a0ed6e161f7 100644 --- a/Content/SaveSequenceAnimBP.uasset +++ b/Content/SaveSequenceAnimBP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07a0bd4ccf76fb7f3b385120dbcb1328dad7b6ed67a12963d0bb8a05567e4806 -size 273024 +oid sha256:f7e4703c6f9f0667a5b62647ab668a589cd82736257e8f93af118deaae472062 +size 292222 diff --git a/Source/MoCapPlugin/Private/MCPawn.cpp b/Source/MoCapPlugin/Private/MCPawn.cpp index ba69d77f07be286419d0d7323af6a4fd840b1aa5..b93f3e7fb49fec432fd4dd422246b938a6da5569 100644 --- a/Source/MoCapPlugin/Private/MCPawn.cpp +++ b/Source/MoCapPlugin/Private/MCPawn.cpp @@ -82,14 +82,7 @@ AMCPawn::AMCPawn(const FObjectInitializer& ObjectInitializer) void AMCPawn::BeginPlay() { Super::BeginPlay(); - if (ShowDeviceModels) { - SensorSetup.HandL.ControllerComponent->SetShowDeviceModel(true); - SensorSetup.HandR.ControllerComponent->SetShowDeviceModel(true); - for (FSensor& Tracker : SensorSetup.Trackers) { - Tracker.ControllerComponent->SetShowDeviceModel(true); - Tracker.DebugMesh->SetVisibility(true); - } - } + SetShowDeviceModels(ShowDeviceModels); } @@ -579,6 +572,16 @@ void AMCPawn::OffsetSensorData(EBodyPart part, FVector & Pos, FQuat & Rot, bool } +void AMCPawn::SetShowDeviceModels(bool show) { + ShowDeviceModels = show; + SensorSetup.HandL.ControllerComponent->SetShowDeviceModel(show); + SensorSetup.HandR.ControllerComponent->SetShowDeviceModel(show); + for (FSensor& Tracker : SensorSetup.Trackers) { + Tracker.ControllerComponent->SetShowDeviceModel(show); + Tracker.DebugMesh->SetVisibility(show); + } +} + void AMCPawn::AddSensorDataToJson(TSharedPtr<FJsonObject> JsonObjectFull, const FSensor& Sensor) { TSharedPtr<FJsonObject> JsonObject = MAKE_JSON; diff --git a/Source/MoCapPlugin/Public/MCPawn.h b/Source/MoCapPlugin/Public/MCPawn.h index 588b0eb2ec3ab7377f9a467a711eed7ae8f8523d..66700432b51cbc7517db2f42ef00a6fe4ad56635 100644 --- a/Source/MoCapPlugin/Public/MCPawn.h +++ b/Source/MoCapPlugin/Public/MCPawn.h @@ -28,6 +28,7 @@ public: bool UseKneeAsFoot; + UPROPERTY(EditAnywhere) bool ShowDeviceModels = true; UPROPERTY(BlueprintReadOnly) @@ -72,6 +73,8 @@ public: void OffsetSensorData(EBodyPart part, FVector& Pos, FQuat& Rot, bool inverse = false); + void SetShowDeviceModels(bool show); + private: void AddSensorDataToJson(TSharedPtr<FJsonObject> JsonObjectFull, const FSensor& Sensor);