Skip to content

Commit

Permalink
Fixed BrowExpression merged parameters not having proper scaling.
Browse files Browse the repository at this point in the history
  • Loading branch information
regzo2 committed Mar 24, 2023
1 parent 014f0b1 commit 13f6b84
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions VRCFaceTracking/Params/Expressions/UnifiedExpressionsMerger.cs
Expand Up @@ -85,19 +85,19 @@ public static class UnifiedExpressionsMerger

// -1 = 'Angry', +1 = 'Worried'
new EParam(exp =>
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpRight].Weight + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpRight].Weight) -
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpRight].Weight * .5f + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpRight].Weight * .5f) -
GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownRight),
"v2/BrowExpressionRight"),

new EParam(exp =>
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpLeft].Weight + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpLeft].Weight) -
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpLeft].Weight * .5f + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpLeft].Weight * .5f) -
GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownLeft),
"v2/BrowExpressionLeft"),

new EParam(exp =>
(Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpRight].Weight + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpRight].Weight) -
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowPinchRight].Weight + exp.Shapes[(int)UnifiedExpressions.BrowLowererRight].Weight)) +
(GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownRight) - GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownLeft)) / 2.0f,
(Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowInnerUpRight].Weight * .5f + exp.Shapes[(int)UnifiedExpressions.BrowOuterUpRight].Weight * .5f) -
Math.Min(1, exp.Shapes[(int)UnifiedExpressions.BrowPinchRight].Weight * .5f + exp.Shapes[(int)UnifiedExpressions.BrowLowererRight].Weight * .5f)) +
GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownRight) * .5f - GetSimpleShape(exp, UnifiedSimpleExpressions.BrowDownLeft) * .5f,
"v2/BrowExpression"),

#endregion
Expand Down Expand Up @@ -201,7 +201,7 @@ public static class UnifiedExpressionsMerger

new EParam(exp =>
GetSimpleShape(exp, UnifiedSimpleExpressions.MouthSmileRight) * .5f + GetSimpleShape(exp, UnifiedSimpleExpressions.MouthSmileLeft) * .5f -
exp.Shapes[(int)UnifiedExpressions.MouthFrownRight].Weight * .5f + exp.Shapes[(int)UnifiedExpressions.MouthFrownLeft].Weight * .5f,
exp.Shapes[(int)UnifiedExpressions.MouthFrownRight].Weight * .5f - exp.Shapes[(int)UnifiedExpressions.MouthFrownLeft].Weight * .5f,
"v2/SmileFrown"),

// Smile 'Sad' contains both the stretcher and frown shapes to represent sad (similar in functionality to SRanipal Sad, just with explicit acknowledgment of lessened tracking fidelity).
Expand Down

0 comments on commit 13f6b84

Please sign in to comment.