impl expression binary and override combination

https://github.com/vrm-c/vrm-specification/pull/487
This commit is contained in:
ousttrue
2024-10-21 19:10:30 +09:00
parent 6ff6202020
commit 8f3cb87217

View File

@@ -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;
}
}
}