Merge pull request #2155 from Santarh/editorToolCanControlCustomExpressions

VRM10ExpressionEditorTool can control custom expressions.
This commit is contained in:
ousttrue
2023-10-12 13:18:37 +09:00
committed by GitHub

View File

@@ -89,11 +89,8 @@ namespace UniVRM10
foreach (var kv in runtime.GetWeights())
{
var key = kv.Key;
if (kv.Key.Preset != ExpressionPreset.custom)
{
var value = ExpressionPresetSlider(expression, kv.Key.Preset, kv.Value);
m_map[key] = value;
}
var value = ExpressionSlider(key, kv.Value);
m_map[key] = value;
}
GUILayout.FlexibleSpace();
@@ -118,10 +115,10 @@ namespace UniVRM10
}
}
float ExpressionPresetSlider(VRM10ObjectExpression expression, ExpressionPreset preset, float value)
float ExpressionSlider(ExpressionKey key, float value)
{
EditorGUILayout.BeginHorizontal(Style);
EditorGUILayout.LabelField(preset.ToString());
EditorGUILayout.LabelField(key.ToString());
value = EditorGUILayout.Slider(value, 0, 1.0f);
EditorGUILayout.EndHorizontal();
return value;