From 8f3cb87217cc3d3c690cbfc4d86495f10fa1e19e Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 21 Oct 2024 19:10:30 +0900 Subject: [PATCH] impl expression binary and override combination https://github.com/vrm-c/vrm-specification/pull/487 --- .../Expression/DefaultExpressionValidator.cs | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/Assets/VRM10/Runtime/Components/Expression/DefaultExpressionValidator.cs b/Assets/VRM10/Runtime/Components/Expression/DefaultExpressionValidator.cs index b671a1608..afa56b138 100644 --- a/Assets/VRM10/Runtime/Components/Expression/DefaultExpressionValidator.cs +++ b/Assets/VRM10/Runtime/Components/Expression/DefaultExpressionValidator.cs @@ -75,15 +75,45 @@ namespace UniVRM10 { if (key.IsBlink) { - actualWeights[key] = actualWeights[key] * blinkMultiplier; + if (_expressions[key].IsBinary) + { + if (blinkMultiplier < 1.0f) + { + actualWeights[key] = 0.0f; + } + } + else + { + actualWeights[key] = actualWeights[key] * blinkMultiplier; + } } else if (key.IsLookAt) { - actualWeights[key] = actualWeights[key] * lookAtMultiplier; + if (_expressions[key].IsBinary) + { + if (lookAtMultiplier < 1.0f) + { + actualWeights[key] = 0.0f; + } + } + else + { + actualWeights[key] = actualWeights[key] * lookAtMultiplier; + } } else if (key.IsMouth) { - actualWeights[key] = actualWeights[key] * mouthMultiplier; + if (_expressions[key].IsBinary) + { + if (mouthMultiplier < 1.0f) + { + actualWeights[key] = 0.0f; + } + } + else + { + actualWeights[key] = actualWeights[key] * mouthMultiplier; + } } }