Skip to content
Snippets Groups Projects
Commit ca029e80 authored by Pin-Hua Ho's avatar Pin-Hua Ho
Browse files

merge feature/MH-audio2face

parents 1aeb574c 7246135a
No related branches found
No related tags found
No related merge requests found
Binaries/ Binaries/
Intermediate/ Intermediate/
<<<<<<< HEAD
# Temp Folder # Temp Folder
**/_TEMP **/_TEMP
=======
**/_TEMP/
>>>>>>> feature/MH-audio2face
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -180,6 +180,26 @@ bool AVirtualHuman::SupportsMorphs() ...@@ -180,6 +180,26 @@ bool AVirtualHuman::SupportsMorphs()
return BodyType != EBodyType::MetaHuman; return BodyType != EBodyType::MetaHuman;
} }
void AVirtualHuman::PlayFacialAnimationMontage(UAnimMontage* InMontage, float InPlayRate, FName StartSectionName)
{
if (BodyType != EBodyType::MetaHuman) {
UVHAnimInstance* BodyAnimInstance = GetBodyAnimInstance();
if (BodyAnimInstance)
{
float const Duration = BodyAnimInstance->Montage_Play(InMontage, InPlayRate);
if (Duration > 0.f)
{
// Start at a given Section.
if (StartSectionName != NAME_None)
{
BodyAnimInstance->Montage_JumpToSection(StartSectionName, InMontage);
}
}
}
}
}
bool AVirtualHuman::ForcePlayNewIdleAnimation() bool AVirtualHuman::ForcePlayNewIdleAnimation()
{ {
if (CustomIdleAnimations.IsEmpty()) if (CustomIdleAnimations.IsEmpty())
......
...@@ -98,6 +98,13 @@ public: ...@@ -98,6 +98,13 @@ public:
virtual EVHGender GetGender(); virtual EVHGender GetGender();
virtual bool SupportsMorphs(); virtual bool SupportsMorphs();
/**
* Play a facial animation montage on face mesh. (Only for MetaHuman)
*/
UFUNCTION(BlueprintCallable)
virtual void PlayFacialAnimationMontage(UAnimMontage* InMontage, float InPlayRate = 1.0f, FName StartSectionName = NAME_None);
/** /**
* Forces a new IDLE animation to be played, which is randomly chosen from "CustomIdleAnimations". * Forces a new IDLE animation to be played, which is randomly chosen from "CustomIdleAnimations".
* Note that the new animation might also be the one which is currently playing. * Note that the new animation might also be the one which is currently playing.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment