From 9056b6e68452cb68c5ae7656b3d045a55642e16e Mon Sep 17 00:00:00 2001
From: jehret <ehret@vr.rwth-aachen.de>
Date: Mon, 29 Jan 2024 21:16:41 +0100
Subject: [PATCH] improve usage of FacialExpression and facial animation in
 combination

---
 Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp | 8 ++++++++
 Source/CharacterPlugin/Public/VirtualHuman.h              | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp b/Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
index 8fd3cb2a..d10577c5 100644
--- a/Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
+++ b/Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
@@ -188,6 +188,14 @@ void UVHFaceAnimation::TickComponent(float DeltaTime, ELevelTick TickType,
 
 
 	}
+	else {
+		if (bResetFaceAfterFinish) {
+			//in case this is used together with a FacialExpression
+			//we have to do this, so that the right data is pulled from the 
+			// FacialExpression component every frame (especially before staring that actual animation)
+			ResetFace();
+		}
+	}
 }
 
 bool UVHFaceAnimation::InternalLoadFile(FString FileName)
diff --git a/Source/CharacterPlugin/Public/VirtualHuman.h b/Source/CharacterPlugin/Public/VirtualHuman.h
index df5779f7..9032844c 100644
--- a/Source/CharacterPlugin/Public/VirtualHuman.h
+++ b/Source/CharacterPlugin/Public/VirtualHuman.h
@@ -114,7 +114,7 @@ protected:
 
 	//custom idle animations can be specified t o be used (played in the DefualtSlot)
 	//CAUTION: this currently does not work together with walking or pointing
-	UPROPERTY(EditAnywhere)
+	UPROPERTY(EditAnywhere, BlueprintReadWrite)
 	TArray<UAnimSequence*> CustomIdleAnimations;
 
 private:
-- 
GitLab