From 2f2e836358f155e7a8f0f2d16e50714a7d8a5cac Mon Sep 17 00:00:00 2001
From: Jonas Schueppen <jonas.schueppen@rwth-aachen.de>
Date: Fri, 14 Jul 2023 17:16:01 +0200
Subject: [PATCH] Added LegPressingInfluence Factor to Settings to have more
 control over the leg behaivior

---
 Content/SaveSequenceAnimBP.uasset           | 4 ++--
 Content/SaveSequenceRig.uasset              | 4 ++--
 Source/MoCapPlugin/Private/MCController.cpp | 1 +
 Source/MoCapPlugin/Public/MCAnimInstance.h  | 3 +++
 Source/MoCapPlugin/Public/MCController.h    | 2 ++
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Content/SaveSequenceAnimBP.uasset b/Content/SaveSequenceAnimBP.uasset
index 713af97..ca8fc82 100644
--- a/Content/SaveSequenceAnimBP.uasset
+++ b/Content/SaveSequenceAnimBP.uasset
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:2a895522e77ef964af43e6d1bb3b5542ecbd84c02e91e6a87dadac1e170affe4
-size 296647
+oid sha256:155ce232213a06337a4825a62a0e99cea4208f39ddf45cc8b615ccacb02efd8f
+size 299604
diff --git a/Content/SaveSequenceRig.uasset b/Content/SaveSequenceRig.uasset
index acfce8e..4fb92e2 100644
--- a/Content/SaveSequenceRig.uasset
+++ b/Content/SaveSequenceRig.uasset
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:f2d05eecbb0c886ea1ff1a79295a847ba9faca9b45580d48d3334b3f5712cec6
-size 5003356
+oid sha256:8f3a73cb14e28d7008877791b1a04441851bef3bdcd95c05f349990da4c4def1
+size 5004767
diff --git a/Source/MoCapPlugin/Private/MCController.cpp b/Source/MoCapPlugin/Private/MCController.cpp
index 7af1cdb..6c42df8 100644
--- a/Source/MoCapPlugin/Private/MCController.cpp
+++ b/Source/MoCapPlugin/Private/MCController.cpp
@@ -1697,6 +1697,7 @@ void AMCController::SaveAnimation(float StartHaltingPoint, float EndHaltingPoint
 	AnimSaveState.Pawn->GetAnimInstance()->UseHandPos = UseHandPosition;
 	AnimSaveState.Pawn->GetAnimInstance()->LimitHandRot = LimitHandRotation;
 	AnimSaveState.Pawn->GetAnimInstance()->FingerAngleScale = FingerAngleScale;
+	AnimSaveState.Pawn->GetAnimInstance()->LegPressingInfluence = LegPressingInfluence;
 	AnimSaveState.Pawn->GetAnimInstance()->SnapshotAnimations.Empty();
 	if (Scale > 0.f) {
 		AnimSaveState.Pawn->GetAnimInstance()->Scale = FVector(Scale, Scale, Scale);
diff --git a/Source/MoCapPlugin/Public/MCAnimInstance.h b/Source/MoCapPlugin/Public/MCAnimInstance.h
index b0425c8..cf07080 100644
--- a/Source/MoCapPlugin/Public/MCAnimInstance.h
+++ b/Source/MoCapPlugin/Public/MCAnimInstance.h
@@ -83,6 +83,9 @@ public:
 	UPROPERTY(BlueprintReadWrite)
 	float FingerAngleScale = 1.f;
 
+	UPROPERTY(BlueprintReadWrite)
+	float LegPressingInfluence = -2.f;
+
 	virtual void NativeInitializeAnimation() override;
 
 	virtual void NativeUpdateAnimation(float DeltaSeconds) override;
diff --git a/Source/MoCapPlugin/Public/MCController.h b/Source/MoCapPlugin/Public/MCController.h
index 3c863c6..1575616 100644
--- a/Source/MoCapPlugin/Public/MCController.h
+++ b/Source/MoCapPlugin/Public/MCController.h
@@ -260,6 +260,8 @@ public:
 	UPROPERTY(EditAnywhere, meta = (DisplayName = "Finger Angle Scale", Category = "MotionCapture Anim"))
 	float FingerAngleScale = 1.f;
 
+	UPROPERTY(EditAnywhere, meta = (DisplayName = "Leg Compressing for Reducing strange Artifacts", Category = "MotionCapture Anim"))
+	float LegPressingInfluence = -2.f;
 
 	//UPROPERTY(EditAnywhere, meta = (DisplayName = "Edit Offsets Mode", Category = "MotionCapture Anim"))
 	bool EditOffsetMode = false;
-- 
GitLab