private IEnumerator BlendEmotionsCoroutine(BBFacePose start, BBFacePose target) { TargetEmotionPose = target; for (float i = 0; i < BlendingTime * 3; i += BlendingStep) { currentEmotionOnly = BBFacePose.Lerp(start, target, DefaultPose, i / (BlendingTime * 3)); CurrentPose = MixLipSyncAndEmotion(currentLipsyncOnly, currentEmotionOnly); DisplayPoseOnModel(CurrentPose); yield return new WaitForSeconds(BlendingStep); } }
private IEnumerator BlendLipSyncCoroutine(BBFacePose one, BBFacePose two) { BlendingLipSync = true; TargetLipSyncPose = two; for (float i = 0; i < BlendingTime; i += BlendingStep) { currentLipsyncOnly = BBFacePose.Lerp(one, two, DefaultPose, i / BlendingTime); CurrentPose = MixLipSyncAndEmotion(currentLipsyncOnly, currentEmotionOnly); DisplayPoseOnModel(CurrentPose); yield return new WaitForSeconds(BlendingStep); } TargetLipSyncPose = null; currentLipsyncOnly = two; CurrentPose = MixLipSyncAndEmotion(two, CurrentCompleteEmotionPose); DisplayPoseOnModel(CurrentPose); BlendingLipSync = false; }