Skip to content
Snippets Groups Projects
Commit b7f8a857 authored by Konstantin Kühlem's avatar Konstantin Kühlem
Browse files

fix: ResetFace() was called every tick (depending on options) even if not...

fix: ResetFace() was called every tick (depending on options) even if not needed, resulting in major performance penalty
parent 0f48d540
No related branches found
No related tags found
No related merge requests found
...@@ -190,16 +190,16 @@ void UVHFaceAnimation::TickComponent(float DeltaTime, ELevelTick TickType, ...@@ -190,16 +190,16 @@ void UVHFaceAnimation::TickComponent(float DeltaTime, ELevelTick TickType,
LastFrameNr = FrameNr; LastFrameNr = FrameNr;
ApplyFrameData(FrameNr); ApplyFrameData(FrameNr);
bIsFaceReset = false;
} }
else else if (bResetFaceAfterFinish && !bIsFaceReset)
{
if (bResetFaceAfterFinish)
{ {
//in case this is used together with a FacialExpression //in case this is used together with a FacialExpression
//we have to do this, so that the right data is pulled from the //we have to do this, so that the right data is pulled from the
// FacialExpression component every frame (especially before staring that actual animation) // FacialExpression component every frame (especially before staring that actual animation)
ResetFace(); ResetFace();
}
bIsFaceReset = false;
} }
} }
......
...@@ -124,11 +124,13 @@ protected: ...@@ -124,11 +124,13 @@ protected:
TMap<FString, FAnimationData> CachedAnimationData; TMap<FString, FAnimationData> CachedAnimationData;
bool bCurrentlyPlaying = false; bool bCurrentlyPlaying = false;
/** Essentially indicates whether the face has not been reset i.e. whether it is considered 'dirty' */
bool bIsFaceReset = true;
float CurrentPlayTime = 0.0f; float CurrentPlayTime = 0.0f;
float FadeFraction = 0.0f; float FadeFraction = 0.0f;
int LastFrameNr = 0; int LastFrameNr = 0;
UVHAnimInstance* AnimInstance; UPROPERTY() UVHAnimInstance* AnimInstance;
bool UseMorphs = true; bool UseMorphs = true;
public: public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment