Merge pull request #2128 from notargs/set_weights_non_alloc

Add Vrm10RuntimeExpression.SetWeightNonAlloc method
This commit is contained in:
Masataka SUMI
2023-08-15 12:24:23 +09:00
committed by GitHub

View File

@@ -91,6 +91,18 @@ namespace UniVRM10
Apply();
}
public void SetWeightsNonAlloc(Dictionary<ExpressionKey, float> weights)
{
foreach (var (expressionKey, weight) in weights)
{
if (_inputWeights.ContainsKey(expressionKey))
{
_inputWeights[expressionKey] = weight;
}
}
Apply();
}
public void SetWeight(ExpressionKey expressionKey, float weight)
{
if (_inputWeights.ContainsKey(expressionKey))