WIP
上記のような複数のBlendShapeが別々のコンポーネントから設定された場合に、 BlendShape同士が競合することがわかりました。 後で設定した値で上書きされて希望のBlendShapeが適用されないという状態になります。 これを解決するために、一か所で中央集権的に制御する必要があります。
合成したり排他制御した、BlendShapeClipの集合のスナップショットをまとめて適用することを想定して SetValues
簡単なテストプログラムでの利用を想定しています。
例:
var proxy = GetComponent<VRMBlendShapeProxy>();
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1.0f);
例:
var proxy = GetComponent<VRMBlendShapeProxy>();
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f); // すぐに適用せずにたくわえる
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
proxy.Apply(); // 蓄積した値をまとめて適用する
下記のSetValuesを推奨しています。
BlendShape合成器が必要に応じ呼び出すことを想定しています。
例:
var proxy = GetComponent<VRMBlendShapeProxy>();
proxy.SetValues(new Dictionary<BlendShapeKey, float>
{
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f},
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f},
});