mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 05:19:14 -05:00
Rename
This commit is contained in:
@@ -179,9 +179,9 @@ namespace UniVRM10
|
||||
EditorGUILayout.LabelField("Override weights", EditorStyles.boldLabel);
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
{
|
||||
EditorGUILayout.Slider("Blink override weight", m_target.Expression.OverrideBlinkWeight, 0f, 1f);
|
||||
EditorGUILayout.Slider("LookAt override weight", m_target.Expression.OverrideLookAtWeight, 0f, 1f);
|
||||
EditorGUILayout.Slider("Mouth override weight", m_target.Expression.OverrideMouthWeight, 0f, 1f);
|
||||
EditorGUILayout.Slider("Blink nullify weight", m_target.Expression.BlinkNullifyWeight, 0f, 1f);
|
||||
EditorGUILayout.Slider("LookAt nullify weight", m_target.Expression.LookAtNullifyWeight, 0f, 1f);
|
||||
EditorGUILayout.Slider("Mouth nullify weight", m_target.Expression.MouthNullifyWeight, 0f, 1f);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace UniVRM10
|
||||
|
||||
}
|
||||
|
||||
public void Validate(IReadOnlyDictionary<ExpressionKey, float> inputWeights, IDictionary<ExpressionKey, float> actualWeights)
|
||||
public void Validate(IReadOnlyDictionary<ExpressionKey, float> inputWeights, IDictionary<ExpressionKey, float> actualWeights, out float blinkNullifyWeight,
|
||||
out float lookAtNullifyWeight, out float mouthNullifyWeight)
|
||||
{
|
||||
foreach (var (key, weight) in inputWeights)
|
||||
{
|
||||
@@ -21,6 +22,10 @@ namespace UniVRM10
|
||||
|
||||
actualWeights[key] = weight;
|
||||
}
|
||||
|
||||
blinkNullifyWeight = 0f;
|
||||
lookAtNullifyWeight = 0f;
|
||||
mouthNullifyWeight = 0f;
|
||||
}
|
||||
|
||||
public sealed class Factory : IExpressionValidatorFactory
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace UniVRM10
|
||||
/// <summary>
|
||||
/// Validate input weights with Expression constraints.
|
||||
/// </summary>
|
||||
void Validate(IReadOnlyDictionary<ExpressionKey, float> inputWeights, IDictionary<ExpressionKey, float> actualWeights);
|
||||
void Validate(IReadOnlyDictionary<ExpressionKey, float> inputWeights, IDictionary<ExpressionKey, float> actualWeights,
|
||||
out float blinkNullifyWeight, out float lookAtNullifyWeight, out float mouthNullifyWeight);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,9 @@ namespace UniVRM10
|
||||
public IReadOnlyList<ExpressionKey> ExpressionKeys => _keys;
|
||||
public IReadOnlyDictionary<ExpressionKey, float> ActualWeights => _actualWeights;
|
||||
|
||||
public float OverrideBlinkWeight { get; private set; }
|
||||
public float OverrideLookAtWeight { get; private set; }
|
||||
public float OverrideMouthWeight { get; private set; }
|
||||
public float BlinkNullifyWeight { get; private set; }
|
||||
public float LookAtNullifyWeight { get; private set; }
|
||||
public float MouthNullifyWeight { get; private set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -93,8 +93,11 @@ namespace UniVRM10
|
||||
/// </summary>
|
||||
private void Apply()
|
||||
{
|
||||
_validator.Validate(_inputWeights, _actualWeights);
|
||||
_validator.Validate(_inputWeights, _actualWeights, out var blink, out var lookAt, out var mouth);
|
||||
_merger.SetValues(_actualWeights);
|
||||
BlinkNullifyWeight = blink;
|
||||
LookAtNullifyWeight = lookAt;
|
||||
MouthNullifyWeight = mouth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user