diff --git a/Editor/uLipSyncBlendShapeEditor.cs b/Editor/uLipSyncBlendShapeEditor.cs index 08b0359..cdd6835 100644 --- a/Editor/uLipSyncBlendShapeEditor.cs +++ b/Editor/uLipSyncBlendShapeEditor.cs @@ -44,6 +44,7 @@ public override void OnInspectorGUI() if (EditorUtil.Foldout("Blend Shapes", true)) { ++EditorGUI.indentLevel; + EditorUtil.DrawProperty(serializedObject, nameof(blendShape.maxBlendShapeValue)); DrawBlendShapeReorderableList(); --EditorGUI.indentLevel; EditorGUILayout.Separator(); diff --git a/Runtime/uLipSyncBlendShape.cs b/Runtime/uLipSyncBlendShape.cs index ce69a4e..12320c8 100644 --- a/Runtime/uLipSyncBlendShape.cs +++ b/Runtime/uLipSyncBlendShape.cs @@ -21,6 +21,7 @@ public class BlendShapeInfo public UpdateMethod updateMethod = UpdateMethod.LateUpdate; public SkinnedMeshRenderer skinnedMeshRenderer; public List blendShapes = new List(); + public float maxBlendShapeValue = 100f; public float minVolume = -2.5f; public float maxVolume = -1.5f; [Range(0f, 0.3f)] public float smoothness = 0.05f; @@ -169,7 +170,7 @@ protected virtual void OnApplyBlendShapes() { if (bs.index < 0) continue; float weight = skinnedMeshRenderer.GetBlendShapeWeight(bs.index); - weight += bs.weight * bs.maxWeight * volume * 100; + weight += bs.weight * bs.maxWeight * volume * maxBlendShapeValue; skinnedMeshRenderer.SetBlendShapeWeight(bs.index, weight); } } @@ -222,7 +223,7 @@ public override List GetPropertyWeights() foreach (var bs in blendShapes) { if (bs.index < 0) continue; - var weight = bs.weight * bs.maxWeight * volume * 100f; + var weight = bs.weight * bs.maxWeight * volume * maxBlendShapeValue; weights.Add(weight); }