From 2e5b187b6c8b9ae2b1906767542a096d92c23e0f Mon Sep 17 00:00:00 2001 From: PoChangSu Date: Thu, 30 Jul 2020 13:51:38 +0900 Subject: [PATCH] BlendShape AccumulateValue will not be over 100 --- .../VRM/UniVRM/Scripts/BlendShape/BlendShapeBindingMerger.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/VRM/UniVRM/Scripts/BlendShape/BlendShapeBindingMerger.cs b/Assets/VRM/UniVRM/Scripts/BlendShape/BlendShapeBindingMerger.cs index 734d8c9e4..0dbfd1745 100644 --- a/Assets/VRM/UniVRM/Scripts/BlendShape/BlendShapeBindingMerger.cs +++ b/Assets/VRM/UniVRM/Scripts/BlendShape/BlendShapeBindingMerger.cs @@ -96,7 +96,8 @@ namespace VRM float acc; if (m_blendShapeValueMap.TryGetValue(binding, out acc)) { - m_blendShapeValueMap[binding] = acc + binding.Weight * value; + var accumulatedSum = acc + binding.Weight * value; + m_blendShapeValueMap[binding] = Mathf.Clamp(accumulatedSum, 0.0f, 100.0f); } else {