Skip to content

Commit

Permalink
impl expression binary and override combination
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Oct 21, 2024
1 parent 6ff6202 commit ee4f3a0
Showing 1 changed file with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,52 @@ public void Validate(IReadOnlyDictionary<ExpressionKey, float> inputWeights, IDi
var blinkMultiplier = 1f - blinkOverrideRate;
var lookAtMultiplier = 1f - lookAtOverrideRate;
var mouthMultiplier = 1f - mouthOverrideRate;
Debug.Log($"m{mouthMultiplier} b{blinkMultiplier} l{lookAtMultiplier}");

// 3. Set procedural key's weights.
foreach (var key in _keys)
{
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;
}
}
}

Expand Down

0 comments on commit ee4f3a0

Please sign in to comment.