From 161363682d4dc480dd644508088e178c355edbf3 Mon Sep 17 00:00:00 2001 From: Emiliana <38952746+emilianavt@users.noreply.github.com> Date: Sun, 21 Jun 2020 19:02:32 +0200 Subject: [PATCH] `OpenSeeVRMDriver` now supports linked eye blinking. --- Examples/OpenSeeVRMDriver.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Examples/OpenSeeVRMDriver.cs b/Examples/OpenSeeVRMDriver.cs index 660e75c..add3081 100644 --- a/Examples/OpenSeeVRMDriver.cs +++ b/Examples/OpenSeeVRMDriver.cs @@ -35,6 +35,8 @@ public class OpenSeeVRMDriver : MonoBehaviour { [Tooltip("This is the blink smoothing factor for camera based blink tracking, with 0 being no smoothing and 1 being a fixed blink state.")] [Range(0, 1)] public float blinkSmoothing = 0.75f; + [Tooltip("When enabled, the blink state for both eyes is linked together.")] + public bool linkBlinks = true; [Tooltip("When enabled, the avatar's eye will move according to the face tracker's gaze tracking.")] public bool gazeTracking = true; [Tooltip("This is the right eye bone. When either eye bone is not set, the VRM look direction blendshapes are used instead.")] @@ -855,6 +857,12 @@ public class OpenSeeVRMDriver : MonoBehaviour { right = tmp; } + if (linkBlinks) { + float v = Mathf.Max(left, right); + left = v; + right = v; + } + vrmBlendShapeProxy.AccumulateValue(new BlendShapeKey(BlendShapePreset.Blink_R), right); vrmBlendShapeProxy.AccumulateValue(new BlendShapeKey(BlendShapePreset.Blink_L), left); }